[Home]

Summary:ASTERISK-17293: [patch] Wrong country code identifier "%2B" instead of "+" in Remote-Party-ID
Reporter:Dr. W.A. Slaby (was)Labels:
Date Opened:2011-01-27 02:16:01.000-0600Date Closed:2011-05-06 14:35:32
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) quick-and-dirty.patch
Description:Starting with version 1.8.x Asterisk is delivering a wrong prefix "%2B" instead of "+" in Remote-Part-ID as shown in the folowing trace snapshot
(some fields replaced by xxxxxxxxxxx for privacy reasons):

From: "xxxxxxxxxxxx" <sip:+498421931296@141.78.x.x>;tag=as1cb29c87
To: <sip:+49xxxxxxxxxx@193.174.x.x>
Contact: <sip:+498421931296@141.78.x.x:5060>
Call-ID: 1aa82f9a655bd20a5a0038a95b06aa00@141.78.x.x:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.1
Date: Wed, 26 Jan 2011 07:09:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Remote-Party-ID: "xxxxxxxxxxxxxxxxxx" <sip:%2B498421931296@141.78.x.x>;party=calling;privacy=off;screen=yes
Content-Type: application/sdp
Content-Length: 173

The call is rejected by Deutsche Telekom host with the error message
"Got SIP response 500 "Internal Server Error" back from 193.174.1.234:5060"

This phenomenon first observed with Asterisk 1.8.1 was reproducable also with Asterisk 1.8.2.2.

This is my first Asterisk bug report; please apologize any deficiencies.
Comments:By: Walter Doekes (wdoekes) 2011-01-27 02:26:31.000-0600

wolfgang: try pedantic=no in sip.conf

By: Walter Doekes (wdoekes) 2011-01-27 02:32:40.000-0600

(No wait.. there is no pedantic checking in the RPID routines. Never mind.)

By: Walter Doekes (wdoekes) 2011-01-27 02:43:23.000-0600

In 1.8 branch, the ast_uri_encode gets different values for do_special_char:
- add_rpid: do_special_char=1
- build_contact: do_special_char=1
- initreqprep (set from and ruri): do_special_char=0

This seems to be fixed in trunk (ast_uri_sip_user flag for ast_uri_encode).

Suggestion: merge the fix or set do_special_char=0 for add_rpid/build_contact (the quick/dirty fix)

By: devellow (devellow) 2011-01-27 04:16:34.000-0600

the quick and dirty patch for 1.8 branch is working for me.

By: Dr. W.A. Slaby (was) 2011-01-27 04:30:50.000-0600

The patch supplied by wdoekes is working fine on 1.8.2. Please let us know when the problem is solved in the 1.8 branch.

By: Leif Madsen (lmadsen) 2011-01-31 13:59:22.000-0600

You will be made aware when this issue is closed by the bot.

By: Russell Bryant (russell) 2011-02-10 10:06:51.000-0600

This looks like a bug on their end and that Asterisk is just doing URI encoding as it is supposed to do.

By: Dr. W.A. Slaby (was) 2011-02-14 07:46:02.000-0600

Perhaps it is possible to introduce a new option like
rpidencoding=uri  for doing URI encoding as introduced with Asterisk 1.8
rpidencoding=ascii  for doing ASCII encoding as with Asterisk up to version 1.6

T-Systems International GmbH is running a Sonus MSP providing a SIP-PBX-gateway. According to their information this gateway is not able to support RFC3986. Therefore, an option as specified would be of great help.



By: Florent Chauveau (mav3rick) 2011-05-05 06:21:26

I have the same issue with Verizon SIP Interconnect.

When the RPID is URI encoded ("%2B" instead of "+"), they reject the call with "SIP/2.0 403 Calling Party Information Not Found".

Maybe they are doing it wrong, but it would be great to add an option to maintain compatibility.

By: Florent Chauveau (mav3rick) 2011-05-05 06:27:13

BTW the patch is working great.

By: Digium Subversion (svnbot) 2011-05-06 14:35:02

Repository: asterisk
Revision: 317861

U   branches/1.8/channels/chan_sip.c

------------------------------------------------------------------------
r317861 | russell | 2011-05-06 14:35:02 -0500 (Fri, 06 May 2011) | 11 lines

URI encode less characters in the RPID and Contact headers.

If this change causes any problems, we will need to backport the more extensive
uri encoding and decoding handling changes that are in trunk/1.10.

(closes issue ASTERISK-17293)
Reported by: wolfgang
Patches:
     quick-and-dirty.patch uploaded by wdoekes (license 717)
Tested by: wdoekes, devellow, wolfgang, mav3rick

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=317861

By: Digium Subversion (svnbot) 2011-05-06 14:35:31

Repository: asterisk
Revision: 317862

_U  trunk/

------------------------------------------------------------------------
r317862 | russell | 2011-05-06 14:35:31 -0500 (Fri, 06 May 2011) | 17 lines

Blocked revisions 317861 via svnmerge

........
 r317861 | russell | 2011-05-06 14:35:00 -0500 (Fri, 06 May 2011) | 11 lines
 
 URI encode less characters in the RPID and Contact headers.
 
 If this change causes any problems, we will need to backport the more extensive
 uri encoding and decoding handling changes that are in trunk/1.10.
 
 (closes issue ASTERISK-17293)
 Reported by: wolfgang
 Patches:
       quick-and-dirty.patch uploaded by wdoekes (license 717)
 Tested by: wdoekes, devellow, wolfgang, mav3rick
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=317862