Summary: | ASTERISK-13381: [patch] SIP Channel name is not unique | ||
Reporter: | nick_lewis (nick_lewis) | Labels: | |
Date Opened: | 2009-01-16 04:31:04.000-0600 | Date Closed: | 2009-04-17 09:50:45 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_sip/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) chan_sip.c-chname.patch | |
Description: | The name of the asterisk channel that is created on an incoming sip call is not unique There can be two trunks with different ITSP but same username e.g. [trunk1] username=nicklewis host=sip.myitsp1.com [trunk2] username=nicklewis host=sip.myitsp2.net The sip channel name of the asterisk channel that is created when a call comes into these trunks is "SIP/nicklewis" in both cases. The sip channel should be named after the peername instead e.g. "SIP/trunk1" and "SIP/trunk2" | ||
Comments: | By: nick_lewis (nick_lewis) 2009-01-16 05:01:12.000-0600 This patch also helps the flash operator panel to work. The line state of a fop button is determined by the channel name (as shown in 'core show channels' etc) but the click-to-dial action of a fop button is determined by the peername (as in dialplan command Dial(SIP/peername)). Without this patch it is not possible to select a button name that gets both fop features to work By: Joshua C. Colp (jcolp) 2009-01-22 14:38:56.000-0600 I can't actually get the behavior you are seeing in the latest version of anything. Can you retry and if it still happens provide the complete console output with debug and configuration so I can take a gander? By: nick_lewis (nick_lewis) 2009-01-23 06:08:40.000-0600 Ok I will try to get you some more information with a live setup What are you seeing in the latest version in response to the CLI command "core show channels" when you have an incoming sip trunk call? By: Olle Johansson (oej) 2009-01-23 08:28:20.000-0600 "username" should not be used in setting up the channel name at all. If it is, that is a bug by itself. By: nick_lewis (nick_lewis) 2009-01-27 03:50:11.000-0600 Agreed the channel name should be SIP/peername as sip specific information such as username should not be exposed to the rest of the pbx. The patch corrects this. Here is an extract of conf and cli showing the problem: [root@asterisk1 ~]# tail -15 /etc/asterisk/sip_additional.conf [test2] type=peer context=from-trunk host=sip.atltelecom.com port=5060 outboundproxy= outboundproxyport= insecure=invite username=2345 secret=2345 fromuser=2345 fromdomain=sip.atltelecom.com fromname=PBX [root@asterisk1 ~]# asterisk -r asterisk1*CLI> core show channels Channel Location State Application(Data) SIP/2345-09938190 s@app-announcement-1 Up Wait(1) The channel name is given as SIP/2345 instead of SIP/test2 By: Olle Johansson (oej) 2009-01-27 03:55:55.000-0600 Sorry for not believing you at first, because this is so stupid. I can't belive that this is the case... Well, gotta fix it. By: Olle Johansson (oej) 2009-01-27 03:56:36.000-0600 Do you have an 1.4 system to test with as well, just to check how far back we need to go? By: nick_lewis (nick_lewis) 2009-01-27 04:16:35.000-0600 Sorry no active 1.4 system but tried on a 1.2 system and had same problem. Code examination suggests that 1.4 is also affected By: Olle Johansson (oej) 2009-01-27 04:20:02.000-0600 OK then. Since it's not really a security issue, I don't think we'll change 1.2. But 1.4 and later needs to be fixed. Will discuss with file on how to push this forward, since this is assigned to him by him. By: Leif Madsen (lmadsen) 2009-02-02 13:28:52.000-0600 Assigned back to file since we're waiting for feedback from him. By: Joshua C. Colp (jcolp) 2009-02-10 08:35:40.000-0600 oej: I think we can just change this to use the peer name if non-NULL and user name otherwise. This should give the desired behavior for all scenarios. I'm just hesitant to change this in previous versions since people may have depended on the old wrong behavior... probably not though. Thoughts? By: nick_lewis (nick_lewis) 2009-02-11 03:50:12.000-0600 It appears that pvt->peername and pvt->username are both populated when there is a match in check_user_ok() or check_peer_ok(). In cases where peername is null then username is also null so a policy of 'use username otherwise' would never actually be applied. Note that if there is no match then sip_new() internally requisitions fromdomain for the channel name. If there is real worry about losing username from the channel name then perhaps there could be a global setting legacychannelname=yes By: Joshua C. Colp (jcolp) 2009-02-13 13:13:30.000-0600 After looking at this further I do agree that using peername should be fine. oej: Have you also given it a look and can agree? By: Leif Madsen (lmadsen) 2009-03-04 12:37:19.000-0600 Ping? By: nick_lewis (nick_lewis) 2009-03-26 06:45:07 file/Imadsen Can this please proceed. I think OEJ made it quite clear that the application of the username in the channel was a bug in all versions. Quotes: >"username" should not be used in setting up the channel name at all. If it is, that is a bug by itself. >Since it's not really a security issue, I don't think we'll change 1.2. But 1.4 and later needs to be fixed. By: Digium Subversion (svnbot) 2009-04-17 09:41:27 Repository: asterisk Revision: 188946 U branches/1.4/channels/chan_sip.c ------------------------------------------------------------------------ r188946 | file | 2009-04-17 09:41:26 -0500 (Fri, 17 Apr 2009) | 15 lines Fix a bug where a value used to create the channel name was bogus. This commit fixes the scenario where an incoming call is authenticated using a peer entry. Previously the channel name was created using either the username setting from the sip.conf entry or the IP address that the call came from. Now the channel name will be created using the peer name itself. This commit will not change the way the channel name is generated for users or friends. (closes issue ASTERISK-13381) Reported by: Nick_Lewis Patches: chan_sip.c-chname.patch uploaded by Nick (license 657) Tested by: Nick_Lewis, file ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=188946 By: Digium Subversion (svnbot) 2009-04-17 09:44:57 Repository: asterisk Revision: 188947 _U trunk/ U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r188947 | file | 2009-04-17 09:44:56 -0500 (Fri, 17 Apr 2009) | 22 lines Merged revisions 188946 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188946 | file | 2009-04-17 11:41:25 -0300 (Fri, 17 Apr 2009) | 15 lines Fix a bug where a value used to create the channel name was bogus. This commit fixes the scenario where an incoming call is authenticated using a peer entry. Previously the channel name was created using either the username setting from the sip.conf entry or the IP address that the call came from. Now the channel name will be created using the peer name itself. This commit will not change the way the channel name is generated for users or friends. (closes issue ASTERISK-13381) Reported by: Nick_Lewis Patches: chan_sip.c-chname.patch uploaded by Nick (license 657) Tested by: Nick_Lewis, file ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=188947 By: Digium Subversion (svnbot) 2009-04-17 09:46:50 Repository: asterisk Revision: 188948 _U branches/1.6.0/ U branches/1.6.0/channels/chan_sip.c ------------------------------------------------------------------------ r188948 | file | 2009-04-17 09:46:50 -0500 (Fri, 17 Apr 2009) | 29 lines Merged revisions 188947 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r188947 | file | 2009-04-17 11:44:56 -0300 (Fri, 17 Apr 2009) | 22 lines Merged revisions 188946 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188946 | file | 2009-04-17 11:41:25 -0300 (Fri, 17 Apr 2009) | 15 lines Fix a bug where a value used to create the channel name was bogus. This commit fixes the scenario where an incoming call is authenticated using a peer entry. Previously the channel name was created using either the username setting from the sip.conf entry or the IP address that the call came from. Now the channel name will be created using the peer name itself. This commit will not change the way the channel name is generated for users or friends. (closes issue ASTERISK-13381) Reported by: Nick_Lewis Patches: chan_sip.c-chname.patch uploaded by Nick (license 657) Tested by: Nick_Lewis, file ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=188948 By: Digium Subversion (svnbot) 2009-04-17 09:48:52 Repository: asterisk Revision: 188949 _U branches/1.6.1/ U branches/1.6.1/channels/chan_sip.c ------------------------------------------------------------------------ r188949 | file | 2009-04-17 09:48:52 -0500 (Fri, 17 Apr 2009) | 29 lines Merged revisions 188947 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r188947 | file | 2009-04-17 11:44:56 -0300 (Fri, 17 Apr 2009) | 22 lines Merged revisions 188946 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188946 | file | 2009-04-17 11:41:25 -0300 (Fri, 17 Apr 2009) | 15 lines Fix a bug where a value used to create the channel name was bogus. This commit fixes the scenario where an incoming call is authenticated using a peer entry. Previously the channel name was created using either the username setting from the sip.conf entry or the IP address that the call came from. Now the channel name will be created using the peer name itself. This commit will not change the way the channel name is generated for users or friends. (closes issue ASTERISK-13381) Reported by: Nick_Lewis Patches: chan_sip.c-chname.patch uploaded by Nick (license 657) Tested by: Nick_Lewis, file ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=188949 By: Digium Subversion (svnbot) 2009-04-17 09:50:44 Repository: asterisk Revision: 188950 _U branches/1.6.2/ U branches/1.6.2/channels/chan_sip.c ------------------------------------------------------------------------ r188950 | file | 2009-04-17 09:50:43 -0500 (Fri, 17 Apr 2009) | 29 lines Merged revisions 188947 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r188947 | file | 2009-04-17 11:44:56 -0300 (Fri, 17 Apr 2009) | 22 lines Merged revisions 188946 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r188946 | file | 2009-04-17 11:41:25 -0300 (Fri, 17 Apr 2009) | 15 lines Fix a bug where a value used to create the channel name was bogus. This commit fixes the scenario where an incoming call is authenticated using a peer entry. Previously the channel name was created using either the username setting from the sip.conf entry or the IP address that the call came from. Now the channel name will be created using the peer name itself. This commit will not change the way the channel name is generated for users or friends. (closes issue ASTERISK-13381) Reported by: Nick_Lewis Patches: chan_sip.c-chname.patch uploaded by Nick (license 657) Tested by: Nick_Lewis, file ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=188950 |