Asterisk
  1. Asterisk
  2. ASTERISK-2498

AGI network scripts (agi:// URLs) do not parse ports correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Core/General
    • Labels:
      None
    • Mantis ID:
      2539
    • Regression:
      No

      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:

        Activity

        Hide
        daver added a comment -

        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.

        Show
        daver added a comment - 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.
        Hide
        James Golovich added a comment -

        Fixed in CVS. Thanks!

        Show
        James Golovich added a comment - Fixed in CVS. Thanks!

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development