[Home]

Summary:ASTERISK-02498: AGI network scripts (agi:// URLs) do not parse ports correctly
Reporter:daver (daver)Labels:
Date Opened:2004-09-28 23:04:05Date Closed:2004-09-29 16:10:38
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I was receiving a "connection refused" error when attempting to connect to a TCP server using the AGI  netscript functionality (agi:// URLs.)  There was an active server running on the port.

I traced the error to a minor problem parsing agi:// URLs in res_agi.c.

For example: agi://127.0.0.1:3001/testing is parsed as port 1, instead of 3001.

There is an off-by-one error in the launch_netscript function in res_agi.c.  I changed:
Comments:By: daver (daver) 2004-09-28 23:08:07

Sorry, I submitted this twice accidentally.

The fix was changing "port = atoi(c + 1)" to "port = atoi(c)" on line 1768 of res_agi.c

I was then able to connect to my AGI TCP server, as expected.

By: James Golovich (jamesgolovich) 2004-09-28 23:30:43

Fixed in CVS.  Thanks!