Cannot Connect To Asterisk


After a successful restore yesterday, today I’m getting “Cannot Connect To Asterisk” in the top right corner of the GUI. I’ve looked at other posts, but can’t figure out what the issue is. I’ve got as the first line in my DNS settings. The “Extensions” module is inaccessible (as are many others). When I try and upgrade the UCP Node Server I get an error message “failed to run installation scripts”. I don’t know if this is related.

FreePBX 60
FreePBX 13
PBX Firmware: 10.13.66-17
PBX Service Pack:

Any help would be greatly appreciated.



I found a post that suggests entering “service asterisk start” at the CLI. This seems to clear the above issue (don’t know if the service will remain on after a reboot).

When I try and install a Sangoma A200 FXO / FXS card, I get the following error message “DAHDi Doesn’t appear to be running. Click the ‘Restart DAHDi & Asterisk’ button below”. Clicking the “DAHDi & Asterisk Button Below”, doesn’t accomplish anything; The “Cannot Connect To Asterisk” re-appears after a while.


Is there any response to my question or should I go ahead and initiate an RMA?


Is Asterisk running? What is the result of:

asterisk -r

Is Asterisk running as root?

fwconsole restart

Do the Asterisk AMI credentials and details in /etc/asterisk/manager.conf match what is shown in the “Asterisk Manager” section of Advanced Settings?

Thanks for responding to my questions. I will check these’s settings later in the day and will post my findings.

Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

Is Asterisk running as root?
fwconsole restart

No …asterisk was not running. After typing the command “fwconsole restart” I received the following:
Asterisk not currently running
Running FreePBX shutdown…

Restapps daemon was not running
XMPP Server was not running
Stopping Zulu Server
Stopped Zulu Server

Stopping Wanrouter for Sangoma Cards
Wanrouter Failed: The command “/usr/sbin/wanrouter stop” failed.
Exit Code: 1(General error)


Router is already stopped !

Error Output:

Stopping DAHDi for Digium Cards
DAHDi Stopped
Running VQPlus Hooks
Stopping Queue Callback Daemon
Queue Callback Daemon Stopped
Running FreePBX startup…
Starting Wanrouter for Sangoma Cards
Wanrouter Failed: The command “/usr/sbin/wanrouter start” failed.
Exit Code: 1(General error)


ERROR: Wanpipe configuration file not found:

Error Output:

Starting DAHDi for Digium Cards
DAHDi Started
Running Sysadmin Hooks
Restarting fail2ban
fail2ban Restart failed Failed: The command “/etc/init.d/fail2ban restart” failed.
Exit Code: 255(Unknown error)


Stopping fail2ban: [ OK ]
Ensuring logfiles are presentStarting fail2ban: [FAILED]

Error Output:

ERROR Server already running

Updating License Information for 61718040
Starting Asterisk…
[---------->-----------------] 2 secs
Broadcast message from [email protected] (Fri Dec 30 00:04:28 2016):

Firewall service now starting.

[============================] 2 secs
Asterisk Started
Starting Restapps daemon
Running VQPlus Hooks
Starting Queue Callback Daemon
Queue Callback Daemon Started
Running XMPP Hooks
Starting XMPP Server
XMPP Server Started

Do the Asterisk AMI credentials and details in /etc/asterisk/manager.conf match what is shown in the “Asterisk Manager” section of Advanced Settings?

Yes the credentials match; both the “[user]” and the “Secret” match.

After running “fwconsole restart” I tried to initialize the DADHI card again, but it failed due to Asterisk being stopped.

Can you please provide further assistance?


Wait, what?

DAHDI initialization has to happen before Asterisk starts, otherwise the DAHDI interfaces won’t be recognized.

It sounds to me like you missed a step in the setup of the DAHDI cards. Of course, I always do this stuff the old fashioned way (set the DAHDI cards up manually and don’t let FreePBX or Asterisk mess with them) so that might be a route you could consider taking.

Thanks Dave for the response.

I don’t have any experience setting the DAHDI cards up manually. I’ll try “googling” for a procedure. Do you have a list of instructions I could use?

Perhaps at this point I should pull the card and see if I can get my system to work first, then re-introduce the card. Any thoughts on this?


Try changinging your asterisk version to 11 instead of 13 and then reboot. If this works you can always switch back. I had the same error not long ago and that worked for me

Hi FrankB. Thanks for the tip.

I changed the asterisk version from 11 to 13 successfully. I then took a look at the installation notes for the Sangoma A200 card found at:

I had none of the directory’s listed, in the usr/src (dahdi-linux-complete- + asterisk-). So I then proceeded to run through the installation and got the dahdi directory complete. The asterisk directory is incomplete as the “make” command stalls out with the following error message:

/usr/bin/ld: cannot find -lssl
collect2: ld returned 1 exit status
make[1]: *** [] Error 1
make: *** [channels] Error 2

My understanding is the wanpipe drivers need to be installed in order for the A200 to be working. The above two directories must be present before the Wanpipe drivers need to be installed. Presently the card doesn’t seem to be recognized by the system. I haven’t had this much trouble installing a card nor setting up any type of system ever!

Any recommendations are greatly welcomed.


Not very helpful I know, but for future reference, cost allowing, I would be looking at IP based gateways rather than PCI(e) cards. Less screwing about with drivers, kernel patches, asterisk patches, software development environment (you’re having to compile your own driver there, and you’re missing some libraries…)

Anyway try this:

Although, reading between the lines (RMA ? PBX Firmware ?) You might be using a FreePBX appliance that’s supposed to take care of all this for you?

Thanks for the response. I will look into your advice.

It’s an out of box (last week) FreePBX 60 Appliance. From the literature I read, all I needed to do was install the card and go to the DAHDI module and proceed from there. More than likely I’ll open an RMA ticket on Monday unless I make significant progress.


Have you tried running the setup-sangoma script? Sounds like running that at your cli might help configure the a200

Hi Frank
I haven’t tried running the setup-sangoma script. Is that the actual command at the CLI “setup-sangoma” ?


Yes I believe it is. That’s how I used to setup my sangoma controllers on the distro. Haven’t used one in a while however been using sip for about the last year or so.

Search these forums for setup-sangoma and you will receive results.

Just an update to this ticket. I’ve re-imaged the switch and will complete the programming by hand. This is not such a big deal as there aren’t that many extensions on it. It’s possible that I had a corrupt data base and tried to restore from or (and this might be a more accurate assessment) the restore was Asterisk 11 while the new switch was Asterisk 13.

I meet the same error many times; “fwconsole restart” don’t helped me.


asterisk -rx “core stop now” ; fwconsole stop && fwconsole chown && fwconsole start

worked every time.

1 Like

Okay. Thanks.I’ll keep this in mind.