mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 10:22:46 +00:00
app_queue: Added reason pause of member
In app_queue added value Paused Reason on QueueMemberStatus when a member on queue is paused and the reason was set. ASTERISK-25480 #close Reporte by: Rodrigo Ramírez Norambuena Change-Id: Ia5db503482f50764c15e2020196c785f59d4a68e
This commit is contained in:
committed by
Joshua Colp
parent
937ba51659
commit
e13719bff1
5
CHANGES
5
CHANGES
@@ -41,6 +41,11 @@ Voicemail
|
|||||||
app_voicemail will be skipped. Use 'preload=app_voicemail.so' in
|
app_voicemail will be skipped. Use 'preload=app_voicemail.so' in
|
||||||
modules.conf to force app_voicemail to be the voicemail provider.
|
modules.conf to force app_voicemail to be the voicemail provider.
|
||||||
|
|
||||||
|
Queue
|
||||||
|
-------------------
|
||||||
|
* Added field ReasonPause on QueueMemberStatus if set when paused, the reason
|
||||||
|
the queue member was paused.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
--- Functionality changes from Asterisk 13.6.0 to Asterisk 13.7.0 ------------
|
--- Functionality changes from Asterisk 13.6.0 to Asterisk 13.7.0 ------------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
@@ -1002,6 +1002,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
<enum name="1"/>
|
<enum name="1"/>
|
||||||
</enumlist>
|
</enumlist>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
<parameter name="PausedReason">
|
||||||
|
<para>If set when paused, the reason the queue member was paused.</para>
|
||||||
|
</parameter>
|
||||||
<parameter name="Ringinuse">
|
<parameter name="Ringinuse">
|
||||||
<enumlist>
|
<enumlist>
|
||||||
<enum name="0"/>
|
<enum name="0"/>
|
||||||
@@ -1493,6 +1496,7 @@ struct member {
|
|||||||
int realtime; /*!< Is this member realtime? */
|
int realtime; /*!< Is this member realtime? */
|
||||||
int status; /*!< Status of queue member */
|
int status; /*!< Status of queue member */
|
||||||
int paused; /*!< Are we paused (not accepting calls)? */
|
int paused; /*!< Are we paused (not accepting calls)? */
|
||||||
|
char reason_paused[80]; /*!< Reason of paused if member is paused */
|
||||||
int queuepos; /*!< In what order (pertains to certain strategies) should this member be called? */
|
int queuepos; /*!< In what order (pertains to certain strategies) should this member be called? */
|
||||||
time_t lastcall; /*!< When last successful call was hungup */
|
time_t lastcall; /*!< When last successful call was hungup */
|
||||||
struct call_queue *lastqueue; /*!< Last queue we received a call */
|
struct call_queue *lastqueue; /*!< Last queue we received a call */
|
||||||
@@ -2155,7 +2159,7 @@ static void queue_publish_member_blob(struct stasis_message_type *type, struct a
|
|||||||
|
|
||||||
static struct ast_json *queue_member_blob_create(struct call_queue *q, struct member *mem)
|
static struct ast_json *queue_member_blob_create(struct call_queue *q, struct member *mem)
|
||||||
{
|
{
|
||||||
return ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: i, s: i, s: i, s: i, s: i, s: i}",
|
return ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: i, s: i, s: i, s: i, s: i, s: s, s: i}",
|
||||||
"Queue", q->name,
|
"Queue", q->name,
|
||||||
"MemberName", mem->membername,
|
"MemberName", mem->membername,
|
||||||
"Interface", mem->interface,
|
"Interface", mem->interface,
|
||||||
@@ -2166,6 +2170,7 @@ static struct ast_json *queue_member_blob_create(struct call_queue *q, struct me
|
|||||||
"LastCall", (int)mem->lastcall,
|
"LastCall", (int)mem->lastcall,
|
||||||
"Status", mem->status,
|
"Status", mem->status,
|
||||||
"Paused", mem->paused,
|
"Paused", mem->paused,
|
||||||
|
"PausedReason", mem->reason_paused,
|
||||||
"Ringinuse", mem->ringinuse);
|
"Ringinuse", mem->ringinuse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7055,6 +7060,14 @@ static void set_queue_member_pause(struct call_queue *q, struct member *mem, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
mem->paused = paused;
|
mem->paused = paused;
|
||||||
|
if (paused) {
|
||||||
|
if (!ast_strlen_zero(reason)) {
|
||||||
|
ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ast_copy_string(mem->reason_paused, "", sizeof(mem->reason_paused));
|
||||||
|
}
|
||||||
|
|
||||||
ast_devstate_changed(mem->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,
|
ast_devstate_changed(mem->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,
|
||||||
AST_DEVSTATE_CACHABLE, "Queue:%s_pause_%s", q->name, mem->interface);
|
AST_DEVSTATE_CACHABLE, "Queue:%s_pause_%s", q->name, mem->interface);
|
||||||
|
|
||||||
@@ -9513,10 +9526,11 @@ static int manager_queues_status(struct mansession *s, const struct message *m)
|
|||||||
"LastCall: %d\r\n"
|
"LastCall: %d\r\n"
|
||||||
"Status: %d\r\n"
|
"Status: %d\r\n"
|
||||||
"Paused: %d\r\n"
|
"Paused: %d\r\n"
|
||||||
|
"PausedReason: %s\r\n"
|
||||||
"%s"
|
"%s"
|
||||||
"\r\n",
|
"\r\n",
|
||||||
q->name, mem->membername, mem->interface, mem->state_interface, mem->dynamic ? "dynamic" : "static",
|
q->name, mem->membername, mem->interface, mem->state_interface, mem->dynamic ? "dynamic" : "static",
|
||||||
mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
|
mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, mem->reason_paused, idText);
|
||||||
++q_items;
|
++q_items;
|
||||||
}
|
}
|
||||||
ao2_ref(mem, -1);
|
ao2_ref(mem, -1);
|
||||||
@@ -9670,7 +9684,7 @@ static int manager_pause_queue_member(struct mansession *s, const struct message
|
|||||||
interface = astman_get_header(m, "Interface");
|
interface = astman_get_header(m, "Interface");
|
||||||
paused_s = astman_get_header(m, "Paused");
|
paused_s = astman_get_header(m, "Paused");
|
||||||
queuename = astman_get_header(m, "Queue"); /* Optional - if not supplied, pause the given Interface in all queues */
|
queuename = astman_get_header(m, "Queue"); /* Optional - if not supplied, pause the given Interface in all queues */
|
||||||
reason = astman_get_header(m, "Reason"); /* Optional - Only used for logging purposes */
|
reason = astman_get_header(m, "Reason"); /* Optional */
|
||||||
|
|
||||||
if (ast_strlen_zero(interface) || ast_strlen_zero(paused_s)) {
|
if (ast_strlen_zero(interface) || ast_strlen_zero(paused_s)) {
|
||||||
astman_send_error(s, m, "Need 'Interface' and 'Paused' parameters.");
|
astman_send_error(s, m, "Need 'Interface' and 'Paused' parameters.");
|
||||||
|
Reference in New Issue
Block a user