summaryrefslogtreecommitdiff
path: root/include/asterisk/res_pjsip_session.h
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2017-06-13 14:17:29 -0500
committerKevin Harwell <kharwell@digium.com>2017-06-13 14:28:21 -0500
commit9e53c30610945fa0c16e9954ccb549c70d74f923 (patch)
treedf8c48e08d55c593b315dd7f82e5a04d8eefd7d5 /include/asterisk/res_pjsip_session.h
parentabe1dd303909416a1b57747bdb162b82fb08f72b (diff)
res_pjsip_refer/session: Calls dropped during transfer
When doing an attended transfer it's possible for the transferer, after receiving an accepted response from Asterisk, to send a BYE to Asterisk, which can then be processed before Asterisk has time to start and/or complete the transfer process. This of course causes the transfer to not complete successfully, thus dropping the call. This patch makes it so any BYEs received from the transferer, after the REFER, that initiate a session end are deferred until the transfer is complete. This allows the channel that would have otherwise been hung up by Asterisk to remain available throughout the transfer process. ASTERISK-27053 #close Change-Id: I43586db79079457d92d71f1fd993be9a3b409d5a
Diffstat (limited to 'include/asterisk/res_pjsip_session.h')
-rw-r--r--include/asterisk/res_pjsip_session.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h
index 10e55f133..e2a90662e 100644
--- a/include/asterisk/res_pjsip_session.h
+++ b/include/asterisk/res_pjsip_session.h
@@ -155,6 +155,10 @@ struct ast_sip_session {
struct ast_sip_aor *aor;
/*! From header saved at invite creation */
pjsip_fromto_hdr *saved_from_hdr;
+ /*! Whether the end of the session should be deferred */
+ unsigned int defer_end:1;
+ /*! Session end (remote hangup) requested while termination deferred */
+ unsigned int ended_while_deferred:1;
};
typedef int (*ast_sip_session_request_creation_cb)(struct ast_sip_session *session, pjsip_tx_data *tdata);
@@ -484,6 +488,13 @@ int ast_sip_session_defer_termination(struct ast_sip_session *session);
void ast_sip_session_defer_termination_cancel(struct ast_sip_session *session);
/*!
+ * \brief End the session if it had been previously deferred
+ *
+ * \param session The session to end if it had been deferred
+ */
+void ast_sip_session_end_if_deferred(struct ast_sip_session *session);
+
+/*!
* \brief Register an SDP handler
*
* An SDP handler is responsible for parsing incoming SDP streams and ensuring that