Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

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


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
mdupuis at ocg.ca
Guest





PostPosted: Fri May 16, 2014 1:44 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

I have setup an Ast 11.6 host and I want to login via AJAM. I setup manager.conf, http.conf described in the docs. When I login via the AMI it works fine (see below), but when I login via AJAM the same credentials fail (see further down)


Can someone tell me how to fix this?



-----------
Connection closed by foreign host.
root@pbx:/tmp# telnet localhost 5038
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Asterisk Call Manager/1.3
action: login
username: test
secret: test


Response: Success
Message: Authentication accepted


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


​--------------------------
root@apbx:/tmp# curl http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
[1] 15548
[2] 15549
root@pbx:/tmp# Response: Error
Message: Authentication failed
[1]- Done curl http://localhost:5039/asterisk/rawman?action=login
[2]+ Done user=test
Back to top
myoung at acsacc.com
Guest





PostPosted: Fri May 16, 2014 2:25 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

----- Original Message -----

Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@lists.digium.com>
Sent: Friday, May 16, 2014 2:43:30 PM
Subject: [asterisk-users] Login by AMI ok, by AJAM fails

Quote:
--------------------------
root@apbx:/tmp# curl
http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
[1] 15548
[2] 15549
root@pbx:/tmp# Response: Error
Message: Authentication failed
[1]- Done curl http://localhost:5039/asterisk/rawman?action=login
[2]+ Done user=test

I believe it should be "username" instead of "user" for the query parameter.

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mdupuis at ocg.ca
Guest





PostPosted: Fri May 16, 2014 2:40 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

You're right - but I tried username too and it fails. I can't understand why AMI authenticates and AJAM fails...

________________________________________
From: asterisk-users-bounces@lists.digium.com <asterisk-users-bounces@lists.digium.com> on behalf of Michael L. Young <myoung@acsacc.com>
Sent: Friday, May 16, 2014 3:25 PM
To: Asterisk Users List
Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails

----- Original Message -----

Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@lists.digium.com>
Sent: Friday, May 16, 2014 2:43:30 PM
Subject: [asterisk-users] Login by AMI ok, by AJAM fails

Quote:
--------------------------
root@apbx:/tmp# curl
http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
[1] 15548
[2] 15549
root@pbx:/tmp# Response: Error
Message: Authentication failed
[1]- Done curl http://localhost:5039/asterisk/rawman?action=login
[2]+ Done user=test

I believe it should be "username" instead of "user" for the query parameter.

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mdupuis at ocg.ca
Guest





PostPosted: Fri May 16, 2014 3:08 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

In case it helps, here's the CLI output which attempting an AJAM login:

[May 16 16:03:58] DEBUG[16807]: http.c:686 handle_uri: HTTP Request URI is /asterisk/rawman?action=login
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [httpstatus] len 9
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [phoneprov] len 10
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [amanager] len 9
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [arawman] len 8
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [manager] len 7
[May 16 16:03:58] DEBUG[16807]: http.c:735 handle_uri: match request [rawman] with handler [rawman] len 7
[May 16 16:03:58] DEBUG[16807]: manager.c:6436 generic_http_callback: HTTP Manager add header action: login
[May 16 16:03:58] DEBUG[16807]: manager.c:5211 process_message: Running action 'Login'
== HTTP Connect attempt from '127.0.0.1' unable to authenticate
[May 16 16:03:59] DEBUG[16807]: manager.c:6511 generic_http_callback: Need destroy, doing it now!

________________________________________
From: asterisk-users-bounces@lists.digium.com <asterisk-users-bounces@lists.digium.com> on behalf of Michelle Dupuis <mdupuis@ocg.ca>
Sent: Friday, May 16, 2014 3:39 PM
To: Asterisk Users List
Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails

You're right - but I tried username too and it fails. I can't understand why AMI authenticates and AJAM fails...

________________________________________
From: asterisk-users-bounces@lists.digium.com <asterisk-users-bounces@lists.digium.com> on behalf of Michael L. Young <myoung@acsacc.com>
Sent: Friday, May 16, 2014 3:25 PM
To: Asterisk Users List
Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails

----- Original Message -----

Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@lists.digium.com>
Sent: Friday, May 16, 2014 2:43:30 PM
Subject: [asterisk-users] Login by AMI ok, by AJAM fails

Quote:
--------------------------
root@apbx:/tmp# curl
http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
[1] 15548
[2] 15549
root@pbx:/tmp# Response: Error
Message: Authentication failed
[1]- Done curl http://localhost:5039/asterisk/rawman?action=login
[2]+ Done user=test

I believe it should be "username" instead of "user" for the query parameter.

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
myoung at acsacc.com
Guest





PostPosted: Fri May 16, 2014 3:16 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

----- Original Message -----
Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@lists.digium.com>
Sent: Friday, May 16, 2014 3:39:35 PM
Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails

You're right - but I tried username too and it fails. I can't
understand why AMI authenticates and 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.

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mdupuis at ocg.ca
Guest





PostPosted: Fri May 16, 2014 3:29 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

I've done all of that (and I set the AJAM to listen to 5039). What mistakes do you see?
________________________________________
From: asterisk-users-bounces@lists.digium.com <asterisk-users-bounces@lists.digium.com> on behalf of Michael L. Young <myoung@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

----- Original Message -----
Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@lists.digium.com>
Sent: Friday, May 16, 2014 3:39:35 PM
Subject: Re: [asterisk-users] Login by AMI ok, by AJAM fails

You're right - but I tried username too and it fails. I can't
understand why AMI authenticates and 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.

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
myoung at acsacc.com
Guest





PostPosted: Fri May 16, 2014 3:55 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

----- Original Message -----
Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@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@lists.digium.com
<asterisk-users-bounces@lists.digium.com> on behalf of Michael L.
Young <myoung@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

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
myoung at acsacc.com
Guest





PostPosted: Fri May 16, 2014 4:01 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

----- Original Message -----
Quote:
From: "Michael L. Young" <myoung@acsacc.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@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 -----
Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@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@lists.digium.com
<asterisk-users-bounces@lists.digium.com> on behalf of Michael L.
Young <myoung@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:

Quote:
Quote:
I've done all of that (and I set the AJAM to listen to 5039). What mistakes do you see?

Michael

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mdupuis at ocg.ca
Guest





PostPosted: Fri May 16, 2014 4:48 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

actually rawman and manager are very different, and you don't need cookies just to test login. However, I found the problem: I forgot quotes around the curl command.

Thanks!
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
a_villacis at palosant...
Guest





PostPosted: Fri May 16, 2014 4:49 pm    Post subject: [asterisk-users] Login by AMI ok, by AJAM fails Reply with quote

El 16/05/14 16:01, Michael L. Young escribió:
Quote:
----- Original Message -----
Quote:
From: "Michael L. Young" <myoung@acsacc.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@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 -----
Quote:
From: "Michelle Dupuis" <mdupuis@ocg.ca>
To: "Asterisk Users List" <asterisk-users@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@lists.digium.com
<asterisk-users-bounces@lists.digium.com> on behalf of Michael L.
Young <myoung@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:

Quote:
Quote:
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:
Quote:
root@apbx:/tmp# curl http://localhost:5039/asterisk/rawman?action=login&user=test&secret=test
[1] 15548
[2] 15549
root@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.

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services