]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Ensure member is removed from pending when hanging up. 45/3745/1
authorJoshua Colp <jcolp@digium.com>
Thu, 25 Aug 2016 12:06:41 +0000 (12:06 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 27 Aug 2016 10:23:16 +0000 (10:23 +0000)
When dialing channels it is possible that they may not ever
leave the not in use state (Local channels in particular) by
the time we cancel them. If this occurs but we know they were
dialed we explicitly remove them from the pending members
container so that subsequent call attempts occur.

ASTERISK-26299 #close

Change-Id: I6ad0d17c36480c92cebf840626228ce3f7e4bd65

apps/app_queue.c

index 6ad65a2c40fcc0403ebd0037bd284fcdd2d13ad0..84564c55b7b5bf24f6810bb1a1fb1663f12eea35 100644 (file)
@@ -3482,6 +3482,16 @@ static void hangupcalls(struct callattempt *outgoing, struct ast_channel *except
                        if (exception || cancel_answered_elsewhere) {
                                ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
                        }
+                       /* When dialing channels it is possible that they may not ever
+                        * leave the not in use state (Local channels in particular) by
+                        * the time we cancel them. If this occurs but we know they were
+                        * dialed we explicitly remove them from the pending members
+                        * container so that subsequent call attempts occur.
+                        */
+                       if (outgoing->member->status == AST_DEVICE_NOT_INUSE) {
+                               pending_members_remove(outgoing->member);
+                       }
+
                        ast_hangup(outgoing->chan);
                }
                oo = outgoing;