summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2015-09-17 16:47:33 -0500
committerKevin Harwell <kharwell@digium.com>2015-09-17 16:58:15 -0500
commit729a4325da9a79086c8e8551b089b3e167df3172 (patch)
tree571149427103fd7ccd01ce1ab8d8445983d1ec21 /apps/app_queue.c
parente47396721f9c73b16ac7c7632dcd530f4e5b06c7 (diff)
app_queue: AgentComplete event has wrong reason
When a queued caller transfers an agent to another extension sometimes the raised AgentComplete event has a reason of "caller" and sometimes "transfer". Since a transfer has taken place this should always be transfer. This occurs because sometimes the stasis hangup event arrives before the transfer event thus writing a different reason out. With this patch, when a hangup event is received during a transfer it will check to see if the channel that is hanging up is part of a transfer. If so it will return and let the subsequently received transfer event handler take care of the cleanup. ASTERISK-25399 #close Change-Id: Ic63c49bd9a5ed463ea7a032fd2ea3d63bc81a50d
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index bb3ec1790..42b5e5876 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -6016,7 +6016,9 @@ static void handle_hangup(void *userdata, struct stasis_subscription *sub,
}
chan = ast_channel_get_by_name(channel_blob->snapshot->name);
- if (chan && ast_channel_has_role(chan, AST_TRANSFERER_ROLE_NAME)) {
+ if (chan && (ast_channel_has_role(chan, AST_TRANSFERER_ROLE_NAME) ||
+ !ast_strlen_zero(pbx_builtin_getvar_helper(chan, "ATTENDEDTRANSFER")) ||
+ !ast_strlen_zero(pbx_builtin_getvar_helper(chan, "BLINDTRANSFER")))) {
/* Channel that is hanging up is doing it as part of a transfer.
* We'll get a transfer event later
*/