November 23, 2008

Macports Asterisk PBX on Mac OS X Leopard 10.5.5 -- it works

Installing the Macports distribution of Asterisk PBX on Apple Mac OS X Leopard 10.5.5 was straightforward. There were quite a few permissions to adjust and asterisk.conf had to be adapted to the Macports installation paths but overall it was pretty easy. If you have IP Telephones like Cisco and Grandstream that use tftp to load configurations, you will need to start the OS X tftp server. Note also that /private/tftpboot is not backed up by Time Machine so you will need to copy it periodically someplace that is covered by Time Machine.

Using launchd to start Asterisk is easy with a start script. Not sure if this came with the distribution of if it was left over from a source build. A simple launchctl script can be developed from the launchd.plist man page

6 comments:

  1. where is this asterisk.conf and could you post some sample code? I'm running into:

    Unable to connect to remote asterisk (does /opt/local/var/run/asterisk.ctl exist?)

    suspecting it's because the conf doesn't know about the macport install.

    ReplyDelete
  2. /opt/local/etc/asterisk is the location of asterisk.conf and associated asterisk configuration files. Here is the contents of mine. You need to make sure all the referenced directories exist.
    [directories]
    astetcdir => /opt/local/etc/asterisk
    astmoddir => /opt/local/lib/asterisk/modules
    astvarlibdir => /opt/local/var/lib/asterisk
    astagidir => /opt/local/var/lib/asterisk/agi-bin
    astspooldir => /opt/local/var/spool/asterisk
    astrundir => /opt/local/var/run/asterisk
    astlogdir => /opt/local/var/log/asterisk

    The launchd script should be /Library/LaunchDaemons/org.asterisk.asterisk.plist

    Details of the file are discusses at: http://www.voip-info.org/wiki/view/Building+Asterisk+on+MacOSX

    ReplyDelete
  3. I am having the same problem.

    1. My /opt/local/etc/asterisk does not have a asterisk.conf file. Where do I get the configuration file from?

    2. Some of the above directories do not exist. Do I just make them using mkdir?

    Thanks.

    ReplyDelete
  4. MK, you can copy the contents of my asterisk.conf file from my previous comment and yes, make the directories with mkdir.

    ReplyDelete
  5. Thanks very much.

    I got a conf file from somewhere else and it had an extra directory which I set as:

    astdatadir => /opt/local/var/lib/asterisk

    This is the same as the astvarlibdir. I am not sure why it is there.

    I had to run it as "sudo asterisk", otherwise it cannot work with the pid, ctl and log files. Is that okay?

    ReplyDelete