tags:

views:

108

answers:

1

I'm wanting to use the asterisk manager api to show the status of all my SIP lines in a PHP web interface.

I thought I'd start simple and use telnet to see it working.

So I created a user in /etc/asterisk/manager.conf

[portal] secret = password read = all,system,call,log,verbose,command,agent,user

Then telnet to localhost on port 5038

This is what I get.

asterisk ~ # telnet localhost 5038
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Asterisk Call Manager/1.0
Action: login
Username: portal
Secret: 8u9sdgk
Events: off

Response: Success
Message: Authentication accepted

Action: SIPPeers

Response: Error
Message: Permission denied

Why am I getting permission denied? I thought the user has basically full access? Do I need to restart asterisk to make this work? I didn't restart it. On the other hand, I was able to log in which makes me think that the manager.conf has been reloaded as the portal user didn't exist before.

Any ideas?

+1  A: 

For SIPPeers you need 'system, all' privileges. So just add 'write=system' after 'read' line

Codetyper