app_queue: Deprecate the QueueMemberPause.Reason field
authorSean Bright <sean.bright@gmail.com>
Sat, 11 Jan 2020 13:29:46 +0000 (08:29 -0500)
committerSean Bright <sean.bright@gmail.com>
Sun, 12 Jan 2020 17:07:49 +0000 (11:07 -0600)
The QueueMemberPause AMI event includes two fields that return the
reason a member was paused.

* In release branches, deprecate Reason in favor of PausedReason.
* In master, remove the Reason field entirely.

ASTERISK-28349 #close
Reported by: Niksa Baldun

Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296

apps/app_queue.c
doc/UPGRADE-staging/app_queue_remove_reason.txt [new file with mode: 0644]

index a0cb1f7..8cb3e32 100644 (file)
                        <synopsis>Raised when a member is paused/unpaused in the queue.</synopsis>
                        <syntax>
                                <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter)" />
-                               <parameter name="Reason">
-                                       <para>The reason a member was paused.</para>
-                               </parameter>
                        </syntax>
                        <see-also>
                                <ref type="application">PauseQueueMember</ref>
@@ -7448,7 +7445,7 @@ static int change_priority_caller_on_queue(const char *queuename, const char *ca
 }
 
 
-static int publish_queue_member_pause(struct call_queue *q, struct member *member, const char *reason)
+static int publish_queue_member_pause(struct call_queue *q, struct member *member)
 {
        struct ast_json *json_blob = queue_member_blob_create(q, member);
 
@@ -7456,10 +7453,6 @@ static int publish_queue_member_pause(struct call_queue *q, struct member *membe
                return -1;
        }
 
-       if (!ast_strlen_zero(reason)) {
-               ast_json_object_set(json_blob, "Reason", ast_json_string_create(reason));
-       }
-
        queue_publish_member_blob(queue_member_pause_type(), json_blob);
 
        return 0;
@@ -7520,7 +7513,7 @@ static void set_queue_member_pause(struct call_queue *q, struct member *mem, con
        ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"),
                "%s", S_OR(reason, ""));
 
-       publish_queue_member_pause(q, mem, reason);
+       publish_queue_member_pause(q, mem);
 }
 
 static int set_member_paused(const char *queuename, const char *interface, const char *reason, int paused)
diff --git a/doc/UPGRADE-staging/app_queue_remove_reason.txt b/doc/UPGRADE-staging/app_queue_remove_reason.txt
new file mode 100644 (file)
index 0000000..e333e2c
--- /dev/null
@@ -0,0 +1,5 @@
+Subject: app_queue
+Master-Only: True
+
+The 'Reason' header in the QueueMemberPause AMI Event has been
+removed. The 'PausedReason' header should be used instead.