summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-07-26 16:39:32 +0000
committerJoshua Colp <jcolp@digium.com>2017-08-05 06:44:27 -0500
commitabbd991e8a4c90d1e43e709f92ed96e461d2e286 (patch)
treea81c4967e9807d460a5350356b05fcdda8bf6c35 /res/res_pjsip_session.c
parentd740ece3593adf68211d1605910f659eed7df7e5 (diff)
res_pjsip_session: Release media resources on session end quicker.
A change was made long ago where the session was kept around until the underlying INVITE session had been destroyed. This had the side effect of also keeping the underlying media resources around for this time as well. This change ensures that when we know the session is ending we release the media resources immediately. ASTERISK-27110 Change-Id: I643e431d5c3bf05cda220c1d39e824a505a29b82
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index d91f6ff2b..2eb111ce8 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2554,6 +2554,11 @@ static int session_end(void *vsession)
iter->session_end(session);
}
}
+
+ /* Release any media resources. */
+ ao2_cleanup(session->media);
+ session->media = NULL;
+
return 0;
}