login | register
Sat 04 of Jul, 2009 [01:16 UTC]

voip-info.org

History

Asterisk config manager.conf

Created by: oej,Last modification on Wed 04 of Feb, 2009 [21:38 UTC] by Steltek
Configuration of the Asterisk manager API

Note that activating the manager API opens a TCP port. Make sure you know what you are doing. Maybe it's enough to just activate this for the local loopback interface, 127.0.0.1. However, by using AstManProxy communication can be secured using SSL/HTTPS, and there is also AMI SSL/TLS support in Asterisk 1.6.

New: Asterisk 1.4 introduces AMI-over-http as an alternative approach, using the internal Asterisk http server (see AJAM).

Note: "portno" has changed to "port" (at least as of Asterisk 1.2.4). So if one doesn't work try the other. Simply reloading asterisk will not enable the manager. You must shut down asterisk and restart. To test just telnet to port 5038 on the asterisk box. If bindaddr = 0.0.0.0 then the manager will bind to ALL Ip's on the server.

Example


 ;
 ; Asterisk Call Management support
 ;
 [general]
 enabled = yes
 port = 5038 
 bindaddr = 0.0.0.0
 webenabled = no

 ; Each user has a section labeled with the username
 ; so this is the section for the user named "mark"
 [mark]
 secret = mysecret
 deny=0.0.0.0/0.0.0.0
 permit=209.16.236.73/255.255.255.0
 permit=127.0.0.1/255.255.255.0
 read = system,call,log,verbose,command,agent,user
 write = system,call,log,verbose,command,agent,user                                                



Security tips

  • No encryption is used, even the password is sent in plaintext. Notes: However you can use md5 challange-and-reply for a slightly safer means to transmit the password; Asterisk 1.4 will come with SSL encryption)
  • Don't enable it on a public IP.
  • Use http://www.stunnel.org/ or a SSH tunnel
  • Watch out with management programs with direct interface to the manager.
  • Limit the privileges per user (especially the system!)


Questions

Anyone able to explain the exact meaning of each these entires?

 system,call,log,verbose,command,agent,user

Answer

All manager API commands registered by varoius asterisk modules have a privilege group associated to it. In order for a manager API user to be able to issue a command, it has to have read or write privilege to the appropriate group. Following is a list of commands groupped by privilege groups as of Asterisk 1.2.7.1:

system: DBGet, DBPut, SIPpeers, SIPshowpeer
call: Hangup, Status, Setvar, Getvar, Redirect, Originate, ExtensionState, AbsoluteTimeout, MailboxStatus, MailboxCount, SetCDRUserField, Monitor, StopMonitor, ChangeMonitor
log: * couldn't find any *
verbose: * couldn't find any *
command: Command
Agent: Agents,AgentLogoff,AgentCallbackLogin, QueueAdd, QueueRemove, QueuePause
User: * couldn't find any *
None (commands that can be issued without explicit privileges associated): Ping, Events, Logoff, ListCommands, ZapTransfer, ZapHangup, ZapDialOffhook, ZapDNDon, ZapDNDoff, ZapShowChannels, IAXpeers, IAXnetstat, Queues, QueueStat, ParkedCalls

See also



Go back to Asterisk

Comments

Comments Filter
222

333Re: Can not get around Authenticatin error with simple telnet

by umitiri, Monday 19 of May, 2008 [20:54:58 UTC]
hi
i have in trouble connecting non-local asterisk server at my sip phone. my asterisk server is not local, and im getting this error .
failed for  78.99.00.00 ACL error (permit/deny)

how can i fix it? how can i make my asterisk server for using non local ip phones?

please help me
umit
222

333Manager passwork keeps resetting to the default.

by drbeaker, Wednesday 04 of July, 2007 [12:47:34 UTC]
Whenever there is an update to FreePBX the manager password seems to get reset back to the default. Why? How do I stop that happening?
222

333any additional port

by moahmed, Thursday 17 of August, 2006 [00:01:46 UTC]
Hello,

I've gastman installed on windows and the asterisk runnings on debian... Error " connection failed - 172.25.25.3 10061" I'm not sure what 10061 (maybe port).. I've alloed in iptables aswell as port 5038 ..Are there any additional ports ?

--
mo
secret = whateverxxxx
deny=0.0.0.0/0.0.0.0
permit=172.25.25.1/255.255.255.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user


thanks,
Mohamed
222

333any additional port

by moahmed, Wednesday 16 of August, 2006 [23:58:28 UTC]
Hello,

I've gastman installed on windows and the asterisk runnings on debian... Error " connection failed - 172.25.25.3 10061" I'm not sure what 10061 (maybe port).. I've alloed in iptables aswell as port 5038 ..Are there any additional ports ?

--
mo
secret = whateverxxxx
deny=0.0.0.0/0.0.0.0
permit=172.25.25.1/255.255.255.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user


thanks,
Mohamed
222

333Re: Can not get around Authenticatin error with simple telnet

by viperdude, Saturday 22 of October, 2005 [16:28:33 UTC]
Please note that when the manager looks up the ACL to see what IP's can connect it will always use the last matching entry. Therefore if you have deny=0.0.0.0/0.0.0.0 after any explit permits it will always deny. Put the deny at the top of the list and then list explicit permits below.


222

333Can not get around Authenticatin error with simple telnet

by pkellner, Friday 18 of March, 2005 [20:27:33 UTC]
My manager.conf file is very simple. (see below). When I try a simple connect with telnet, I always get the Authentication failure. I'm using the CentOS and have changed my IP and system name. Other than that, very vanilla.

Also, not sure if this is relevant, but if I change my bindaddr to 0.0.0.0 as was suggested in another post, I constantly get the error: "Connect attemp from '127.0.0.1' unable to authenticate" even though I am not trying to telnet in at that point. It just keeps repeating itself.

Thanks for any help on this. (my first post here, so far I've been able to figure out my other issues on my own) (:cry:)

general
enabled = yes
port = 5038
bindaddr = 192.168.1.11

tony
secret = mypass
permit=0.0.0.0/255.255.255.255
deny=0.0.0.0/0.0.0.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
222

333Can't authenticate

by thezulu, Tuesday 30 of November, 2004 [01:47:38 UTC]
I tried the example config for the manager interface
Then when I tried to login:

telnet 192.168.1.12 5038
Trying 192.168.1.12...
Connected to 192.168.1.12.
Escape character is '^]'.
Asterisk Call Manager/1.0
Action: login
Username: mark
Secret: mysecret

Response: Error
Message: Authentication failed

Connection closed by foreign host.

I can't work out what's going wrong. I'm using Asterisk 1.0

Any Ideas?
222

333d00t

by , Friday 15 of October, 2004 [18:30:16 UTC]
In the manager.conf you see

mark
secret=

etc etc

mark is the username, change it to whatever you want
222

333And how exactly DO i specify a username?

by , Sunday 26 of September, 2004 [21:08:26 UTC]
Everywhere they say, "oh, set a username in manager.conf", but HOW?
What tag?

That can't be too secret!
222

333Re: I had to permit localhost

by , Tuesday 18 of May, 2004 [20:14:34 UTC]
That was because I used the command "astman localhost"

So, no problem there