[asterisk-dev] AMI over HTTP and Internet Explorer

Kohler, Jeffrey J.Kohler at TechSmith.com
Thu Jun 29 08:34:03 MST 2006


I have been playing around with the Asterisk Manager over HTTP stuff in
the Asterisk trunk.  It is really cool; however, I discovered a problem
using it with Internet Explorer.  The cookie parsing code in http.c does
not work with the cookie strings that Internet Explorer sends.  Because
of this, you can't log in using IE.

 

I've put together some revised parsing code (below) that appears to work
for both IE 6 and FireFox 1.5.  The code would drop in to http.c around
line 398.

 

 /* TODO - The cookie parsing code below seems to work in IE6 and  */
 /* FireFox 1.5.  However, it is not entirely correct, and         */
 /* therefore may not work in all circumstances.                   */
 /*    For more details see RFC 2109 and RFC 2965                  */
            
 /* FireFox cookie strings look like:                    */
 /*   Cookie: mansession_id="********"                   */
 /* InternetExplorer's look like:                        */
 /*   Cookie: $Version="1"; mansession_id="********"     */
                
 /* If we got a FireFox cookie string, the name's right after "Cookie: "
*/
 vname = cookie + 8;
                
 /* If we got an IE cookie string, we need to skip to the name */
 if( *vname == '$' )
 {
     vname = strchr( vname, ';' ) + 1;
     if( *vname == ' ' )
         vname++;
 } 

 

Of course the ideal solution would be to have parsing code compliant to
RFC 2109 and 2965, but that seems like a fairly substantial undertaking.

 

I haven't had much exposure to Asterisk development or the open source
community in general, so I apologize if there is a better way for me to
be submitting this feedback.

 

Jeffrey

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060629/7476e83c/attachment.htm


More information about the asterisk-dev mailing list