[OpenSIPS-Users] ERROR:core:tcp_read_req: bad request
Bogdan-Andrei Iancu
bogdan at opensips.org
Wed Apr 6 16:56:24 CEST 2011
Hi John,
First of all I'm trying to see if \n\n is allowed in the username value
(which is a quoted-string). According to the SIP grammar :
A string of text is parsed as a single word if it is quoted using
double-quote marks. In quoted strings, quotation marks (") and
backslashes (\) need to be escaped.
quoted-string = SWS DQUOTE *(qdtext / quoted-pair ) DQUOTE
qdtext = LWS / %x21 / %x23-5B / %x5D-7E
/ UTF8-NONASCII
The backslash character ("\") MAY be used as a single-character
quoting mechanism only within quoted-string and comment constructs.
Unlike HTTP/1.1, the characters CR and LF cannot be escaped by this
mechanism to avoid conflict with line folding and header separation.
quoted-pair = "\" (%x00-09 / %x0B-0C
/ %x0E-7F)
In it not 100% sure how to read this, but it seams to me that the \n\n
is not valid in a quoted string.... or ?
Regards,
Bogdan
On 03/22/2011 07:54 PM, John Khvatov wrote:
> Hello all.
>
> I could be wrong but it looks like bug in parser:
>
> Mar 22 17:26:22 sip /usr/sbin/opensips[3005]: ERROR:core:tcp_read_req: bad request, state=4, error=4 buf:#012REGISTER sip:tipmeet.com SIP/2.0#015#012Via: SIP/2.0/TCP 192.168.1.100:58279;branch=z9hG4bK-d8754z-e162c0293960910c-1---d8754z-;rport#015#012Max-Forwards: 70#015#012Contact:<sip:96210185 at 192.168.1.100:58279;rinstance=8f953a1c002afaee;transport=TCP>#015#012To: "96210185"<sip:96210185 at tipmeet.com>#015#012From: "96210185"<sip:96210185 at tipmeet.com>;tag=6a11c927#015#012Call-ID: YTJhZmEzN2EzM2NkNGU1ZWY0ZDU3MTZlZTM3Y2Q1MWQ.#015#012CSeq: 2 REGISTER#015#012Expires: 3600#015#012Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO#015#012User-Agent: Bria release 2.5 RC4 stamp 47242#015#012Authorization: Digest username="tipmeet.com#012#01296210185",realm="tipmeet.com",nonce="4d88dbdb00000b9759f36d9f0a8fbac1ae1a3aea9963bae6",uri="sip:tipmeet.com",response="bc7d38b1bb7b190d94c8ad6a4cd4599a",cnonce="3264a3294f724a3d1cd0ca276593b9ba",nc=00000001,qop=auth,algorithm=MD5#015#012Content-Length: 0#015#012#015#012#012parsed:#012REGISTER sip:tipmeet.com SIP/2.0#015#012Via: SIP/2.0/TCP 192.168.1.100:58279;branch=z9hG4bK-d8754z-e162c0293960910c-1---d8754z-;rport#015#012Max-Forwards: 70#015#012Contact:<sip:96210185 at 192.168.1.100:58279;rinstance=8f953a1c002afaee;transport=TCP>#015#012To: "96210185"<sip:96210185 at tipmeet.com>#015#012From: "96210185"<sip:96210185 at tipmeet.com>;tag=6a11c927#015#012Call-ID: YTJhZmEzN2EzM2NkNGU1ZWY0ZDU3MTZlZTM3Y2Q1MWQ.#015#012CSeq: 2 REGISTER#015#012Expires: 3600#015#012Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO#015#012User-Agent: Bria release 2.5 RC4 stamp 47242#015#012Authorization: Digest username="tipmeet.com#012#012
>
>
> Pay attention to this header:
> Authorization: Digest username="tipmeet.com#012#01296210185"
>
> Quoted string with two NL chars: "tipmeet.com\n\n96210185" did not parsed correctly.
>
--
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"
More information about the Users
mailing list