StanislavBondar / doubango

Automatically exported from code.google.com/p/doubango
0 stars 0 forks source link

Sip message parse problem #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.A SIP header with multi line
2.tsip_message_parse would be fail
eg.

WWW-Authenticate: Digest realm="ims.com",(CRLF here)
 nonce="2dKTzX37hxIvBkoFXv8/PA==",algorithm=MD5,qop="auth"

"nonce" would be taken as a header then the parser runs fail

Please provide any additional information below.

Original issue reported on code.google.com by licho...@gmail.com on 4 Dec 2010 at 7:06

GoogleCodeExporter commented 9 years ago
Very strange because this issue has been resolved.
Which SVN revision are you using?
Could you please send network trace?

Original comment by boss...@yahoo.fr on 4 Dec 2010 at 2:16

GoogleCodeExporter commented 9 years ago
The latest revision is OK...

Original comment by licho...@gmail.com on 5 Dec 2010 at 7:55

GoogleCodeExporter commented 9 years ago
But when I test tsip_message_parse with this data:

#define SIP_MESSAGE \
    "SIP/2.0 401 Unauthorized\r\n" \
    "Via: SIP/2.0/UDP 192.168.152.2:49495;branch=z9hG4bK6150438;rport=49495\r\n" \
    "Call-ID: 33913c5c-4504-3267-9cba-44421dbccd9c\r\n" \
    "From: <sip:+8657180007901@ims.com>;tag=6069478\r\n" \
    "To: <sip:+8657180007901@ims.com>;tag=21z17w28\r\n" \
    "CSeq: 27424 REGISTER\r\n" \
    "WWW-Authenticate: Digest realm=\"ims.com\",\r\n nonce=\"iSxU92mGYMaNwYzO3wtCFA==\",stale=true,algorithm=MD5\r\n" \
    "Content-Length: 0\r\n" \
    "\r\n"

there's an error: the tsip_header_Dummy_parse() run fail.

But everything goes well...

Original comment by licho...@gmail.com on 5 Dec 2010 at 4:46

GoogleCodeExporter commented 9 years ago
Do you get the same data when you serialize the message_t object?

Original comment by boss...@yahoo.fr on 7 Dec 2010 at 1:36

GoogleCodeExporter commented 9 years ago
void test_parser()
{
    tsk_ragel_state_t state;
    tsip_message_t *message = tsk_null;
    tsk_buffer_t *buffer = tsk_buffer_create_null();

    tsk_ragel_state_init(&state, SIP_MESSAGE, tsk_strlen(SIP_MESSAGE));

    tsip_message_parse(&state, &message, tsk_true);
    tsip_message_tostring(message, buffer);
    TSK_DEBUG_INFO("Buffer=\n%s", TSK_BUFFER_TO_STRING(buffer));

    TSK_OBJECT_SAFE_FREE(message);
    TSK_OBJECT_SAFE_FREE(buffer);
}

Any problem here?

Original comment by licho...@gmail.com on 7 Dec 2010 at 1:45

GoogleCodeExporter commented 9 years ago
No all is ok. There is a minor issue in the state machine parser but you can 
safely ignore the error message (all headers will be parsed). I'll fix the 
issue in the coming releases.

Original comment by boss...@yahoo.fr on 7 Dec 2010 at 1:55

GoogleCodeExporter commented 9 years ago

Original comment by boss...@yahoo.fr on 4 Jun 2011 at 7:18