From: Joshua Colp Date: Mon, 14 May 2007 18:34:06 +0000 (+0000) Subject: Only perform stripping of - strings from the channel name for Zap channels. Anywhere... X-Git-Tag: 1.2.19~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b1ad796331cb59b41af45a58095df5357a3d443;p=thirdparty%2Fasterisk.git 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@64275 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/devicestate.c b/devicestate.c index b197091521..71a1bae0d6 100644 --- a/devicestate.c +++ b/devicestate.c @@ -196,13 +196,17 @@ static void do_state_change(const char *device) 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));