[asterisk-dev] "sip:" or "SIP:" in chan_sip

Steve Langstaff steve.langstaff at citel.com
Wed May 16 02:47:22 MST 2007


RFC3261 says:

7.3.1 Header Field Format
...
Each header field consists of a field
   name followed by a colon (":") and the field value.
...
When comparing header fields, field names are always case-
   insensitive.  Unless otherwise stated in the definition of a
   particular header field, field values, parameter names, and parameter
   values are case-insensitive.  Tokens are always case-insensitive.
   Unless specified otherwise, values expressed as quoted strings are
   case-sensitive.  For example,

      Contact: <sip:alice at atlanta.com>;expires=3600

   is equivalent to

      CONTACT: <sip:alice at atlanta.com>;ExPiReS=3600

   and

      Content-Disposition: session;handling=optional

   is equivalent to

      content-disposition: Session;HANDLING=OPTIONAL

   The following two header fields are not equivalent:

      Warning: 370 devnull "Choose a bigger pipe"
      Warning: 370 devnull "CHOOSE A BIGGER PIPE" 



> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com 
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of 
> Olle E Johansson
> Sent: 16 May 2007 10:37
> To: Asterisk Developers Mailing List
> Subject: Re: [asterisk-dev] "sip:" or "SIP:" in chan_sip
> 
> 
> 16 maj 2007 kl. 11.18 skrev Steve Langstaff:
> 
> > Assuming Asterisk 'complies' to RFC 3261, the BNF in that document
> > says:
> >
> >    From        =  ( "From" / "f" ) HCOLON from-spec
> >    from-spec   =  ( name-addr / addr-spec )
> >                   *( SEMI from-param )
> >    addr-spec   =  SIP-URI / SIPS-URI / absoluteURI
> >    SIP-URI     =  "sip:" [ userinfo ] hostport
> >                        uri-parameters [ headers ]
> >
> > RFC2243 "Augmented BNF for Syntax Specifications: ABNF" says:
> >
> >    ABNF permits specifying literal text string directly, enclosed in
> >    quotation-marks.
> > ...
> >         NOTE:     ABNF strings are case-insensitive and
> >                   the character set for these strings is us-ascii.
> >
> 
> Ok, so that means that all headers are case-insensitive?
> 
> FROm: "Olle Johansson" <SiP:oej at eXample.cOm>
> froM: "Olle Johansson" <sip:oej at EXAMPLE.com>
> 
> are the same?
> 
> /O
> 
> >
> >> -----Original Message-----
> >> From: asterisk-dev-bounces at lists.digium.com
> >> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Tony 
> >> Mountifield
> >> Sent: 16 May 2007 09:45
> >> To: asterisk-dev at lists.digium.com
> >> Subject: [asterisk-dev] "sip:" or "SIP:" in chan_sip
> >>
> >> Recently I came across someone trying to interface their 
> own Asterisk 
> >> PBX to a non-Asterisk SIP interface run by one of our clients.
> >>
> >> They could successfully register with Asterisk to the client's 
> >> system, and could originate calls from Asterisk. But when making 
> >> calls via the client's system to their Asterisk box, they got the 
> >> following errors:
> >>
> >> May 13 23:35:15 NOTICE[1437]: chan_sip.c:7178
> >> check_user_full: From address missing 'sip:', using it 
> anyway May 13 
> >> 23:35:15 WARNING[1437]: chan_sip.c:6713
> >> get_destination: Huh? Not a SIP header 
> >> (SIP:9732xxxx at sip.xxxxxxx.com:5060)?
> >>
> >> When I looked at the relevant parts of chan_sip, it became 
> obvious to 
> >> me that the client's system was sending SIP URLs beginning with 
> >> "SIP:" instead of "sip:", but chan_sip in various places does 
> >> strncmp(url,"sip:",4).
> >>
> >> Is "SIP:" valid? If so, I think there are many places where
> >> strncasecmp() should be used instead.
> >>
> >> I checked trunk, and noticed that strncasecmp() is used sometimes, 
> >> but that strncmp is also still used in some places. It 
> also affects 
> >> 1.4 and 1.2.
> >>
> >> Comments?
> >>
> >> Cheers
> >> Tony
> >> --
> >> Tony Mountifield
> >> Work: tony at softins.co.uk - http://www.softins.co.uk
> >> Play: tony at mountifield.org - http://tony.mountifield.org 
> >> _______________________________________________
> >> --Bandwidth and Colocation provided by Easynews.com --
> >>
> >> asterisk-dev mailing list
> >> To UNSUBSCRIBE or update options visit:
> >>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> >>
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> ---
> Olle E. Johansson * Asterisk Evangelist, developer * VOOP A/S 
> olle at voop.com
> 
> 
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 


More information about the asterisk-dev mailing list