aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 00:14:17 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 00:14:17 +0000
commit32bda84352e6717f578fa20efabd9eb3f5d047a0 (patch)
tree26da6c6ddcaf232bd54097d0e267d3dc69d2d4de /channels
parent57c288e6501de54f8e1b8f5e0a1c3fa18db3f5ac (diff)
Merged revisions 150307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r150307 | mmichelson | 2008-10-16 19:13:35 -0500 (Thu, 16 Oct 2008) | 14 lines After a long discussion on #asterisk-bugs, it seems kind of odd that a channel would be named after the port on which it came in on. For endpoints that always include ":5060" as part of the From: header, it will mean that you have a ton of channels with names like "SIP/5060-3ea38a8b." I am boldly moving forward with this change in trunk, but I'm not touching other branches with this one since this definitely would qualify as a behavior change. If there is a problem with this commit, and I haven't seen the obvious reason why you'd want to name the channel after the port from which the call originated, then please feel free to revert this ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@150308 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fad808cc2..3db7f779b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5320,12 +5320,15 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
{
const char *my_name; /* pick a good name */
- if (title)
+ if (title) {
my_name = title;
- else if ( (my_name = strchr(i->fromdomain, ':')) )
- my_name++; /* skip ':' */
- else
- my_name = i->fromdomain;
+ } else {
+ char *port = NULL;
+ my_name = ast_strdupa(i->fromdomain);
+ if ((port = strchr(i->fromdomain, ':'))) {
+ *port = '\0';
+ }
+ }
sip_pvt_unlock(i);
/* Don't hold a sip pvt lock while we allocate a channel */