use the proper named constants for checking device state, and don't treat UNKNOWN...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Jun 2006 23:24:26 +0000 (23:24 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Jun 2006 23:24:26 +0000 (23:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34194 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 9dc2845..01db3d6 100644 (file)
@@ -2037,11 +2037,13 @@ static int is_our_turn(struct queue_ent *qe)
                                ast_log(LOG_DEBUG, "Even though there are %d available members, the strategy is ringall so only the head call is allowed in\n", avl);
                        avl = 1;
                } else {
-                       cur = qe->parent->members;
-                       while (cur) {
-                               if (cur->status == 1) 
+                       for (cur = qe->parent->members; cur; cur = cur->next) {
+                               switch (cur->status) {
+                               case AST_DEVICE_NOT_INUSE:
+                               case AST_DEVICE_UNKNOWN:
                                        avl++;
-                               cur = cur->next;
+                                       break;
+                               }
                        }
                }