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

Olle E Johansson olle at voop.com
Wed May 16 02:02:50 MST 2007


16 maj 2007 kl. 10.45 skrev Tony Mountifield:

> 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?

I really don't know what the URI spec says, but I assume it is case  
insensitive. It makes sense to
handle it that way in the code anyway. I'll go ahead and try to fix  
this. Please test after I commit the needed
patches.

/O


More information about the asterisk-dev mailing list