From e7ee83ea9031c6a80da6f6838083b7608d32a828 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 10 Mar 2015 16:08:40 +0000 Subject: res_pjsip_refer: Fix occasional unexpected BYE sent after receiving a REFER. A race condition happened between initiating a transfer and requesting that a dialog termination be delayed. Occasionally, the transferrer channels would exit the bridge and hangup before the dialog termination delay was requested. * Made request dialog termination delay before initiating the transfer action. If the transfer fails then cancel the delayed dialog termination request. ASTERISK-24755 #close Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/4460/ ........ Merged revisions 432668 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432669 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/res_pjsip_session.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/asterisk/res_pjsip_session.h') diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h index 8efecb62b..728b2c33c 100644 --- a/include/asterisk/res_pjsip_session.h +++ b/include/asterisk/res_pjsip_session.h @@ -141,6 +141,8 @@ struct ast_sip_session { struct ast_dsp *dsp; /*! Whether the termination of the session should be deferred */ unsigned int defer_terminate:1; + /*! Termination requested while termination deferred */ + unsigned int terminate_while_deferred:1; /*! Deferred incoming re-invite */ pjsip_rx_data *deferred_reinvite; /*! Current T.38 state */ @@ -449,8 +451,18 @@ void ast_sip_session_terminate(struct ast_sip_session *session, int response); * \brief Defer local termination of a session until remote side terminates, or an amount of time passes * * \param session The session to defer termination on + * + * \retval 0 Success + * \retval -1 Failure + */ +int ast_sip_session_defer_termination(struct ast_sip_session *session); + +/*! + * \brief Cancel a pending deferred termination. + * + * \param session The session to cancel a deferred termination on. */ -void ast_sip_session_defer_termination(struct ast_sip_session *session); +void ast_sip_session_defer_termination_cancel(struct ast_sip_session *session); /*! * \brief Register an SDP handler -- cgit v1.2.3