hh77
December 18, 2013, 12:00am
1
I installed asterisk on my MacBook Pro. I should be able to launch it in the background by entering ‘asterisk’. However when I do this is my output.
Gondolin:asterisk hh77$ sudo asterisk -q
Mac OS X detected. Use ‘launchctl load /Library/LaunchDaemon/org.asterisk.asterisk.plist’.
[Dec 17 17:53:03] NOTICE[2567]: cdr.c:1566 do_reload: CDR simple logging enabled.
[Dec 17 17:53:03] NOTICE[2567]: loader.c:1182 load_modules: 190 modules will be loaded.
[Dec 17 17:53:05] NOTICE[2567]: res_smdi.c:1418 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Dec 17 17:53:05] WARNING[2567]: loader.c:418 load_dynamic_module: Error loading module ‘res_pktccops’: dlopen(/Library/Application Support/Asterisk/Modules/modules/res_pktccops.so, 5): image not found
[Dec 17 17:53:05] WARNING[2567]: loader.c:894 load_resource: Module ‘res_pktccops’ could not be loaded.
[Dec 17 17:53:05] NOTICE[2567]: config.c:2215 ast_config_engine_register: Registered Config Engine curl
[Dec 17 17:53:05] NOTICE[2567]: res_config_ldap.c:1631 parse_config: No directory user found, anonymous binding as default.
[Dec 17 17:53:05] ERROR[2567]: res_config_ldap.c:1657 parse_config: No directory URL or host found.
[Dec 17 17:53:05] ERROR[2567]: res_config_ldap.c:1540 load_module: Cannot load LDAP RealTime driver.
[Dec 17 17:53:05] ERROR[2567]: res_config_pgsql.c:1554 pgsql_reconnect: PostgreSQL RealTime: Failed to connect database asterisk on 127.0.0.1:
[Dec 17 17:53:05] WARNING[2567]: res_config_pgsql.c:1506 parse_config: PostgreSQL RealTime: Couldn’t establish connection. Check debug.
[Dec 17 17:53:05] NOTICE[2567]: config.c:2215 ast_config_engine_register: Registered Config Engine pgsql
[Dec 17 17:53:05] NOTICE[2567]: chan_skinny.c:7730 config_load: Configuring skinny from skinny.conf
[Dec 17 17:53:05] ERROR[2567]: res_calendar_ews.c:911 load_module: Exchange Web Service calendar module require neon >= 0.29.1, but neon 0.30.0: Library build, IPv6, Expat 2.1.0, zlib 1.2.8, OpenSSL 1.0.1e 11 Feb 2013. is installed.
[Dec 17 17:53:05] NOTICE[2567]: cdr_pgsql.c:390 config_module: cdr_pgsql configuration contains no global section, skipping module load.
[Dec 17 17:53:05] WARNING[2567]: cel_pgsql.c:391 process_my_load_module: CEL pgsql config file missing global section.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:164 pbx_load_module: Starting AEL load process.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:177 pbx_load_module: AEL load process: parsed config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:180 pbx_load_module: AEL load process: checked config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:187 pbx_load_module: AEL load process: compiled config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:192 pbx_load_module: AEL load process: merged config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Dec 17 17:53:06] NOTICE[2567]: pbx_ael.c:195 pbx_load_module: AEL load process: verified config file name ‘/usr/local/etc/asterisk/extensions.ael’.
I tried running this ‘launchctl load /Library/LaunchDaemon/org.asterisk.asterisk.plist’ but this is what I got.
Gondolin:asterisk hh77$ sudo launchctl load /Library/LaunchDaemon/org.asterisk.asterisk.plist
launchctl: Couldn’t stat("/Library/LaunchDaemon/org.asterisk.asterisk.plist"): No such file or directory
nothing found to load
Gondolin:asterisk hh77$ ls -l /Library/LaunchDaemons/ | grep 'org.*'
lrwxr-xr-x 1 root admin 66 Jul 4 09:58 org.freedesktop.dbus-system.plist -> /opt/local/Library/LaunchDaemons/org.freedesktop.dbus-system.plist
-rw-r–r-- 1 root wheel 410 Oct 22 12:22 org.gpgtools.gpgmail.patch-uuid.plist
lrwxr-xr-x 1 root admin 100 Dec 5 08:50 org.macports.postgresql91-server.plist -> /opt/local/etc/LaunchDaemons/org.macports.postgresql91-server/org.macports.postgresql91-server.plist
lrwxr-xr-x 1 root admin 72 Nov 1 16:53 org.macports.slapd.plist -> /opt/local/etc/LaunchDaemons/org.macports.slapd/org.macports.slapd.plist
can anyone assist?
hh77
December 18, 2013, 6:41am
2
I discovered what I was missing and would like to post it. I hope this helps anyone who is running to similar issues.
when you install asterisk from source it does install the plist file in /Library/LaunchDaemon it is located in the directory of your install files (INSTALL_DIR/certified-asterisk-11.2-cert2/contrib/init.d/org.asterisk.asterisk.plist).
I needed to edit this file and replace “ASTERISK_SBIN_DIR ” with the actual location of the asterisk command (in my case it was the /usr/local/sbin directory) below is an example of the file.
I also needed to add a user and group named asterisk
I ran the following commands after I made those changes
sudo launchctl load /usr/src/certified-asterisk-11.2-cert2/contrib/init.d/org.asterisk.asterisk.plist
sudo launchctl list | grep ‘org.*’
3 org.asterisk.asterisk
0 org.postfix.master
124 - org.ntp.ntpd
0 org.cups.cupsd
sudo launchctl
launchd% start org.asterisk.asterisk
launchd% exit
Then verify!
ps aux | grep asterisk
asterisk 34362 99.8 0.4 2496232 33360 ?? Rs 9:53PM 21:10.34 /usr/local/sbin/asterisk -f
asterisk 34364 0.0 0.0 2463340 1416 ?? S 9:53PM 0:00.02 /usr/sbin/distnoted agent
asterisk 34360 0.0 0.1 2447544 5244 ?? Ss 9:52PM 0:00.12 /usr/libexec/xpcd
asterisk 34356 0.0 0.0 2445260 1012 ?? S 9:52PM 0:00.03 /usr/sbin/cfprefsd agent
asterisk 34353 0.0 0.0 2452940 792 ?? Ss 9:52PM 0:00.03 /sbin/launchd
The next issue I ran into was executing asterisk -r command. I keep getting this error: Unable to connect to remote asterisk (does /Library/Application Support/Asterisk/Run/asterisk.ctl exist?)
In order to fix this I needed to change the owner of the Run directory to asterisk. It was then able to create the asterisk.ctl and the asterisk.pid files in the directory. Here is the order that I did it.
sudo launchctl unload /Library/LaunchDaemons/org.asterisk.asterisk.plist NOTE: I moved a copy of the .plist file to this directory **
sudo chown -R asterisk /Library/Application\ Support/Asterisk/Run/
ls -l /Library/Application\ Support/Asterisk/
total 8
drwxr-xr-x 158 root admin 5372 Dec 17 21:11 Modules
drwxr-xr-x 2 asterisk admin 68 Dec 18 00:05 Run
drwxr-xr-x 2 root admin 68 Dec 16 19:16 agi-bin
-rw-r–r-- 1 root admin 3072 Dec 17 23:56 astdb.sqlite3
drwxr-xr-x 5 root admin 170 Dec 17 21:11 documentation
drwxr-xr-x 3 root admin 102 Dec 16 19:16 firmware
drwxr-xr-x 4 root admin 136 Dec 17 21:11 images
drwxr-xr-x 2 root admin 68 Dec 16 19:16 keys
drwxr-xr-x 11 root admin 374 Dec 16 19:16 moh
drwxr-xr-x 8 root admin 272 Dec 16 19:17 phoneprov
drwxr-xr-x 3 root admin 102 Dec 16 19:16 sounds
drwxr-xr-x 8 root admin 272 Dec 17 21:11 static-http
sudo launchctl load /Library/LaunchDaemons/org.asterisk.asterisk.plist
ps aux | grep asterisk
asterisk 323 99.9 0.4 2494692 32492 ?? Rs 12:28AM 6:28.70 /usr/local/sbin/asterisk -f
asterisk 311 0.0 0.0 2445260 960 ?? S 12:27AM 0:00.01 /usr/sbin/cfprefsd agent
asterisk 309 0.0 0.0 2463340 1400 ?? S 12:27AM 0:00.01 /usr/sbin/distnoted agent
asterisk 306 0.0 0.0 2452940 796 ?? Ss 12:27AM 0:00.01 /sbin/launchd
asterisk -r
Asterisk 11.2-cert2, Copyright © 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
Connected to Asterisk 11.2-cert2 currently running on Gondolin (pid = 323)
Gondolin*CLI>
ls -l /Library/Application\ Support/Asterisk/Run
total 8
srwxrwx— 1 asterisk admin 0 Dec 18 00:28 asterisk.ctl
-rw-rw---- 1 asterisk admin 4 Dec 18 00:28 asterisk.pid
-----------------------------------org.asterisk.asterisk.plist file----------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
Label
org.asterisk.asterisk
Disabled
UserName
asterisk
GroupName
asterisk
OnDemand
KeepAlive
RunAtLoad
Umask
7
Program
__ASTERISK_SBIN_DIR__/asterisk
ProgramArguments
__ASTERISK_SBIN_DIR__/asterisk
-f
EnvironmentVariables
TERM
xterm-color
SoftResourceLimits
NumberOfFiles
1024
Core
0
StandardInPath
/dev/null
StandardOutPath
/dev/null
StandardErrorPath
/dev/null