For example, the error message:
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
Exception: Unable to connect to Asterisk through the CLI in file /var/lib/asterisk/bin/retrieve_conf on line 30
1. Exception->() /var/lib/asterisk/bin/retrieve_conf:30
Asterisk is probably running as the wrong user (root) perhaps because it was started as a service.
run chkconfig asterisk off to disable the service.
restart asterisk with
asterisk -rx ‘core stop now’