Tap here to compare the top VoIP providersTap here to hide the top VoIP Providers
Building Asterisk on MacOSX
Getting MacOSX Developer toolsIf 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 TigerI 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 Tiger
Upgrading BisonAfter 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)
- 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 instructionsYou 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
at a Terminal prompt.
$ sudo launchctl launchd% load /Library/LaunchDaemons launchd% start org.asterisk.asterisk
N.B. In this example, Asterisk is installed in /usr/local/asterisk. If you built Asterisk from scratch and didn't change the Makefile, this is probably not where it is, so you will have to change the line in the ProgramArguments section to match your installation.
<?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:
Next, alter the asterisk.plist file by changing the ProgramArguments section to read
# # 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
This will automatically start Asterisk inside a screen session; if you are one of the users listed in the acladd commands at the end of the screenrc file, you can connect to Asterisk's console by entering
<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>
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.
$ screen -r asterisk/
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
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+