]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue is comparing the device names incorrectly while checking their statuses...
authorBJ Weschke <bweschke@btwtech.com>
Thu, 28 Sep 2006 16:37:15 +0000 (16:37 +0000)
committerBJ Weschke <bweschke@btwtech.com>
Thu, 28 Sep 2006 16:37:15 +0000 (16:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@43897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 5d46a8df10cb9c256e5d6b506cdded3468cb51ba..1a12bceebee76fa43b8e368a29d725e1be939c09 100644 (file)
@@ -483,7 +483,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);
@@ -501,7 +508,14 @@ static void *changethread(void *data)
        for (q = queues; q; q = q->next) {
                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) {