Building Asterisk on MacOSX
Created by: STS,Last modification on Tue 01 of Jan, 2008 [20:00 UTC] by purecanesugar
Getting MacOSX Developer tools
If you want to build Asterisk yourself, you will need to get CVS and GCC installed on your Mac. To do this you must install Apple's Xcode Tools on your system. The Xcode Tools are part of the MacOSX Panther installation CD set and they are also on the Tiger installation DVD. However, you can also download them from Apple's Xcode Tools Download site. Note: On MacOSX "Jaguar" (ver 10.2) these tools were called Apple Developer Tools.Cookbook for Asterisk 1.2.1 on Panther or Tiger
I have just installed and/or upgraded Asterisk 1.0.7 to Asterisk 1.2.1 (currently the latest version) on both Panther and Tiger. The installation "from scratch" was trivially easy. But in addition, I'm running a production Asterisk home-based system with some 25 trunking and peering relationship and many stations and a very complicated dialplan, and the upgrade was not particularly painful. Rather than replacing all of this much older information, I've written a completely new page Cookbook for Installing or Upgrading Asterisk 1.2.1 on Mac OSX Panther and TigerUpgrading Bison
After you have installed Xcode or Developer Tools, you will need to upgrade bison. Bison 1.75 is recommended.- Download Bison 1.75 - Download link
- Open a new shell window in Terminal
- Assuming your bison package was downloaded and extracted to a folder named Downloads inside your home folder, do the following...
- cd ~/Downloads/bison-1.75
- ./configure (or "./configure --prefix=/usr" ... see below)
- make
- sudo make install
- Verify the installation with the following command ...
- bison --version
- it should show something like "bison (GNU Bison) 1.75"
Follow the build instructions
You are now ready to build Asterisk following the instructions on the Asterisk download page. This no longer goes anywhere pertinent, someone needs to fix it.In the meantime, I found these:
Starting Asterisk automatically during system startup
There are two methods through which software can be started automatically during system startup:
- Startup Items (available on MacOS X versions 10.2, 10.3 and 10.4)
- Launchd Service (available on MacOS X version 10.4 only)
Using Startup Items
When using the Asterisk build and/or Asterisk Launcher from Sunrise Ltd., a startup item for Asterisk will automatically be installed and it can be enabled and disabled using Asterisk Launcher. Since these tools are meant to work at least on the current and the previous MacOS X version, launchd will not be used before the release of MacOS X 10.5.
Using launchd (on Mac OS X 10.4 only)
On Mac OS X 10.4 and later, you may manually install a launchd service to start Asterisk. To do this, put the text below in a file called /Library/LaunchDaemons/org.asterisk.asterisk.plist, create a user and group called asterisk (if you don't do this, Asterisk is running as root; this is undesirable because a bug in Asterisk could then provide hackers with root access to your machine), then do the following
$ sudo launchctl
launchd% load /Library/LaunchDaemons
launchd% start org.asterisk.asteriskat a Terminal prompt.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.asterisk.org.asterisk</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/asterisk/sbin/asterisk</string>
<string>-f</string>
</array>
<key>UserName</key>
<string>asterisk</string>
<key>GroupName</key>
<string>asterisk</string>
<key>OnDemand</key>
<false/>
<key>ServiceDescription</key>
<string>Asterisk PBX</string>
</dict>
</plist>It it also sometimes useful to configure things so that the Asterisk console is redirected using screen; to do that, create a file called screenrc in some directory on your system (in this example, we put it in /usr/local/asterisk/etc/screenrc, but you can put it in any convenient location). Then in the file, write the following:
#
# screenrc file used for Asterisk console
#
# Screen size
height 60 80
# Enable multi-user mode
multiuser on
# List all the users who should have access to the console here
acladd barney
acladd jeff
acladd joe <key>ProgramArguments</key>
<array>
<string>/usr/bin/screen</string>
<string>-D</string>
<string>-m</string>
<string>-c</string>
<string>/usr/local/asterisk/etc/screenrc</string>
<string>/usr/local/asterisk/sbin/asterisk</string>
<string>-vc</string> $ screen -r asterisk/at a shell prompt. The benefit of using screen is that you can see the recent messages output by Asterisk on the console, whereas connecting using Asterisk's own built-in support will create a new console.
How you can contribute to this Wiki
- Please add your comments on how you were able to get Asterisk installed, stating the versions for both Asterisk and MacOSX.
Asterisk | Asterisk MacOSX Support

Comments
333Re: Using StartupItems instead of launchctl
333Using StartupItems instead of launchctl
create a file call aststart.sh
put the content below in it...
then chmod 750 ./aststart.sh
and then run it by typing ./aststart.sh
NOTE This startup script assumes many things, most important of which is that you are not running asterisk as root. If you are - you will need to modify the resulting files.
======ASTSTART.SH======
333OS X Users
333Re: OSX intel
333OSX intel
1) wav and wav49 seem busted, use gsm for your vm and announcements
2) Still having trouble with moh, but I recall reading some stuff about it working and can't find it again, so I'm still hopeful...
333Macintel ?
Is there anybody who tried ?