AMI failed to authenticate

Hmm, I can’t seem to send this command with the AMI:

linux-k7qk:~ # 
linux-k7qk:~ # telnet localhost 5038
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Asterisk Call Manager/1.1
Action: Login
ActionID: 1
Username: 201
Secret: password

Response: Error
ActionID: 1
Message: Authentication failed

Connection closed by foreign host.
linux-k7qk:~ # 

and the log shows:

[Mar 27 13:38:18] VERBOSE[6795] manager.c: [Mar 27 13:38:18] == Connect attempt from '127.0.0.1' unable to authenticate [Mar 27 13:39:01] VERBOSE[6945] manager.c: [Mar 27 13:39:01] == Manager 'sendcron' logged on from 127.0.0.1 [Mar 27 13:39:01] VERBOSE[6945] manager.c: [Mar 27 13:39:01] == Manager 'sendcron' logged off from 127.0.0.1 [Mar 27 13:39:06] VERBOSE[6964] manager.c: [Mar 27 13:39:06] == Manager 'sendcron' logged on from 127.0.0.1 [Mar 27 13:39:06] VERBOSE[6964] manager.c: [Mar 27 13:39:06] == Manager 'sendcron' logged off from 127.0.0.1 [Mar 27 13:39:31] VERBOSE[6914] manager.c: [Mar 27 13:39:31] == Client from 127.0.0.1, failed to authenticate in 30 seconds [Mar 27 13:39:31] VERBOSE[6914] manager.c: [Mar 27 13:39:31] == Connect attempt from '127.0.0.1' unable to authenticate linux-k7qk:~ #

and yet, this is the entry in sip.conf:

[201] username=201 secret=password accountcode=201 callerid="jitsi201" <201> mailbox=201 context=default type=friend host=dynamic

AMI <> SIP

AMI is setup in this file /etc/asterisk/manager.conf

I’m not in the Asterisk box right now, but something like:

Action: Originate Channel: SIP/201 Context: default Exten: 202 Priority: 1 Callerid: Asterisk AMI Caller ActionID: 123

so that 201 calls 202?

Technically could be true but it will depend of what do you have on your context default, when extension 202 is called on that context.

Channel - Channel name to call.

Exten - Extension to use (requires Context and Priority)

Context - Context to use (requires Exten and Priority)

Priority - Priority to use (requires Exten and Context)

wiki.asterisk.org/wiki/display/ … _Originate

You still have authenticate using an AMI account.

201 is a device name and 202 is an extension, so these are different things, even if many people name the primary outgoing device for an extension after the extension (which is bad security practice).

If you really want to go extension to extension, you should use local/201, not sip/201.

[quote=“david55”]You still have authenticate using an AMI account.

201 is a device name and 202 is an extension, so these are different things, even if many people name the primary outgoing device for an extension after the extension (which is bad security practice).

If you really want to go extension to extension, you should use local/201, not sip/201.[/quote]

Security isn’t my immediate concern :smile: Yes, I should use MAC address or something…

So, once I login, the syntax is “local/201” to dial an extension?