summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/app_queue.c10
-rw-r--r--res/res_pjsip_session.c15
2 files changed, 9 insertions, 16 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 5fe932486..c9f3aee63 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -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);
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 8b8e9d114..9e363a18f 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -61,7 +61,6 @@ static int handle_incoming(struct ast_sip_session *session, pjsip_rx_data *rdata
enum ast_sip_session_response_priority response_priority);
static void handle_outgoing_request(struct ast_sip_session *session, pjsip_tx_data *tdata);
static void handle_outgoing_response(struct ast_sip_session *session, pjsip_tx_data *tdata);
-static void handle_outgoing(struct ast_sip_session *session, pjsip_tx_data *tdata);
/*! \brief NAT hook for modifying outgoing messages with SDP */
static struct ast_sip_nat_hook *nat_hook;
@@ -2501,17 +2500,6 @@ static void handle_outgoing_response(struct ast_sip_session *session, pjsip_tx_d
}
}
-static void handle_outgoing(struct ast_sip_session *session, pjsip_tx_data *tdata)
-{
- ast_debug(3, "Sending %s\n", tdata->msg->type == PJSIP_REQUEST_MSG ?
- "request" : "response");
- if (tdata->msg->type == PJSIP_REQUEST_MSG) {
- handle_outgoing_request(session, tdata);
- } else {
- handle_outgoing_response(session, tdata);
- }
-}
-
static int session_end(void *vsession)
{
struct ast_sip_session *session = vsession;
@@ -2599,7 +2587,6 @@ static void session_inv_on_state_changed(pjsip_inv_session *inv, pjsip_event *e)
switch(type) {
case PJSIP_EVENT_TX_MSG:
- handle_outgoing(session, e->body.tx_msg.tdata);
break;
case PJSIP_EVENT_RX_MSG:
handle_incoming_before_media(inv, session, e->body.rx_msg.rdata);
@@ -2609,7 +2596,6 @@ static void session_inv_on_state_changed(pjsip_inv_session *inv, pjsip_event *e)
/* Transaction state changes are prompted by some other underlying event. */
switch(e->body.tsx_state.type) {
case PJSIP_EVENT_TX_MSG:
- handle_outgoing(session, e->body.tsx_state.src.tdata);
break;
case PJSIP_EVENT_RX_MSG:
handle_incoming_before_media(inv, session, e->body.tsx_state.src.rdata);
@@ -2670,7 +2656,6 @@ static void session_inv_on_tsx_state_changed(pjsip_inv_session *inv, pjsip_trans
}
switch (e->body.tsx_state.type) {
case PJSIP_EVENT_TX_MSG:
- handle_outgoing(session, e->body.tsx_state.src.tdata);
/* When we create an outgoing request, we do not have access to the transaction that
* is created. Instead, We have to place transaction-specific data in the tdata. Here,
* we transfer the data into the transaction. This way, when we receive a response, we