aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-28 16:41:05 +0000
committerbweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-28 16:41:05 +0000
commitc632a3b255578f6ff6617fdd4e1aa55b0893c508 (patch)
tree567fd1ec9cb3f99a68768f7ba845f46b6cdff806 /apps/app_queue.c
parentc8a0b2cac69c8018b03645bf92f58b63fb6acb3e (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@43899 f38db490-d61c-443f-a65b-d21fe96a405b
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 87c04f7ee..74ee15b93 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -529,7 +529,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);
@@ -547,7 +554,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) {