Cookbook for Installing or Upgrading Asterisk 1.2.1 on Mac OSX Panther and Tiger

Developer Tools

On both Panther and Tiger, I simply installed the Mac OS X Developer XCode Tools, right off the CD from the Mac OS X release. This was easy. Please note that I'm an OpenVMS OS developer, mostly used to programming in BLISS and Macro-32, but with a lot of experience in C kernel coding, too. I can't claim to be either a Unix or Mac OS X "expert", but basic knowledge was all it took to make all of this work. Once the Developer Tools were installed, everything related to Asterisk was done from "Terminal". In fact, I was connected to my production Asterisk machine on the Mac OS X system I use as my firewall and gateway via an ssh session, and never even touched the machine itself during the entire upgrade.

Downloading and building the Asterisk release

I logged into my system as root, and was working from the "root" home directory, /var/root. I went to www.asterisk.org and saved the link for downloading Asterisk 1.2.1. Then I used that link in the following curl command:
curl -O http://ftp.digium.com/pub/asterisk/asterisk-1.2.4.tar.gz
I then decompressed the download:
yellow:tar -xvzf asterisk-1.2.4.tar.gz++
This automatically created and populated the directory /var/root/asterisk-1.2.1 with all the asterisk files. In the case of the upgrade, I saved all the files in /etc/asterisk, all the files in /usr/lib/asterisk/modules, /usr/sbin/asterisk, and all the files in /var/lib/asterisk/agi-bin before proceeding, just in case they might be needed. They weren't really needed, but I recommend saving at least these files before an upgrade, or possibly making a full backup of your system.
Then I built asterisk, no problems at all:
cd asterisk-1.2.4
make clean
make install
On both Tiger and Panther, the 1.2.4 release simply builds correctly. This is really wonderful. The commands above also put all of the files except for the configuration files into their proper directories. For a new installation, make samples will create the config files but overwrite any existing ones. I used make samples on my clean installation when I was trying out 1.2.1 before upgrading my production server, and it might have also been easier than what I did on the production server (see below), as long as you saved your files from /etc/asterisk/conf with a cp -p command.

Starting Asterisk

On a new installation, the demo version of Asterisk is actually "ready to go" (at least to test) without even editing any of the config files. Since there are no supported sound cards on Mac OS X, the instructions in the readme are not useful. I always start asterisk with
asterisk -f
and then connect to it with
asterisk -vvvgr
To actually test it, you're going to have to connect from the outside somehow. Scroll down to an X-Lite test cookbook. Once you've proved that it works by connection to the "s@localhost" extension, you can configure asterisk as explained by all the other wonderful contributors to this Wiki.

Keeping Asterisk Running in a production environment

I make sure to start asterisk when the system comes up (after the network is up) with the following script:
#!/bin/bash
(while true;do (sleep 10;eval "renice -20 \$(cat /var/run/asterisk.pid)")&/usr/sbin/asterisk -f;done)>/dev/null 2>/dev/null&

This keeps it running no matter what. If something goes wrong, it will continue to restart until you fix the problem.

The upgrade from 1.0.7

This was pretty easy. A few config files need some minor changes, and this is pretty well explained in the files that come with the download. At the end of the make install there was a list of a few modules that need to be deleted before you start running asterisk: app_striplsd.so, app_substring.so, chan_modem.so, chan_modem_aopen.so, chan_modem_bestdata.so, chan_modem_i4l.so, pbx_wilcalu.so.
Good luck!


X-Lite test configuration

To use X-Lite to test the unconfigured Asterisk installation, try this minimum setup for sip dialing with X-Lite, no provider.

Download: http://www.xten.com/index.php?menu=download

Go through the Audio Tuning Wizard. Defaults are usually fine.

After that, a menu will appear automatically after a short delay. (to get this menu back later press the "menu" icon to the right of "clear" and go to System Settings->SIP Proxy->Default)

Make the following changes (do not change anything else):

Enabled -> Yes
Display Name->Your Name
Username->any email username (the part before the @)
Domain/Realm->any email domain (the part after the @)
Send Internal IP->always (this is only for this test; normally you use default!)
(this last one requires you to scroll down with the arrow at the bottom left)
Direct Dial IP: Yes

After you do this, close the menu. You might have to close it twice, but then it should not open.

Connect to your asterisk server with s@localhost.

Developer Tools

On both Panther and Tiger, I simply installed the Mac OS X Developer XCode Tools, right off the CD from the Mac OS X release. This was easy. Please note that I'm an OpenVMS OS developer, mostly used to programming in BLISS and Macro-32, but with a lot of experience in C kernel coding, too. I can't claim to be either a Unix or Mac OS X "expert", but basic knowledge was all it took to make all of this work. Once the Developer Tools were installed, everything related to Asterisk was done from "Terminal". In fact, I was connected to my production Asterisk machine on the Mac OS X system I use as my firewall and gateway via an ssh session, and never even touched the machine itself during the entire upgrade.

Downloading and building the Asterisk release

I logged into my system as root, and was working from the "root" home directory, /var/root. I went to www.asterisk.org and saved the link for downloading Asterisk 1.2.1. Then I used that link in the following curl command:
curl -O http://ftp.digium.com/pub/asterisk/asterisk-1.2.4.tar.gz
I then decompressed the download:
yellow:tar -xvzf asterisk-1.2.4.tar.gz++
This automatically created and populated the directory /var/root/asterisk-1.2.1 with all the asterisk files. In the case of the upgrade, I saved all the files in /etc/asterisk, all the files in /usr/lib/asterisk/modules, /usr/sbin/asterisk, and all the files in /var/lib/asterisk/agi-bin before proceeding, just in case they might be needed. They weren't really needed, but I recommend saving at least these files before an upgrade, or possibly making a full backup of your system.
Then I built asterisk, no problems at all:
cd asterisk-1.2.4
make clean
make install
On both Tiger and Panther, the 1.2.4 release simply builds correctly. This is really wonderful. The commands above also put all of the files except for the configuration files into their proper directories. For a new installation, make samples will create the config files but overwrite any existing ones. I used make samples on my clean installation when I was trying out 1.2.1 before upgrading my production server, and it might have also been easier than what I did on the production server (see below), as long as you saved your files from /etc/asterisk/conf with a cp -p command.

Starting Asterisk

On a new installation, the demo version of Asterisk is actually "ready to go" (at least to test) without even editing any of the config files. Since there are no supported sound cards on Mac OS X, the instructions in the readme are not useful. I always start asterisk with
asterisk -f
and then connect to it with
asterisk -vvvgr
To actually test it, you're going to have to connect from the outside somehow. Scroll down to an X-Lite test cookbook. Once you've proved that it works by connection to the "s@localhost" extension, you can configure asterisk as explained by all the other wonderful contributors to this Wiki.

Keeping Asterisk Running in a production environment

I make sure to start asterisk when the system comes up (after the network is up) with the following script:
#!/bin/bash
(while true;do (sleep 10;eval "renice -20 \$(cat /var/run/asterisk.pid)")&/usr/sbin/asterisk -f;done)>/dev/null 2>/dev/null&

This keeps it running no matter what. If something goes wrong, it will continue to restart until you fix the problem.

The upgrade from 1.0.7

This was pretty easy. A few config files need some minor changes, and this is pretty well explained in the files that come with the download. At the end of the make install there was a list of a few modules that need to be deleted before you start running asterisk: app_striplsd.so, app_substring.so, chan_modem.so, chan_modem_aopen.so, chan_modem_bestdata.so, chan_modem_i4l.so, pbx_wilcalu.so.
Good luck!


X-Lite test configuration

To use X-Lite to test the unconfigured Asterisk installation, try this minimum setup for sip dialing with X-Lite, no provider.

Download: http://www.xten.com/index.php?menu=download

Go through the Audio Tuning Wizard. Defaults are usually fine.

After that, a menu will appear automatically after a short delay. (to get this menu back later press the "menu" icon to the right of "clear" and go to System Settings->SIP Proxy->Default)

Make the following changes (do not change anything else):

Enabled -> Yes
Display Name->Your Name
Username->any email username (the part before the @)
Domain/Realm->any email domain (the part after the @)
Send Internal IP->always (this is only for this test; normally you use default!)
(this last one requires you to scroll down with the arrow at the bottom left)
Direct Dial IP: Yes

After you do this, close the menu. You might have to close it twice, but then it should not open.

Connect to your asterisk server with s@localhost.
Created by: jcovert, Last modification: Mon 21 of Feb, 2011 (21:30 UTC) by spamblock
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+