]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: new variable set when abandoned 23/4323/4
authorSebastian Gutierrez <sgutierrez@integraccs.com>
Sun, 6 Nov 2016 12:04:00 +0000 (09:04 -0300)
committerSebastian Gutierrez <sgutierrez@integraccs.com>
Wed, 9 Nov 2016 00:42:24 +0000 (21:42 -0300)
sets the variable ABANDONED to TRUE if the call was not answered.

ASTERISK-26558

Change-Id: I4729af9bff4eba436d8a776afd3374065d0036d3

apps/app_queue.c

index 5fe9324866c80b5d27d8d2b833478b33cf1f2e76..c9f3aee636bac907ea8e9aba5f2b72e5c7780c9e 100644 (file)
@@ -259,7 +259,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                        any of the join options cause the caller to not enter the queue.</para>
                        <para>This application does not automatically answer and should be preceeded
                        by an application such as Answer(), Progress(), or Ringing().</para>
-                       <para>This application sets the following channel variable upon completion:</para>
+                       <para>This application sets the following channel variables upon completion:</para>
                        <variablelist>
                                <variable name="QUEUESTATUS">
                                        <para>The status of the call as a text string.</para>
@@ -271,6 +271,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                                        <value name="LEAVEUNAVAIL" />
                                        <value name="CONTINUE" />
                                </variable>
+                               <variable name="ABANDONED">
+                                       <para>If the call was not answered by an agent this variable will be TRUE.</para>
+                                       <value name="TRUE" />
+                               </variable>
                        </variablelist>
                </description>
                <see-also>
@@ -4594,6 +4598,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}",
@@ -7925,6 +7931,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);