[Home]

Summary:ASTERISK-23503: Using AMI via HTTP adds extra characters (: and space) to some request headers.
Reporter:André Maricato (andremar)Labels:
Date Opened:2014-03-18 15:30:58Date Closed:2014-03-26 16:54:47
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/HTTP
Versions:11.8.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOSAttachments:
Description:Hy.

So, I searched the issue tracker for this problem but didn't find anything like it so I'm submitting this as a new issue. Hope I'm not doing anything wrong...

So, what I found is that, when making an AMI request via HTTP with the Request URL like:
/asterisk/manager?action=Originate&Channel:<channel>&Application:<application>

I get on asterisk debug an extension not found in context error because the channel, context and application (in this particular request) get extra ":" and "space" characters at the end of the string. If I add those two characters to the end of the used context names in the request, everything works.

I hope I was explicit enough.

Best regards,
André.

Comments:By: Rusty Newton (rnewton) 2014-03-26 16:37:24.919-0500

Well, you should be calling the URL with equals signs in place of your colons. As follows:

{{asterisk/manager?action=Originate&Channel=<channel>&Application=<application>}}

That works fine in my testing.

That being said, using colons as you described, does result in the behavior you saw. That may be undefined behavior and maybe a bug or oversight. I'll see if a developer can confirm.

By: Rusty Newton (rnewton) 2014-03-26 16:54:39.616-0500

Talked with Matt Jordan that confirmed this is undefined behavior. If you form the URL correctly it works.

Of course, patches are always welcome if someone wants to work on making the parsing more robust. Closing this out until there is a patch.

Thanks for the report. I'll make sure the proper URL syntax is documented on the wiki pages for AJAM/AMI over HTTP.