"Unable to connect to remote asterisk"!

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

"Unable to connect to remote asterisk"!

Postby Jello53 » Mon Apr 19, 2010 8:47 pm

Hi all,

I've searched through posts about this error message but none have exactly the same symptoms as me. When I try launching "asterisk -rvvv", I get the following message :

    == Parsing '/etc/asterisk/asterisk.conf': == Found
    == Parsing '/etc/asterisk/extconfig.conf': == Found
    == Binding sipusers to odbc/asterisk/sip_buddies
    == Binding sippeers to odbc/asterisk/sip_buddies
    == Binding voicemail to odbc/asterisk/ast_voicemail_users
    Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
The file indeed does not exist. Here's one thing that works :

    root@ubuntu:~# mkdir /var/run/asterisk
    root@ubuntu:~# chown asterisk:asterisk /var/run/asterisk
    root@ubuntu:~# asterisk -&
    [1] 1597
    root@ubuntu:~# asterisk -rvvv
After that, I am successfully connected. However, if I restart the server, upon next boot the /var/run/asterisk directory no longer exists. I cannot tail the /var/log/asterisk/full file because it does not exist either.

Help!

(this is happening with Asterisk 1.6.2.5 on Ubuntu 2.6.31-14)
Jello53
Newsterisk
 
Posts: 4
Joined: Tue Aug 11, 2009 6:53 pm

Re: "Unable to connect to remote asterisk"!

Postby pmlco » Mon Apr 19, 2010 11:44 pm

root@ubuntu:~# chown asterisk:asterisk /var/run/asterisk

It appears that you are trying to run under the user asterisk. For this to work, the asterisk user will need to be able to write to certain directories, including /var/run/asterisk and /var/log/asterisk. Have you checked that this is the case?

Ian
pmlco
Oldsterisk
 
Posts: 231
Joined: Sun Apr 06, 2008 3:56 am

Re: "Unable to connect to remote asterisk"!

Postby david55 » Tue Apr 20, 2010 3:59 am

The basic symptom indicates that Asterisk failed to start.

I would try starting it with -c, rather -r, and seeing what error messages you get.
david55
Moves Like Spencer
 
Posts: 10746
Joined: Fri Sep 26, 2008 5:03 am

Re: "Unable to connect to remote asterisk"!

Postby Jello53 » Tue Apr 20, 2010 2:40 pm

Pmlco, that indeed seems to be the case. How do I determine which user asterisk runs as, and how can I change it? I don't remember choosing during initial configuration.

Thanks for the idea David, here are the only to error messages I get:

    Unable to open pid file '/var/run/asterisk/asterisk.pid': No such file or directory
    Unable to bind socket to /var/run/asterisk/asterisk.ctl: No such file or directory
As I mentioned earlier, when I manually create the /var/run/asterisk directory it works (those two files are created), but the directory dissapears upon server reboot.

Does anyone know what "asterisk -&" does? It's not explained when I type "asterisk -h", but it helps somehow. Only after typing that line can I start asterisk with "asterisk -r"...
Jello53
Newsterisk
 
Posts: 4
Joined: Tue Aug 11, 2009 6:53 pm

Re: "Unable to connect to remote asterisk"!

Postby pmlco » Wed Apr 21, 2010 12:19 am

The & character forks a separate process running asterisk (the & is not unique to asterisk, it's standard bash syntax) that you can then connect to with asterisk -r. How are you starting asterisk on reboot? Do you have a script in /etc/init.d? However, I think the cleanest solution would be to do a complete reinstall. If you want to run asterisk under the asterisk uid, then you should do the build and install as asterisk. During the install you will have to change some permissions so that asterisk can write to certain directories - for example on /usr/sbin/asterisk, you can
Code: Select all
chgrp asterisk /usr/sbin
chmod 775 /usr/sbin

then resume the install with "make install".
pmlco
Oldsterisk
 
Posts: 231
Joined: Sun Apr 06, 2008 3:56 am


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 12 guests