From: Cao Minh Hiep Date: Thu, 6 Sep 2018 02:14:12 +0000 (+0900) Subject: app_queue: Fix Attended transfer hangup with removing pending member. X-Git-Tag: 15.7.0-rc1~22^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc842169d42cdbb4cd148985e90ed951fc592351;p=thirdparty%2Fasterisk.git app_queue: Fix Attended transfer hangup with removing pending member. This issue related to setting of holdtime, announcements, member delays. It works well if we set the member delays to "0" and no announcements and no holdtime.This issue will happen if we set member delays to "1", "2"... or announcements or holdtime and hangs up the call during processing it. And here is the reason: (At the step of answering a phone.) It takes care any holdtime, announcements, member delays, or other options after a call has been answered if it exists. Normally, After the call has been aswered, and we wait for the processing one of the cases of the member delays or hold time or announcements finished, "if (ast_check_hangup(peer))" will be not executed, then queue will be updated at update_queue(). Here, pending member will be removed. However, after the call has been aswered, if we hangs up the call during one of the cases of the member delays or hold time or announcements, "if (ast_check_hangup(peer))" will be executed. outgoing = NULL and at hangupcalls, pending members will not be removed. * This fixed patch will remove the pending member from container before hanging up the call with outgoing is NULL. ASTERISK-27920 Reported by: Cao Minh Hiep Tested by: Cao Minh Hiep Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 0c295a35b4..a94509e736 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -6890,6 +6890,7 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a ast_channel_publish_dial(qe->chan, peer, member->interface, ast_hangup_cause_to_dial_status(ast_channel_hangupcause(peer))); ast_autoservice_chan_hangup_peer(qe->chan, peer); + pending_members_remove(member); ao2_ref(member, -1); goto out; } else if (ast_check_hangup(qe->chan)) { @@ -6900,6 +6901,7 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a qe->handled = -1; ast_channel_publish_dial(qe->chan, peer, member->interface, ast_hangup_cause_to_dial_status(ast_channel_hangupcause(peer))); ast_autoservice_chan_hangup_peer(qe->chan, peer); + pending_members_remove(member); ao2_ref(member, -1); return -1; } @@ -6919,6 +6921,7 @@ static int try_calling(struct queue_ent *qe, struct ast_flags opts, char **opt_a record_abandoned(qe); ast_channel_publish_dial(qe->chan, peer, member->interface, ast_hangup_cause_to_dial_status(ast_channel_hangupcause(peer))); ast_autoservice_chan_hangup_peer(qe->chan, peer); + pending_members_remove(member); ao2_ref(member, -1); return -1; }