aboutsummaryrefslogtreecommitdiffstats
path: root/devicestate.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-14 18:34:06 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-14 18:34:06 +0000
commitd85c36c24d08bbfbd71ee941500c4798478277dc (patch)
treee21dcf76eebb7c3e4682324b88e08f5875d21037 /devicestate.c
parentb2d3754358cb34ec2254e219798d831a764ed760 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.2@64275 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'devicestate.c')
-rw-r--r--devicestate.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/devicestate.c b/devicestate.c
index b19709152..71a1bae0d 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));