aboutsummaryrefslogtreecommitdiffstats
path: root/main/devicestate.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-14 18:36:34 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-14 18:36:34 +0000
commit4fc203012dabd6c90644e4879880d92ccd78fe26 (patch)
treefa853ecf60575fec3fc09f01d8a0f5e3b19e899e /main/devicestate.c
parent926ee43df73ed91e7f1448b207660de9473f5bba (diff)
Merged revisions 64275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r64275 | file | 2007-05-14 14:34:06 -0400 (Mon, 14 May 2007) | 2 lines 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.4@64276 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/devicestate.c')
-rw-r--r--main/devicestate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main/devicestate.c b/main/devicestate.c
index 3f38930d1..46db60d6d 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -296,18 +296,20 @@ 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;
if (option_debug > 2)
ast_log(LOG_DEBUG, "Notification of state change to be queued on device/channel %s\n", buf);
device = buf;
- if ((tmp = strrchr(device, '-')))
- *tmp = '\0';
+ if (!strncasecmp(device, "Zap", 3)) {
+ char *tmp = strrchr(device, '-');
+ if (tmp)
+ *tmp = '\0';
+ }
-
if (change_thread == AST_PTHREADT_NULL || !(change = ast_calloc(1, sizeof(*change) + strlen(device)))) {
/* we could not allocate a change struct, or */
/* there is no background thread, so process the change now */