Unable to connect to remote asterisk on doing asterisk -r

deogratias picture deogratias · Aug 28, 2014 · Viewed 9.5k times · Source

I had installed asterisk 11.8 and create the a dialplan and tested it one week earlier ,it worked fine i was able to run asterisk -r and all my database transactions worked fine

But after one week ,now i am not able to switch to asterisk cli by asterisk -r it says Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?) i know this question is asked many times i tryed similar stack threads also but dint work output of asterisk -c is

Privilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
Asterisk 11.11.0, Copyright (C) 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
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.
=========================================================================
[ Initializing Custom Configuration Options ]
[Aug 28 16:44:55] NOTICE[18923]: cdr.c:1622 do_reload: CDR simple logging enabled.
[Aug 28 16:44:55] NOTICE[18923]: loader.c:1208 load_modules: 211 modules will be loaded.
.[Aug 28 16:44:55] NOTICE[18923]: res_odbc.c:1899 load_module: res_odbc loaded.
....[Aug 28 16:44:55] NOTICE[18923]: res_smdi.c:1418 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
.......[Aug 28 16:44:55] NOTICE[18923]: config.c:2504 ast_config_engine_register: Registered Config Engine sqlite3
[Aug 28 16:44:55] NOTICE[18923]: config.c:2504 ast_config_engine_register: Registered Config Engine odbc
........[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 1: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 2: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 3: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 4: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 5: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 6: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 7: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 8: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 9: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 10: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 11: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 12: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 13: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 14: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 15: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 17: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 18: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 19: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 20: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 21: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 22: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 23: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 24: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 25: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 26: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 27: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 28: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 29: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 30: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:8039 handle_alarms: Detected alarm on channel 31: Red Alarm
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:18700 process_dahdi: Ignoring any changes to 'userbase' (on reload) at line 23.
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:18700 process_dahdi: Ignoring any changes to 'vmsecret' (on reload) at line 31.
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:18700 process_dahdi: Ignoring any changes to 'hassip' (on reload) at line 35.
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:18700 process_dahdi: Ignoring any changes to 'hasiax' (on reload) at line 39.
[Aug 28 16:44:55] WARNING[18923]: chan_dahdi.c:18700 process_dahdi: Ignoring any changes to 'hasmanager' (on reload) at line 47.
..[Aug 28 16:44:55] NOTICE[18923]: chan_skinny.c:7736 config_load: Configuring skinny from skinny.conf
.....SIP channel loading...
[Aug 28 16:44:55] WARNING[18923]: sip/config_parser.c:812 sip_parse_nat_option: nat=yes is deprecated, use nat=force_rport,comedia instead
................................[Aug 28 16:44:55] NOTICE[18923]: cel_custom.c:95 load_config: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
..............................................................................[Aug 28 16:44:55] NOTICE[18923]: config.c:2504 ast_config_engine_register: Registered Config Engine mysql
.........[Aug 28 16:44:55] WARNING[18923]: pbx.c:9897 add_priority: Unable to register extension '_X.' priority 2 in 'voice-mail', already in use
.................[Aug 28 16:44:55] WARNING[18923]: pbx.c:7327 ast_register_application2: Already have an application 'MYSQL'
You have new mail in /var/spool/mail/root

Can anybody help , searching this for hours Thanks

Answer

Sachin Murali G picture Sachin Murali G · Sep 4, 2014

I think this is due to the user privilege restriction. Did you try running it as su? Try

sudo asterisk -cvvvvvvvvvvvvr

This solved the problem for me. (PS: you should be a sudoer)

enter image description here