[asterisk-commits] mmichelson: trunk r150307 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 16 19:13:35 CDT 2008


Author: mmichelson
Date: Thu Oct 16 19:13:35 2008
New Revision: 150307

URL: http://svn.digium.com/view/asterisk?view=rev&rev=150307
Log:
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


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=150307&r1=150306&r2=150307
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Oct 16 19:13:35 2008
@@ -5664,12 +5664,15 @@
 	{
 		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 */




More information about the asterisk-commits mailing list