[asterisk-commits] dvossel: branch 1.8 r290376 - in /branches/1.8: ./ apps/app_directed_pickup.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 5 14:56:33 CDT 2010


Author: dvossel
Date: Tue Oct  5 14:56:29 2010
New Revision: 290376

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

........
  r290375 | dvossel | 2010-10-05 14:54:50 -0500 (Tue, 05 Oct 2010) | 10 lines
  
  Fixes PickupChan() not working with full channel name.
  
  (closes issue #18011)
  Reported by: schern
  Patches:
        app_directed_pickup.c.2.patch uploaded by schern (license 995)
        app_directed_pickup.c.trunk.patch uploaded by schern (license 995)
  Tested by: schern, dvossel
........

Modified:
    branches/1.8/   (props changed)
    branches/1.8/apps/app_directed_pickup.c

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

Modified: branches/1.8/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_directed_pickup.c?view=diff&rev=290376&r1=290375&r2=290376
==============================================================================
--- branches/1.8/apps/app_directed_pickup.c (original)
+++ branches/1.8/apps/app_directed_pickup.c Tue Oct  5 14:56:29 2010
@@ -179,18 +179,24 @@
 	char *chkchan;
 	struct pickup_by_name_args pickup_args;
 
-	pickup_args.len = strlen(channame) + 1;
-
-	chkchan = alloca(pickup_args.len + 1);
-
-	/* need to append a '-' for the comparison so we check full channel name,
-	 * i.e SIP/hgc- , use a temporary variable so original stays the same for
-	 * debugging.
+	/* Check if channel name contains a '-'.
+	 * In this case the channel name will be interpreted as full channel name.
 	 */
-	strcpy(chkchan, channame);
-	strcat(chkchan, "-");
-
-	pickup_args.name = chkchan;
+	if (strchr(channame, '-')) {
+		/* check full channel name */
+		pickup_args.len = strlen(channame);
+		pickup_args.name = channame;
+	} else {
+		/* need to append a '-' for the comparison so we check full channel name,
+		 * i.e SIP/hgc- , use a temporary variable so original stays the same for
+		 * debugging.
+		 */
+		pickup_args.len = strlen(channame) + 1;
+		chkchan = alloca(pickup_args.len + 1);
+		strcpy(chkchan, channame);
+		strcat(chkchan, "-");
+		pickup_args.name = chkchan;
+	}
 
 	return ast_channel_callback(pickup_by_name_cb, NULL, &pickup_args, 0);
 }




More information about the asterisk-commits mailing list