[Home]

Summary:ASTERISK-14868: [patch] IAX does not allow CALLERID(num) contain non-numbers.
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2009-09-22 19:40:54Date Closed:2009-10-21 17:10:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 15940_shrinkcallerid_trunk.c
( 1) v1-15940.patch
( 2) v2-15940.patch
Description:( I already explained the issue here: http://lists.digium.com/pipermail/asterisk-dev/2009-August/039257.html )

The thing is that IAX channel driver "shrinks" (ast_shrink_phone_number) caller number. Which was probably the good thing before. However nowadays when you have Skype support integrated, skype names passed via CALLERID(num) get damaged.

I believe that only drivers which know they can not pass arbitrary number (like DAHDI for example) should do shrinking of number before sending out. While inside Asterisk (or relayed to another Asterisk with SIP/IAX) we should presever original number.

Obviously I can create a patch for chan_iax which removes the shrinking because this patch is trivial. However issue may be more global and affect other drivers so I believe it is better to hear from Digium guys first - maybe they have another opinion about how to solve that issue or do not consider it an issue at all :)
Comments:By: Leif Madsen (lmadsen) 2009-09-23 09:35:39

I *do* agree that we need to have a discussion about this, but if we're at the discussion stage, then opening a bug is not the correct course of action as of yet.

Discussions should be performed on the asterisk-dev mailing list, and once a conclusion comes forth about how to proceed, then the issue can be opened, and the proposed patch attached.

I'm closing this issue for now, however, please reopen this issue once a conclusion has come to fruition. Thanks!

By: Dmitry Andrianov (dimas) 2009-09-25 05:32:14

As per email conversation with lmadsen, I'm re-opening the issue and providing the patch which I applied to my system in order to fix the issue...

The patch is against 1.4.26.1 but it is trivial and can be applied to any version.

By: John Todd (jtodd) 2009-10-05 11:28:13

Is this a problem with SIP as well as IAX?  Do we need to address this issue in other places if someone works on it?

By: Dmitry Andrianov (dimas) 2009-10-05 11:31:08

Honestly I have not tested SIP.
If someone approves the whole thing (that shrinking of number should NOT be done for channels which are able to carry any characters in ID) then I can make test with SIP as well and if SIP does the same - patch it appropriately.



By: Leif Madsen (lmadsen) 2009-10-05 12:05:28

I tend to agree this should be done, and would like to know if this works on SIP. If so, and you supply the patch, I see no reason why it wouldn't be accepted. Thoughts?

Thanks!

By: Dmitry Andrianov (dimas) 2009-10-06 09:20:56

So the thing is: chan_sip also does shrinking of the number although not that "rude" as chan_iax. This is because chan_sip checks if number is shrinkable before actually shrinking it. Because of this numbers like 'test.test' remains intact while '123.456' becomes '123456'.

I will do a patch later today however I would like to bring your attention to the fact that such a patch will break ability for Asterisk to properly handle calls which local SIP clients may place to numbers like '1-212-123-4567' or '1 212 1234567'. So it may be a good idea to provide something like SHRINK_NUMBER dialplan function for them to migrate. What do you think?

By: Dmitry Andrianov (dimas) 2009-10-06 17:24:46

Spent some time tracing these number shrinks into the past. It seems Asterisk was doing shrinking of SIP numbers from the very beginning (SVN revisions <1000).

Also I think it is a good idea if oej take a look because he was working on ASTERISK-4451 which is related.

By: Leif Madsen (lmadsen) 2009-10-07 09:10:58

Hmmm, I'm almost thinking we should have a function or something that just turns off all shrinking instead of doing the shrinking. That way existing setups that require the shrinking to work as-is are not disturbed, but at the same time allow the administrator to get around the CALLERID() shrinking. Perhaps we could do something like:

exten => start,n,Set(CALLERID(shrink)=<yes|no|1|0>)

Thoughts?

This is getting to the point we should move this to the -dev list.

By: Olle Johansson (oej) 2009-10-07 09:15:12

Leif and I have a very old propsal for Alphanumeric caller id names. I don't think we can't solve this properly without separating alphanumeric and numeric numbers.  Time to take the dust off that old proposal.

By: Leif Madsen (lmadsen) 2009-10-07 09:24:56

Heh, yay! I remember that ;)

Do you have a link to it? Perhaps it would be useful to link it here under Additional Information.

By: Dmitry Andrianov (dimas) 2009-10-11 17:03:27

Leif,
I do not think idea with CALLERID(shrink)=no will work out well.
First of all, shrinking is done somewhere at the peer authentication phase. I'm not sure we are already executing dialplan at that moment.

It sounds more like configuration option....

And what is the proposal you are talking about?

By: David Vossel (dvossel) 2009-10-14 16:20:45

I've uploaded a patch to make this a configuration option for both sip and iax.  The shrinking of callerid still remains on by default unless otherwise specified.  Does this resolve the issue?

By: Dmitry Andrianov (dimas) 2009-10-14 17:27:41

I bet it does.
(However I won't be able to test in the nearese future).

I'm fine with the fix although I am already dreaming about changing the default in furuee and then deprecating option :)

Thanks, David.

By: David Vossel (dvossel) 2009-10-15 15:59:27

Alright, I'll try and get it tested and committed next week then.

By: Digium Subversion (svnbot) 2009-10-21 11:07:14

Repository: asterisk
Revision: 225032

U   branches/1.4/channels/chan_iax2.c
U   branches/1.4/channels/chan_sip.c
U   branches/1.4/configs/iax.conf.sample
U   branches/1.4/configs/sip.conf.sample

------------------------------------------------------------------------
r225032 | dvossel | 2009-10-21 11:07:13 -0500 (Wed, 21 Oct 2009) | 20 lines

IAX/SIP shrinkcallerid option

The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
and '-' from the string.  This means values such as 555.5555 and
test-test result in 555555 and testtest.  There are instances,
such as Skype integration, where a specific value is passed via
caller id that must be preserved unmodified.  This patch makes
the shrinking of caller id optional in chan_sip and chan_iax in
order to support such cases.  By default this option is on to
preserve previous expected behavior.

(closes issue ASTERISK-14868)
Reported by: dimas
Patches:
     v2-15940.patch uploaded by dimas (license 88)
     15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/408/

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

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

By: Digium Subversion (svnbot) 2009-10-21 11:07:20

Repository: asterisk
Revision: 225033

_U  trunk/
U   trunk/channels/chan_iax2.c
U   trunk/channels/chan_sip.c
U   trunk/configs/iax.conf.sample
U   trunk/configs/sip.conf.sample

------------------------------------------------------------------------
r225033 | dvossel | 2009-10-21 11:07:20 -0500 (Wed, 21 Oct 2009) | 27 lines

Merged revisions 225032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
 
 IAX/SIP shrinkcallerid option
 
 The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
 and '-' from the string.  This means values such as 555.5555 and
 test-test result in 555555 and testtest.  There are instances,
 such as Skype integration, where a specific value is passed via
 caller id that must be preserved unmodified.  This patch makes
 the shrinking of caller id optional in chan_sip and chan_iax in
 order to support such cases.  By default this option is on to
 preserve previous expected behavior.
 
 (closes issue ASTERISK-14868)
 Reported by: dimas
 Patches:
       v2-15940.patch uploaded by dimas (license 88)
       15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
 Tested by: dvossel
 
 Review: https://reviewboard.asterisk.org/r/408/
........

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

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

By: Digium Subversion (svnbot) 2009-10-21 11:07:27

Repository: asterisk
Revision: 225035

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_iax2.c
U   branches/1.6.2/channels/chan_sip.c
U   branches/1.6.2/configs/iax.conf.sample
U   branches/1.6.2/configs/sip.conf.sample

------------------------------------------------------------------------
r225035 | dvossel | 2009-10-21 11:07:27 -0500 (Wed, 21 Oct 2009) | 34 lines

Merged revisions 225033 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r225033 | dvossel | 2009-10-21 09:39:10 -0500 (Wed, 21 Oct 2009) | 27 lines
 
 Merged revisions 225032 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
   
   IAX/SIP shrinkcallerid option
   
   The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
   and '-' from the string.  This means values such as 555.5555 and
   test-test result in 555555 and testtest.  There are instances,
   such as Skype integration, where a specific value is passed via
   caller id that must be preserved unmodified.  This patch makes
   the shrinking of caller id optional in chan_sip and chan_iax in
   order to support such cases.  By default this option is on to
   preserve previous expected behavior.
   
   (closes issue ASTERISK-14868)
   Reported by: dimas
   Patches:
         v2-15940.patch uploaded by dimas (license 88)
         15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
   Tested by: dvossel
   
   Review: https://reviewboard.asterisk.org/r/408/
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-10-21 11:08:28

Repository: asterisk
Revision: 225062

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_iax2.c
U   branches/1.6.1/channels/chan_sip.c
U   branches/1.6.1/configs/iax.conf.sample
U   branches/1.6.1/configs/sip.conf.sample

------------------------------------------------------------------------
r225062 | dvossel | 2009-10-21 11:08:28 -0500 (Wed, 21 Oct 2009) | 34 lines

Merged revisions 225033 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r225033 | dvossel | 2009-10-21 09:39:10 -0500 (Wed, 21 Oct 2009) | 27 lines
 
 Merged revisions 225032 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
   
   IAX/SIP shrinkcallerid option
   
   The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
   and '-' from the string.  This means values such as 555.5555 and
   test-test result in 555555 and testtest.  There are instances,
   such as Skype integration, where a specific value is passed via
   caller id that must be preserved unmodified.  This patch makes
   the shrinking of caller id optional in chan_sip and chan_iax in
   order to support such cases.  By default this option is on to
   preserve previous expected behavior.
   
   (closes issue ASTERISK-14868)
   Reported by: dimas
   Patches:
         v2-15940.patch uploaded by dimas (license 88)
         15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
   Tested by: dvossel
   
   Review: https://reviewboard.asterisk.org/r/408/
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-10-21 17:10:11

Repository: asterisk
Revision: 225310

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_iax2.c
U   branches/1.6.0/channels/chan_sip.c
U   branches/1.6.0/configs/iax.conf.sample
U   branches/1.6.0/configs/sip.conf.sample

------------------------------------------------------------------------
r225310 | dvossel | 2009-10-21 17:10:10 -0500 (Wed, 21 Oct 2009) | 34 lines

Merged revisions 225033 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r225033 | dvossel | 2009-10-21 09:39:10 -0500 (Wed, 21 Oct 2009) | 27 lines
 
 Merged revisions 225032 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
   
   IAX/SIP shrinkcallerid option
   
   The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
   and '-' from the string.  This means values such as 555.5555 and
   test-test result in 555555 and testtest.  There are instances,
   such as Skype integration, where a specific value is passed via
   caller id that must be preserved unmodified.  This patch makes
   the shrinking of caller id optional in chan_sip and chan_iax in
   order to support such cases.  By default this option is on to
   preserve previous expected behavior.
   
   (closes issue ASTERISK-14868)
   Reported by: dimas
   Patches:
         v2-15940.patch uploaded by dimas (license 88)
         15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
   Tested by: dvossel
   
   Review: https://reviewboard.asterisk.org/r/408/
 ........
................

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

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