[asterisk-commits] file: branch 1.2 r64275 - /branches/1.2/devicestate.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 14 11:34:07 MST 2007


Author: file
Date: Mon May 14 13:34:06 2007
New Revision: 64275

URL: http://svn.digium.com/view/asterisk?view=rev&rev=64275
Log:
Only perform stripping of - strings from the channel name for Zap channels. Anywhere else we might remove a legitimate part of a device name. (issue #9668 reported by stevedavies)

Modified:
    branches/1.2/devicestate.c

Modified: branches/1.2/devicestate.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/devicestate.c?view=diff&rev=64275&r1=64274&r2=64275
==============================================================================
--- branches/1.2/devicestate.c (original)
+++ branches/1.2/devicestate.c Mon May 14 13:34:06 2007
@@ -196,13 +196,17 @@
 
 static int __ast_device_state_changed_literal(char *buf)
 {
-	char *device, *tmp;
+	char *device;
 	struct state_change *change = NULL;
 
 	device = buf;
-	tmp = strrchr(device, '-');
-	if (tmp)
-		*tmp = '\0';
+
+	if (!strncasecmp(device, "Zap", 3)) {
+		char *tmp = strrchr(device, '-');
+		if (tmp)
+			*tmp = '\0';
+	}
+
 	if (change_thread != AST_PTHREADT_NULL)
 		change = calloc(1, sizeof(*change) + strlen(device));
 



More information about the asterisk-commits mailing list