doubango icon indicating copy to clipboard operation
doubango copied to clipboard

tsip_message_parse() Parser fails to handle when Non -ASCII character present in UPDATE request for P-Asserted-Identity.

Open GoogleCodeExporter opened this issue 10 years ago • 4 comments

After Transferring the call, In UPDATE request P-Asserted-Identity contains non 
- ASCII character, Due to which tsip_message_parse() function gets failed.

Please find attachment for the logs. 

Original issue reported on code.google.com by [email protected] on 21 Dec 2013 at 11:59

Attachments:

GoogleCodeExporter avatar Aug 16 '15 21:08 GoogleCodeExporter

the same is observed for From and To header also for display name.

Original comment by [email protected] on 4 Feb 2014 at 6:56

GoogleCodeExporter avatar Aug 16 '15 21:08 GoogleCodeExporter

I meet the same problem: when I add display name in From header which contains Chinese characters, it returns with the following error: MSG: Failed to parse SIP message: 中文字符"sip:[email protected];tag=813311057

Can you help me?

gle2135 avatar Aug 16 '16 02:08 gle2135

@DoubangoTelecom @GoogleCodeExporter

Today I read this info:

As far as I know, the most significant area is the "name-addr" construction, which is the enhanced URI that is used to address phone calls. That is often used at the receiving phone to display the caller's name a phone number. Typical use is something like:

  INVITE sip:bob at biloxi.com SIP/2.0
  From: Alice <sip:alice at atlanta.com>;tag=1928301774
  To: Bob <sip:bob at biloxi.com>

The display-name part, "Alice" and "Bob" is defined to be a series of UTF-8-encoded Unicode characters (with certain restrictions), so it is already fully internationalized. It also has the virtue that while the protocol carries it, the protocol doesn't interpret it.

That is to say, the header is encoded as UTF-8-encoded Unicode characters (with certain restrictions), and so, it doesn't Constraint only ASCII character.

But when I receive this message with Chinese characters, I got an error. The message received: RECV:SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.1.109:59464;branch=z9hG4bK-1279709381;received=124.205.124.82;rport=20993 From: "测试中文"sip:[email protected];tag=2102607475 To: sip:[email protected] Call-ID: 8fb590e8-464f-2251-7777-9abe5401bb5c CSeq: 1524668082 INVITE Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces, timer Session-Expires: 360;refresher=uas

The error: ***ERROR: function: "tsip_message_parse()" file: "src/parsers/tsip_parser_message.c" line: "227" MSG: Failed to parse SIP message: 测试中文"sip:[email protected];tag=2102607475 To: sip:[email protected] Call-ID: 8fb590e8-464f-2251-7777-9abe5401bb5c CSeq: 1524668082 INVITE Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces, timer Session-Expires: 360;refresher=uas

gle2135 avatar Aug 16 '16 08:08 gle2135

and I had read this very help info: https://groups.google.com/forum/#!topic/doubango/DPv6Ur74Wvw but still no .....

The ABNF is like this: [ display-name ] LAQUOT addr-spec RAQUOT

  • LAQUOTE is "<" and RAQUOT ">"
  • the "[]" means that the display-name is optional and when present it must be: "*(token LWS) / quoted-string"
  • the "*" means zero or multiple, "/" is an OR and "LWS" is SPACEs.
  • token is a string In your case you are using the second form ( "*(token LWS)" ) as the name is not quoted. As you can see, each token must be followed by a SPACE (LWS) (see parenthesis). Your server returns: From: behnam<sip: 0.0.0.0>;epid=6b778e25-1f6;tag=plcm_3532849520-6 But must be: From: behnam <sip: 0.0.0.0>;epid=6b778e25-1f6;tag=plcm_3532849520-6 --> a SPACE must be added between 'behnam' and '<'. Please note that this SPACE is not required if the display-name (behnam) was quoted e.g.: From: "behnam"<sip: 0.0.0.0>;epid=6b778e25-1f6;tag=plcm_3532849520-6

gle2135 avatar Aug 16 '16 08:08 gle2135