<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Shady Project: Category Unix</title>
    <link>http://blog.shadyproject.net/articles/category/unix</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stuff.  And Things.</description>
    <item>
      <title>Adventures with Asterisk</title>
      <description>&lt;p&gt;
Tried to setup an asterisk server at work to replace our aging NT 4 phone server. This was not the open source success story&amp;#174 I expected it to be, but it wasn't a total loss.
&lt;/p&gt;
&lt;p&gt;
We have a very old phone server at work. It's NT4, 4 GB, running TeleVantage 4, which doesn't even exist anymore.
I said to my self 'self, I bet we could turn this into an open source success.  Just set up a FreeBSD box, throw asterisk on it, plug in the cards, and be done with it.  We can even upgrade to VoIP later.  I'll be a hero at work!'  Sadly, after saying this to myself, I pitched it to the boss. What I thought would be a simple one day  project, turned into a two day slog through the arcana of linux, old compaq servers, and telecomm hardware.
&lt;/p&gt;

&lt;p&gt;
I've long been a fan of the BSDs as opposed to most linux distributions.  It's nothing personal, really, to me it just seems that the FreeBSD system feels more put together then your average linux distro.  Besides, ports rocks the socks off of apt.
&lt;/p&gt;

&lt;p&gt;
The first suprise came when I installed the ports version of asterisk onto bsd.  It turns out that this in and of itself wasn't a problem, except for two things:  &lt;ol&gt;
&lt;li&gt;The ports version is several versions behind the version on 
the official site, and a rather large, ugly security vulnerability in IAX (the protocol used to send VoIP 
messages between asterisk servers).&lt;/li&gt; 
&lt;li&gt;There is no, i repeat, NO support for hardware on BSD.  None, zip, zilch.
Asterisk uses zaptel for its hardware support, and this is a linux only soltion.&lt;/li&gt;
&lt;/ol&gt;
If you want to run asterisk on a BSD server, you are limited to VoIP only.  Of course number 2 was discovered after i had successfully installed freebsd on an AMD64 box, set up kde, all the editors, and the necessary software to make it useable including gastman, the graphical configuration tool for asterisk. Figures.
&lt;/p&gt;

&lt;p&gt;
So I had to decide on a linux solution. I decided to go with Ubuntu.  My friend is a fan of it, and its rather nice on the desktop, despite not installing any dev tools or useful libraries by default. I figures this would not be the case with the server OS.  I mean, seriously, who would create a server installation without development tools?
&lt;/p&gt;

&lt;p&gt;
Ubuntu, apparently.  I downloaded the sources for asterisk, the addons, zaptel, libpri, and the nice sounds.  ran make.  No go.  So i had to go hunt down the dev tools.  Which meant that i had to use apt.  I really dont like apt, I mean sure it does a nice job of actually installig stuff, but there is, as far as i can tell, no useful search feature.  So i had to randomly guess at package names, or try basic wildcards, like (ironically) * to see if i could get packages to install. I managed to get the kernel sources installed (required for zaptel).  This was somewhat frustrating.  After consulting the documentation i discovered aptitude, which made it at least possible to browse the available packages, so i could get the actual names.  Not as efficient as searching in darwin ports, or freebsd ports use of the whereis command, but good enough for now. I managed to get libssl installed, ncurses, gcc4 and the other deps for asterisk installed.  I sumamrily built zaptel with no problems.
&lt;/p&gt;

&lt;p&gt;
The cofig target in make is very useful on linux.  it autodected my init type (debian init.d) and wrote the startup scripts into the appropriate place.  I was then able to run update-rc.d zaptel defaults to create the startup entry so that the zaptel drivers would be loaded at start up.  Things where starting to look up. libpri built without a problem as well. Building asterisk also succeeded once i finished installing the necessary libs.  Time to start it up.
&lt;/p&gt;

&lt;p&gt;
Asterisk also has a configure target for make, but this only supports the red hat init style.  Fortunatley, there was a debian entry in the contribs directory that i coudl copy to /etc/init.d.  The same update-rc.d command that worked for zaptel worked for asterisk.  Everything thing was going great.  
&lt;/p&gt;

&lt;p&gt;
Some of the more observant among you might notice that I didnt try to run asterisk standalone before i went and put it into the startup sequence.  This was a huge mistake. Asterisk was crapping the bed on startup, writing annoying 'exited with code 1 restarting' messages to the screen every 2 seconds.  It was alsmost impossible to log in and remove the startup entry and reboot, but eventually i got it to work.
&lt;/p&gt;

&lt;p&gt;
The reason asterisk was crashing, it turns out, was that by default it loads the chan_oss drivers for sound support.  Which is nice and all, but Ubuntu uses alsa drivers, which are by default set to noload.  This was a simple google search away and once I fixed this problem asterisk was up and running, on boot up, with no problems.  Time to configure server and add the hardware.  No problem, right?
&lt;/p&gt;

&lt;p&gt;
Not so much.  The first issue was that when i went to the congfiguration directory, there were no config files to be found. none.  yet asterisk was still running.  What the hell was going on?  Well, by default asterisk was not installing the sample configuration files.  running make samples fixed that, but to me it still seems pretty weird to not install configs by default.
&lt;/p&gt;

&lt;p&gt;
Now it was high time to install the cards and start working.  Alas, there Dialogic support is crappy in zaptel, and the Digium guys make you pay for it. Digium is the company that sponsors asterisk development.  They need to make, money, which is cool, so their hardware is supported out of the box by asterisk and zaptel.  Dialogic hardware has only very very basic support. Of course, Dialogic is, like , freaking Gigantic.  They are part of Intel.  They are a huge huge maker of telephony equipment, and support for them is limited in asterisk in lieu of pay for solutions.  This doesn't quite sit well with me. I know the asterisk guys need to make money, but you'd think they would have better support for one of the larger vendors in telecomm. Boo Hiss.
&lt;/p&gt;

&lt;p&gt;
Next I decided to try building gastman on ubuntu, but i coudln't even get it to build.  something about a signedness error ona pointer in MD5.  Screw it, i figured, I'll edit the files by hand
&lt;/p&gt;

&lt;p&gt;
So I edited the files by hand, and finally got everything up and running and working, sans hardware support. Of course, none of this was actually a useful replacement for our existing phone system, but at least I learned a lot about asterisk.
&lt;/p&gt;

&lt;p&gt;
I also learned that I &lt;strong&gt;hate&lt;/strong&gt; telephony.
&lt;/p&gt;</description>
      <pubDate>Tue, 22 Aug 2006 08:46:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:94fee30a-7b9c-45c5-bd82-31183c651ded</guid>
      <author>Shady</author>
      <link>http://blog.shadyproject.net/articles/2006/08/22/adventures-with-asterisk</link>
      <category>Unix</category>
      <category>Asterisk</category>
      <category>Telephony</category>
    </item>
  </channel>
</rss>
