ChallyCai / doubango

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

how to make tsip_uri_parse handle such parameter : "sip:123.com" #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.just call tsip_uri_parse("sip:123.com", strlen(~));
2.function return 0(null)

What is the expected output? What do you see instead?
expect output is a valid tsip_uri_t pointer with 
type:sip, host:123.com
but it return 0(null), and log invalid "Failed to parse SIP/SIPS/TEL URI."

What version of the product are you using? On what operating system?
Last version of doubango, Windows VC2008,

Please provide any additional information below.

Original issue reported on code.google.com by dawenh...@gmail.com on 26 May 2011 at 2:36

GoogleCodeExporter commented 9 years ago
Fixed  in revision 594

Original comment by boss...@yahoo.fr on 31 May 2011 at 8:41

GoogleCodeExporter commented 9 years ago
For information, the correct code is:

tsip_uri_t *uri = tsip_uri_parse("sip:123.com", tsk_strlen("sip:123.com"));
if(uri){
    // do something
}
TSK_OBJECT_SAFE_FREE(uri);

Original comment by boss...@yahoo.fr on 31 May 2011 at 8:47