Asterisk
  1. Asterisk
  2. ASTERISK-726

[patch] parameters to Contact: header stripped off, breaks SNOM phone support

    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:
      732
    • Regression:
      No

      Description

      We at snom have problems with Asterisk when we receive calls without the
      line indication. When we register we place a contact like this:

      REGISTER sip:asterisk SIP/2.0
      Contact: <sip:123@192.168.0.99;line=h35h345>

      When we receive the 200 Ok, we search for the "h35h345". If we don&ASTERISK-7996;t find
      it, we try to guess which line is affected. This is relatively easy on a
      REGISTER response, but on an incoming INVITE we have serious problems. I
      think some of the challenging and line-assignment problems are related to
      this problem.

      Strictly speaking, we register the contact
      "sip:123@192.168.0.99;line=h35h345", NOT "sip:123@192.168.0.99"! Parameters
      are an essential part of a URI which must not be discarded.

                • ADDITIONAL INFORMATION ******

      BTW the line-id has also the function of increasing the security
      significantly. Just imaging a network script that sprays INVITE packets
      through the network - the whole office would start ringing.

      #!/bin/bash

      1. Give the colleagues a wake-up call!
        i=1
        while [ $i -lt 256 ]; do
        echo INVITE sip:192.168.0.$i SIP/2.0^M >junk.txt
        echo f: sip:whoever@is.stupid^M >>junk.txt
        echo t: sip:enough@to.accept^M >>junk.txt
        echo i: this@junk^M >>junk.txt
        echo l: 0^M >>junk.txt
        echo CSeq: 1 INVITE^M >>junk.txt
        echo ^M

      >>>>junk.txt

      cat junk.txt >/dev/udp/192.168.0.$i/5060
      i=$[$i+1]
      done

      Unfortunately, the snom phones are not able to pick the right line on these
      packets!

      By requiring the line id, the phone would reject the INVITE as it can not
      match the request URI with any valid line on the phone! BTW that&ASTERISK-7996;s why I
      hate "direct IP calls" - it gives you zero security against such attacks.

      Our latest image is 2.03e (http://snom.com/download/share), it does strict
      line id comparison and tries to deal with "junk" line identifications as
      good as possible.

        Activity

        Hide
        Olle Johansson added a comment -

        Markster, your patch still doesn't help us... The INVITE is still addressed as

        INVITE peername@ipadress SIP/2.0

        I don't see the extraparams that is indeed saved when doing a "sip show peer".

        Quoting Stredicke (above):
        "Why make it so complicated? Just treat the URL as one string, no matter what is in there. Only when you have to make a routing decision, you need to take a look at the content."

        We should not send anything else than the text used in REGISTER.

        Show
        Olle Johansson added a comment - Markster, your patch still doesn't help us... The INVITE is still addressed as INVITE peername@ipadress SIP/2.0 I don't see the extraparams that is indeed saved when doing a "sip show peer". Quoting Stredicke (above): "Why make it so complicated? Just treat the URL as one string, no matter what is in there. Only when you have to make a routing decision, you need to take a look at the content." We should not send anything else than the text used in REGISTER.
        Hide
        Mark Spencer added a comment -

        Well let me ssh in and look then.

        Show
        Mark Spencer added a comment - Well let me ssh in and look then.
        Hide
        Mark Spencer added a comment -

        Can you find me on IRC so I can look at this on your system please. thanks.

        Show
        Mark Spencer added a comment - Can you find me on IRC so I can look at this on your system please. thanks.
        Hide
        Mark Spencer added a comment -

        Fixed in CVS

        Show
        Mark Spencer added a comment - Fixed in CVS
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 3680

        U trunk/channels/chan_sip.c

        ------------------------------------------------------------------------
        r3680 | markster | 2008-01-15 15:06:07 -0600 (Tue, 15 Jan 2008) | 2 lines

        Track extra parameters in contact (bug ASTERISK-726)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=3680

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 3680 U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r3680 | markster | 2008-01-15 15:06:07 -0600 (Tue, 15 Jan 2008) | 2 lines Track extra parameters in contact (bug ASTERISK-726 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=3680

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development