Cannot connect to asterisk

Hi
today i installed asterisk on a new cloud server with centos 7 and i follow this guide:
http://wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+CentOS+7

After my first reboot i can not connect to freepbx and in the comments i so this:


In case anyone else encounters this, it was a firewall issue.
I added

  1. firewall-cmd --permanent --zone=public --add-port=80/tcp
  2. firewall-cmd --reload

Then, re-started FreePBX
3) systemctl start freepbx
4) systemctl status -l freepbx.service (this produced the success output)

Then, restarted Apache
5) systemctl restart httpd.service

i follow this steps but when i sent this command i have this error:

  1. systemctl start freepbx
    Failed to start freepbx.service: Unit freepbx.service failed to load: No such file or directory.

  2. systemctl status -l freepbx.service
    ● freepbx.service
    Loaded: not-found (Reason: No such file or directory)
    Active: inactive (dead)

Now, if i connect to freepbx i have not problem but is write “cannot connect to asterisk”.

What i can do?
Thank you

I suggest you use the FreePBX discourse[1] instead of this one as they will likely be able to help you faster.

[1] http://community.freepbx.org/

1 Like

hi, i writed here only because the error is “cannot connect to asterisk” so i don’t undestand if is an asterisk problem or freepbx.
Now i try to ask in the freepbx forum
Thank you

First you need to start the asterisk service, on Centos 6.5 the command is service asterisk start , then you connect to Asterisk using the following command " asterisk -rvvvv",

check if the file /etc/systemd/system/freepbx.service exist, if not check the Example systemd startup script for FreePBX on this link http://wiki.freepbx.org/display/FOP/Example+systemd+startup+script+for+FreePBX

hi
i check and the file /etc/systemd/system/freepbx.service not exist so i created it and paste the code like in the page you sent me, in this mode:

[Unit]
Description=FreePBX VoIP Server
After=mariadb.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start
ExecStop=/usr/sbin/fwconsole stop

[Install]
WantedBy=multi-user.target

i saved the file and send the command:
systemctl enable freepbx.service

In this case my asterisk is running without problems

If i reboot the sistem i have the same problem: cannot connect to asterisk

How i can automatically start the service? What i can add to this file?
Thank you

I not very familiarized with centos 7 , but you could try the command

systemctl enable freepbx

or extra directive under the [Service] section of the service unit file , If doesnt work I suggest you get help in a Linux forum about this issue.

i tryed but not working.
I do not what i can do. The problem is only after a reboot.
The problem is on freepbx or on asterisk?
what i can ask in the linux forum?

When you have Asterisk compiled and installed, the last step is to install the initialization script, or initscript. This script starts Asterisk when your server starts, will monitor the Asterisk process in case anything bad happens to it, and can be used to stop or restart Asterisk as well. To install the initscript, use the make config command. This script works on any Centos 's version prior to version 7. I haven’t work with Asterisk on Centos 7, so there is not too much I can do.

i dont’ undestand, i follow all this steps:

cd /usr/src
tar xvfz asterisk-13-current.tar.gz
rm -f asterisk-13-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install
./configure --libdir=/usr/lib64
contrib/scripts/get_mp3_source.sh
make menuselect
make
make install
make config
ldconfig
chkconfig asterisk off

So i used make config.
I don’t understand if this problem is from asterisk or freepbx
(sorry for my english, i’m italian) :slightly_smiling:

This command should start asterisk after reboot

systemctl enable asterisk

The off parameter on chkconfig disables Asterisk startup!!!

i tryed to add systemctl enable asterisk on the /etc/systemd/system/freepbx.service and reboot but i have the same problem.

Chkconfig is off, this is my output:

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

  If you want to list systemd services use 'systemctl list-unit-files'.
  To see services enabled on particular target use
  'systemctl list-dependencies [target]'.

asterisk 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off

How i can enable it automatically?

Use “on” in chkconfig!

1 Like

i think now is working.
I reboot the sistem 3-4 times and i have not this problem
Just when i write only chkconfig but now i add “on” and it working again :wink:
thank you

hi, i try to install asterisk with centOs 7,but in the final step ,when i execute “service asterisk start” ,i have this :“job for asterisk service failed because a timeout was exceeded” what can i do? thank you