[Asterisk-Users] bug report: whitespaces in uris

Jiri Kuthan jiri at iptel.org
Tue Aug 26 05:04:11 MST 2003


FYI: Asterisk puts URIs in messages which violates the SIP spec and 
can't be accepted by URI parsers: username includes a whitespace.
See for example the From header field. Attached is example of an
incorrect message and related parts of RFC3261 specification. 

(Who doesn't want to dig into parser details may want to realize
 that whitespaces are used as uri delimitors in first request
 line and can't thus be a uri part.)

I would recommend that the stack generally validates URIs for
such glitches and uses other word for "no callId". "anonymous"
is in frequent use by other software.

-jiri

OPTIONS sip:195.37.77.101 SIP/2.0
Via: SIP/2.0/UDP 24.172.18.166:5060;branch=z9hG4bK03be4cf3
From: "No CallID" <sip:No CallID at 24.172.18.166>;tag=as2746f4f3
To: <sip:195.37.77.101>
Contact: <sip:No CallID at 24.172.18.166>
Call-ID: 72b6aaf63319c64e4a96a6cd42245f7e at 24.172.18.166
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Length: 0

3261:
From->name_addr|addr_spec
addr_spec->SIP_URI
SIP_URI->userinfo
user_info->user
user->1*( unreserved / escaped / user-unreserved 
user-unreserved  =  "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
unreserved  =  alphanum / mark
mark        =  "-" / "_" / "." / "!" / "~" / "*" / "'"
                     / "(" / ")"


--
Jiri Kuthan             http://iptel.org/~jiri/
iptel.org -- creaters of the fastest SIP server  




More information about the asterisk-users mailing list