[asterisk-commits] bbryant: branch 1.8 r289099 - in /branches/1.8: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 28 13:18:06 CDT 2010


Author: bbryant
Date: Tue Sep 28 13:18:02 2010
New Revision: 289099

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=289099
Log:
Merged revisions 289095 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r289095 | bbryant | 2010-09-28 14:14:19 -0400 (Tue, 28 Sep 2010) | 21 lines
  
  Merged revisions 289094 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r289094 | bbryant | 2010-09-28 14:10:19 -0400 (Tue, 28 Sep 2010) | 14 lines
    
    Fixes an issue with the Newchannel AMI event during the Masquerading process.
    
    Fixes an issue with the Newchannel AMI event during the Masquerading process,
    where no Newchannel AMI event was generated for the psuedo channel used during
    the masquerading process.
    
    (closes issue #17987)
    Reported by: RadicAlish
    Patches: 
          newchannel.patch.txt uploaded by RadicAlish (license 1122)
          Tested by: RadicAlish
    
          Review: https://reviewboard.asterisk.org/r/937/
  ........
................

Modified:
    branches/1.8/   (props changed)
    branches/1.8/main/channel.c

Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.

Modified: branches/1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/channel.c?view=diff&rev=289099&r1=289098&r2=289099
==============================================================================
--- branches/1.8/main/channel.c (original)
+++ branches/1.8/main/channel.c Tue Sep 28 13:18:02 2010
@@ -1066,7 +1066,7 @@
 	int x;
 	int flags;
 	struct varshead *headp;
-	char *tech = "";
+	char *tech = "", *tech2 = NULL;
 
 	/* If shutting down, don't allocate any new channels */
 	if (shutting_down) {
@@ -1190,7 +1190,7 @@
 	}
 
 	if (!ast_strlen_zero(name_fmt)) {
-		char *slash;
+		char *slash, *slash2;
 		/* Almost every channel is calling this function, and setting the name via the ast_string_field_build() call.
 		 * And they all use slightly different formats for their name string.
 		 * This means, to set the name here, we have to accept variable args, and call the string_field_build from here.
@@ -1201,6 +1201,10 @@
 		ast_string_field_build_va(tmp, name, name_fmt, ap1, ap2);
 		tech = ast_strdupa(tmp->name);
 		if ((slash = strchr(tech, '/'))) {
+			if ((slash2 = strchr(slash + 1, '/'))) {
+				tech2 = slash + 1;
+				*slash2 = '\0';
+			}
 			*slash = '\0';
 		}
 	} else {
@@ -1261,7 +1265,7 @@
 	 * proper and correct place to make this call, but you sure do have to pass
 	 * a lot of data into this func to do it here!
 	 */
-	if (ast_get_channel_tech(tech)) {
+	if (ast_get_channel_tech(tech) || (tech2 && ast_get_channel_tech(tech2))) {
 		ast_manager_event(tmp, EVENT_FLAG_CALL, "Newchannel",
 			"Channel: %s\r\n"
 			"ChannelState: %d\r\n"




More information about the asterisk-commits mailing list