From abd41590d743c7e6bed27bee88f5a46b69190301 Mon Sep 17 00:00:00 2001 From: Sebastian Gutierrez Date: Sun, 6 Nov 2016 09:04:00 -0300 Subject: [PATCH] app_queue: new variable set when abandoned sets the variable ABANDONED to TRUE if the call was not answered. ASTERISK-26558 Change-Id: I4729af9bff4eba436d8a776afd3374065d0036d3 --- apps/app_queue.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index 4bbccc3469..4b05f3851b 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -258,7 +258,7 @@ ASTERISK_REGISTER_FILE() any of the join options cause the caller to not enter the queue. This application does not automatically answer and should be preceeded by an application such as Answer(), Progress(), or Ringing(). - This application sets the following channel variable upon completion: + This application sets the following channel variables upon completion: The status of the call as a text string. @@ -270,6 +270,10 @@ ASTERISK_REGISTER_FILE() + + If the call was not answered by an agent this variable will be TRUE. + + @@ -4619,6 +4623,8 @@ static void record_abandoned(struct queue_ent *qe) { RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref); + pbx_builtin_setvar_helper(qe->chan, "ABANDONED", "TRUE"); + set_queue_variables(qe->parent, qe->chan); ao2_lock(qe->parent); blob = ast_json_pack("{s: s, s: i, s: i, s: i}", @@ -7964,6 +7970,8 @@ static int queue_exec(struct ast_channel *chan, const char *data) /* Setup our queue entry */ qe.start = time(NULL); + pbx_builtin_setvar_helper(chan, "ABANDONED", NULL); + /* set the expire time based on the supplied timeout; */ if (!ast_strlen_zero(args.queuetimeoutstr)) { qe.expire = qe.start + atoi(args.queuetimeoutstr);