• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Failed to connect to Asterisk Manager Interface

Status
Not open for further replies.

cdealto

Joined
Apr 23, 2012
Messages
23
Reaction score
0
Yesterday afternoon I tried to add a system recording when the following appeared:

PBX Configuration
Failed to connect to Asterisk Manager Interface - 127.0.0.1:5038

I've since checked all of the *.conf files and the password is the same.
I've also been able to log into mysql using the same password.
All the extensions and trunks are working, I just can't access the PBX tab.
 
Where did you create the login for the manager? In the manager.conf or freePBX?
 
The manager.conf was built from the Elastix Distro. I did not touch it. I did check all the conf files for the password and they all have the correct one. Also, I tried to log into mysql and can.
 
Did you activate the Elastix firewall????

Regards

Bob
 
I have tried to click on the PBX Manager tab with both the firewall activated and deactivated - problem continues.
 
A couple quick questions...
Are you able to connect via AMI using admin and the password set on manager.conf? If so, is it the same password written on /etc/amportal.conf ?
 
Yes the password is the same.
 
GNU nano 1.3.12 File: asterisk/manager.conf

;
; AMI - Asterisk Manager interface
;
; FreePBX needs this to be enabled. Note that if you enable it on a different IP, you need
; to assure that this can't be reached from un-authorized hosts with the ACL settings (permit/deny).
; Also, remember to configure non-default port or IP-addresses in amportal.conf.
;
; The AMI connection is used both by the portal and the operator's panel in FreePBX.
;
; FreePBX assumes an AMI connection to localhost:5038 by default.
;
[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1
displayconnects=no ;only effects 1.6+

[admin]
secret = 12345678
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

#include manager_additional.conf
#include manager_custom.conf

GNU nano 1.3.12 File: amportal.conf

# This file is part of FreePBX.
#
# FreePBX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FreePBX is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
#
# This file contains settings for components of the Asterisk Management Portal
# Spaces are not allowed!
# Run /usr/src/AMP/apply_conf.sh after making changes to this file

# FreePBX Database configuration
# AMPDBHOST: Hostname where the FreePBX database resides
# AMPDBENGINE: Engine hosting the FreePBX database (e.g. mysql)
# AMPDBNAME: Name of the FreePBX database (e.g. asterisk)
# AMPDBUSER: Username used to connect to the FreePBX database
# AMPDBPASS: Password for AMPDBUSER (above)
# AMPENGINE: Telephony backend engine (e.g. asterisk)
# AMPMGRUSER: Username to access the Asterisk Manager Interface
# AMPMGRPASS: Password for AMPMGRUSER
#
AMPDBHOST=localhost
AMPDBENGINE=mysql
# AMPDBNAME=asterisk
AMPDBENGINE=mysql
# AMPDBNAME=asterisk
AMPDBUSER=asteriskuser
# AMPDBPASS=amp109
AMPDBPASS=99pir3208
AMPENGINE=asterisk
AMPMGRUSER=admin
#AMPMGRPASS=amp111
AMPMGRPASS=12345678

# AMPBIN: Location of the FreePBX command line scripts
# AMPSBIN: Location of (root) command line scripts
#
AMPBIN=/var/lib/asterisk/bin
AMPSBIN=/usr/local/sbin

# AMPWEBROOT: Path to Apache's webroot (leave off trailing slash)
# AMPCGIBIN: Path to Apache's cgi-bin dir (leave off trailing slash)
# AMPWEBADDRESS: The IP address or host name used to access the AMP web admin
#
AMPWEBROOT=/var/www/html
AMPCGIBIN=/var/www/cgi-bin
# AMPWEBADDRESS=x.x.x.x|hostname

# FOPWEBROOT: Path to the Flash Operator Panel webroot (leave off trailing slash)
# FOPPASSWORD: Password for performing transfers and hangups in the Flash Operator Panel
# FOPRUN: Set to true if you want FOP started by freepbx_engine (amportal_start), false otherwise
# FOPDISABLE: Set to true to disable FOP in interface and retrieve_conf. Useful for sqlite3
# or if you don't want FOP.
#
#FOPRUN=true
FOPWEBROOT=/var/www/html/panel
[ Read 284 lines ]
 
What happens when you try to execute:
mysql -uasteriskuser -p99pir3208
are you able to connect?

If not, paste the output for:
cat /etc/asterisk/cdr_mysql.conf

And try to connect with the password that you see there
 
yes, I can log into mysql.
 
[root@dcs-pbx ~]# mysql -uasteriskuser -p99pir3208
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75289
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> Aborted


[root@dcs-pbx ~]#
GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)
[root@dcs-pbx ~]# cat /etc/asterisk/cdr_mysql.conf
;
; Note - if the database server is hosted on the same machine as the
; asterisk server, you can achieve a local Unix socket connection by
; setting hostname = localhost
;
; port and sock are both optional parameters. If hostname is specified
; and is not "localhost", then cdr_mysql will attempt to connect to the
; port specified or use the default port. If hostname is not specified
; or if hostname is "localhost", then cdr_mysql will attempt to connect
; to the socket file specified by sock or otherwise use the default socket
; file.
;
[global]
hostname = localhost
dbname=asteriskcdrdb
password = 99pir3208
user = asteriskuser
userfield=1
;port=3306
;sock=/tmp/mysql.sock
[root@dcs-pbx ~]# clear
You have new mail in /var/spool/mail/root
[root@dcs-pbx ~]# mysql -uasteriskuser -p99pir3208
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 102321
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
 
Re: Re:Failed to connect to Asterisk Manager Interface

friend check your rules the firewalls.
 
Enable firewall rule
[ACCEPT] IN: lo 0.0.0.0/0 0.0.0.0/0 ALL
and set to top level Order number 1 .
 
I had same problem. Nothing has helped.
The reason is that the password contains invalid characters.
I think that in 99% causes in this problem.
 
Hey guys, I found something that may help you in this bug =)


1) Edit /etc/asterisk/manager.conf this way:
BEFORE:
permit=127.0.0.1/255.255.255.0
AFTER:
permit=YOUR_IP_ADDRESS(like 172.16.0.22)/255.255.255.0

2) After that, restart asterisk:
# service asterisk restart

3) Test it!
# telnet YOUR_IP_ADDRESS 5038
type,
Action: Login
ActionID: 1
Username: admin
Secret: YOUR_PASSWORD

Pronto =) I hope this help you!
Antonio
 
In my case the problem was after changing the password of the elastix web interface

Code:
 tail -f /var/log/asterisk/full | grep ERROR

gave

Code:
[Feb 27 12:38:21] ERROR[7932] cdr_mysql.c: Unable to query table description!!  Logging disabled.

I could login using admin and palosanto into the web interface.

but there was the "failed-to-connect-to-asterisk-manager-interface" error

After changing the password
in /etc/asterisk/cdr_mysql.conf
to palosanto as well

everything worked fine. :lol:
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Members Online Now

Forum statistics

Threads
141,643
Messages
749,046
Members
144,766
Latest member
JEY_JEY_20
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.