]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Ensure member is removed from pending when hanging up. 15/4815/2
authorJoshua Colp <jcolp@digium.com>
Thu, 25 Aug 2016 12:06:41 +0000 (12:06 +0000)
committerGeorge Joseph <gjoseph@digium.com>
Sun, 29 Jan 2017 17:54:14 +0000 (11:54 -0600)
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
(cherry picked from commit f69f5cd3c43025180b61a20cc1aa906c9cf7f4f4)

apps/app_queue.c

index ef8b3bdb785afab6a5aa7e2ff15783dd85a762ab..0f7a9142d7b0c4bf30c9ef8dc8946fd2116bb3c3 100644 (file)
@@ -4071,6 +4071,17 @@ static void hangupcalls(struct queue_ent *qe, struct callattempt *outgoing, stru
                                ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
                        }
                        ast_channel_publish_dial(qe->chan, outgoing->chan, outgoing->interface, "CANCEL");
+
+                       /* 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;