[asterisk-users] Login by AMI ok, by AJAM fails

Alex Villací­s Lasso a_villacis at palosanto.com
Fri May 16 16:49:03 CDT 2014


El 16/05/14 16:01, Michael L. Young escribió:
> ----- Original Message -----
>> From: "Michael L. Young" <myoung at acsacc.com>
>> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
>> Sent: Friday, May 16, 2014 4:55:30 PM
>> Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails
>>
>> ----- Original Message -----
>>> From: "Michelle Dupuis" <mdupuis at ocg.ca>
>>> To: "Asterisk Users List" <asterisk-users at lists.digium.com>
>>> Sent: Friday, May 16, 2014 4:29:05 PM
>>> Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails
>>>
>>> From: asterisk-users-bounces at lists.digium.com
>>> <asterisk-users-bounces at lists.digium.com> on behalf of Michael L.
>>> Young <myoung at acsacc.com>
>>> Sent: Friday, May 16, 2014 4:16 PM
>>> To: Asterisk Users List
>>> Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails
>>>
>>> Have you taken a look at the Wiki yet?
>>>
>>> https://wiki.asterisk.org/wiki/display/AST/Allow+Manager+Access+via+HTTP
>>>
>>> In looking at that, I see some mistakes in what you are trying to
>>> do.
>>>   Please take a look at that and give it a try.
>> Well, you need to login first.  Since you are using cURL, you need to
>> turn the cookie engine on so that it will store and send cookies.
>>
>> Also, you need to send the login request to
>> "http://localhost:5039/asterisk/manager?action=login&user=test&secret=test"
>> and not "rawman".  Once you are logged in, then you can get raw
>> manager output.
>>
>> I hope that helps.
>>
>> Michael
> Sorry that I messed up the thread while trying to un-top post your message.  The above was in response to your prior message:
>
>>> I've done all of that (and I set the AJAM to listen to 5039).  What mistakes do you see?
> Michael
>
Sorry if this is already blatantly obvious, but the ampersand character is a special character for the shell. The entire URL should be enclosed in single quotes in order to send literal ampersands separating the query parameters:
> root at apbx:/tmp# curl  http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
> [1] 15548
> [2] 15549
> root at pbx:/tmp# Response: Error
> Message: Authentication failed
> [1]-  Done                    curl http://localhost:5039/asterisk/rawman?action=login
> [2]+  Done                    user=test
The [1] XXXX and [2] XXXX show that the shell is (incorrectly) spawning separate background processes for what it believes are separate commands. Not what you want.



More information about the asterisk-users mailing list