summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-08-08 10:39:55 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-08-08 10:39:55 -0500
commit11d1d51844618296719cd687daf43c579df9b30b (patch)
tree0b31d7d363a1f958f5ae481a38ff41aff208d411
parentb24854e16b4a4ae7197a16204a64fd3968bfb4b8 (diff)
parent9685a704a6d7a73cccd78f517b168d8a71d82e56 (diff)
Merge "res_pjsip_session: Release media resources on session end quicker." into 15
-rw-r--r--res/res_pjsip_session.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index bb349a4b6..31e20142d 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2396,6 +2396,15 @@ void ast_sip_session_terminate(struct ast_sip_session *session, int response)
response = 603;
}
+ /* The media sessions need to exist for the lifetime of the underlying channel
+ * to ensure that anything (such as bridge_native_rtp) has access to them as
+ * appropriate. Since ast_sip_session_terminate is called by chan_pjsip and other
+ * places when the session is to be terminated we terminate any existing
+ * media sessions here.
+ */
+ SWAP(session->active_media_state, session->pending_media_state);
+ ast_sip_session_media_state_reset(session->pending_media_state);
+
switch (session->inv_session->state) {
case PJSIP_INV_STATE_NULL:
if (!session->inv_session->invite_tsx) {