2

I'm trying to connect to asterisk via telnet. In order for PHPAGI to use certain commands, it has to be able to do the same. So I'm cutting out the middle man and testing it manually. I've determined that asterisk is not letting anything connect to it via localhost.

I'm following the steps at http://the-asterisk-book.com/1.6/asterisk-manager-api.html on my server.

Here's what I'm getting:

> telnet 127.0.0.1 5038

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Asterisk Call Manager/1.3
Action: Login
ActionID: 1
Username: admin
Password: abc123

Response: Error
ActionID: 1
Message: Authentication failed

My /etc/asterisk/manager.conf file contains:

[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1

#include "manager.d/*.conf"

And /etc/asterisk/manager.d/admin.conf contains:

[admin]
secret = abc123
#Trying just about everything...
permit = 127.0.0.1/255.255.255.255
permit = 127.0.0.1/255.255.255.0
permit = 23.239.27.80/255.255.255.255
permit = 23.239.27.80/255.255.255.0
permit = 192.168.0.1/255.255.255.0
permit = 192.168.0.1/255.255.255.255
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

I'm not sure why it's failing to authenticate. Any guesses come to mind? (Note: I did restart asterisk after changing my .conf files)

3

Got the answer. My manager.conf now looks like this:

[general]
enabled=yes
port=5038
bindaddr=0.0.0.0
displayconnects=yes ;only effects 1.6+

[admin]
secret = abc123
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,originate
write = system,call,log,verbose,command,agent,user,originate

Also, when authenticating, I dropped "ActionID". Thus:

> telnet 127.0.0.1 5038

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Asterisk Call Manager/1.3
Action: Login
Username: admin
Secret: abc123

Response: Success
Message: Authentication accepted

Event: FullyBooted
Privilege: system,all
Status: Fully Booted

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.