My company’s UNIX team requires applications to run under /opt/apps/. I’m trying to use the -C option when I run asterisk (usr/sbin/asterisk -C /opt/apps/…/asterisk.conf).

In asterisk.conf, I’ve set astrundir => /opt/apps/asterisk/var/run. and asterisk.ctl show up in this directory, but I can’t reconnect to the cli (usr/sbin/asterisk -r).

What am I doing wrong?


I’m answering my own question here. I thought someone might have this same question in the future.

When you run /usr/sbin/asterisk -r, the asterisk binary runs again and it’s default path to asterisk.conf is /etc/asterisk/. This might have been obvious to someone more experienced with UNIX, but it alluded me. To reconnect to asterisk when asterisk.conf is located anywhere other can /etc/asterisk you must use both -r and -C. In may case, to reconnect to the CLI, I have to run /usr/sbin/asterisk -rC /opt/apps/…/asterisk.conf.

The result in my case, was that /opt/apps/…/asterisk.conf pointed the binary to the correct place to reconnect me to the cli.

Thanks for sharing gv82, was useful to me.


Marco Bruni