summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorBJ Weschke <bweschke@btwtech.com>2006-09-28 16:54:01 +0000
committerBJ Weschke <bweschke@btwtech.com>2006-09-28 16:54:01 +0000
commit9baf50ee9a55d0ff041911c66dce2a1a54f9ca02 (patch)
tree7309e552d09073c8f01e7948c932dc4d2e0f1a1c /apps/app_queue.c
parent8677abe99b50bd407f05ffc16bba2b93d3ac4f01 (diff)
Merged revisions 43899 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r43899 | bweschke | 2006-09-28 12:41:05 -0400 (Thu, 28 Sep 2006) | 11 lines Merged revisions 43897 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r43897 | bweschke | 2006-09-28 12:37:15 -0400 (Thu, 28 Sep 2006) | 3 lines app_queue is comparing the device names incorrectly while checking their statuses. It's internal list of interfaces includes the dial string, while the argument passed to this function does not have the dial string (/n for a local channel). This causes it to ignore the device state changes because it thinks it belongs to none of its members. (#8040 reported and patch by tim_ringenbach) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6539e2c72..70d272927 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -517,7 +517,14 @@ static void *changethread(void *data)
AST_LIST_LOCK(&interfaces);
AST_LIST_TRAVERSE(&interfaces, curint, list) {
- if (!strcasecmp(curint->interface, sc->dev))
+ char *interface;
+ char *slash_pos;
+ interface = ast_strdupa(curint->interface);
+ if ((slash_pos = strchr(interface, '/')))
+ if ((slash_pos = strchr(slash_pos + 1, '/')))
+ *slash_pos = '\0';
+
+ if (!strcasecmp(interface, sc->dev))
break;
}
AST_LIST_UNLOCK(&interfaces);
@@ -535,7 +542,14 @@ static void *changethread(void *data)
AST_LIST_TRAVERSE(&queues, q, list) {
ast_mutex_lock(&q->lock);
for (cur = q->members; cur; cur = cur->next) {
- if (strcasecmp(sc->dev, cur->interface))
+ char *interface;
+ char *slash_pos;
+ interface = ast_strdupa(cur->interface);
+ if ((slash_pos = strchr(interface, '/')))
+ if ((slash_pos = strchr(slash_pos + 1, '/')))
+ *slash_pos = '\0';
+
+ if (strcasecmp(sc->dev, interface))
continue;
if (cur->status != sc->state) {