Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Labels:
      None
    • SVN Revision Number:
      48307
    • Mantis ID:
      8524
    • Regression:
      No

      Description

      Asterisk assumes that every Via: header includes only one value. In particular, if the topmost Via: header used in a request contains several values, Asterisk will add the ";received=..." to the wrong value (the rightmost one instead of the leftmost one).

                • STEPS TO REPRODUCE ******

      Send a SIP request with a multi-valued topmost Via: header such as:

      Via: SIP/2.0/UDP 212.27.52.5:5060;branch=z9hG4bK-R0-0001f176-7de981fd,SIP/2.0/UDP 172.17.20.241:5063;emission,SIP/2.0/UDP 172.17.20.241:5062;branch=z9hG4bK-38DD-1FFF

      and the response given by Asterisk will contain:

      Via: SIP/2.0/UDP 212.27.52.5:5060;branch=z9hG4bK-R0-0001f176-7de981fd,SIP/2.0/UDP 172.17.20.241:5063;emission,SIP/2.0/UDP 172.17.20.241:5062;branch=z9hG4bK-38DD-1FFF;received=212.27.52.5

      The ";received=212.27.52.5" should have been added to the leftmost value, not the rightmost one.

      1. log-nopatch-sip.txt
        11 kB
      2. log-patch-sip.txt
        11 kB
      3. via-check-first-only
        0.5 kB
      4. via-update-first-only
        2 kB

        Activity

        Hide
        Samuel Tardieu added a comment -

        The two patches (via-check-first-only and via-update-first-only) fix this problem. They have been tested with single-valued and multiple-valued Via: headers.

        Disclaimer is already on file.

        Show
        Samuel Tardieu added a comment - The two patches (via-check-first-only and via-update-first-only) fix this problem. They have been tested with single-valued and multiple-valued Via: headers. Disclaimer is already on file.
        Hide
        Serge Vecher added a comment -

        Tardieu: thanks for the patches! Oej still wants to see the debug logs with and without the patch to confirm that your patches are doing the "right thing." Please produce as per following:

        1) Prepare test environment (reduce the amount of unrelated traffic on the server);
        2) Make sure your logger.conf has the following line:
        console => notice,warning,error,debug
        3) restart Asterisk with the following command:
        'asterisk -Tvvvvvdddddgc | tee /tmp/verbosedebug.txt'
        4) Enable SIP transaction logging with the following CLI commands:
        set debug 4
        set verbose 4
        sip debug
        5) Trip any startup info and attach verbosedebug.txt to the issue.

        Show
        Serge Vecher added a comment - Tardieu: thanks for the patches! Oej still wants to see the debug logs with and without the patch to confirm that your patches are doing the "right thing." Please produce as per following: 1) Prepare test environment (reduce the amount of unrelated traffic on the server); 2) Make sure your logger.conf has the following line: console => notice,warning,error,debug 3) restart Asterisk with the following command: 'asterisk -Tvvvvvdddddgc | tee /tmp/verbosedebug.txt' 4) Enable SIP transaction logging with the following CLI commands: set debug 4 set verbose 4 sip debug 5) Trip any startup info and attach verbosedebug.txt to the issue.
        Hide
        Samuel Tardieu added a comment -

        Ok, two log files uploaded, representing a similar call (a Cirpack server to an Asterisk one, the Cirpack using multiple-valued Via headers).

        Incidentally, the astute reader would note that this may have uncovered a bug in Cirpack's CANCEL request (see line 146 of log-patch-sip.txt), but this has nothing to do with the Asterisk problem

        Show
        Samuel Tardieu added a comment - Ok, two log files uploaded, representing a similar call (a Cirpack server to an Asterisk one, the Cirpack using multiple-valued Via headers). Incidentally, the astute reader would note that this may have uncovered a bug in Cirpack's CANCEL request (see line 146 of log-patch-sip.txt), but this has nothing to do with the Asterisk problem
        Hide
        Samuel Tardieu added a comment -

        Has there been any progress on this one? This is a real and serious interoperability issue. Without those patches, some already existing commercial SIP boxes cannot talk with Asterisk because of Asterisk's bad handling of multi-valued Via header.

        IMO, it would be a shame to release 1.4 with this known bug, against which no easy workaround can be found. If a SIP provider upgrades or replaces its box with one using a perfectly legal multi-valued Via header, every Asterisk client will break instantly.

        Show
        Samuel Tardieu added a comment - Has there been any progress on this one? This is a real and serious interoperability issue. Without those patches, some already existing commercial SIP boxes cannot talk with Asterisk because of Asterisk's bad handling of multi-valued Via header. IMO, it would be a shame to release 1.4 with this known bug, against which no easy workaround can be found. If a SIP provider upgrades or replaces its box with one using a perfectly legal multi-valued Via header, every Asterisk client will break instantly.
        Hide
        Serge Vecher added a comment -

        cloos, nic_bellamy: have you tested the patches?

        Show
        Serge Vecher added a comment - cloos, nic_bellamy: have you tested the patches?
        Hide
        Olle Johansson added a comment -

        I agree, this is a bug fix and needs to go in. Will handle it.

        Show
        Olle Johansson added a comment - I agree, this is a bug fix and needs to go in. Will handle it.
        Hide
        Olle Johansson added a comment -

        Committed to 1.4 rev 49983 and svn trunk. Thank you for your patience.

        Show
        Olle Johansson added a comment - Committed to 1.4 rev 49983 and svn trunk. Thank you for your patience.

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development