#define switch_core_media_read_lock(_s, _t) switch_core_media_read_lock_unlock(_s, _t, SWITCH_TRUE)
#define switch_core_media_read_unlock(_s, _t) switch_core_media_read_lock_unlock(_s, _t, SWITCH_FALSE)
+SWITCH_DECLARE(void) switch_core_session_stop_media(switch_core_session_t *session);
SWITCH_END_EXTERN_C
#endif
return SWITCH_STATUS_FALSE;
}
+SWITCH_DECLARE(void) switch_core_session_stop_media(switch_core_session_t *session)
+{
+ switch_rtp_engine_t *a_engine, *v_engine;
+ switch_media_handle_t *smh;
+
+ switch_assert(session);
+
+ if (!(smh = session->media_handle)) {
+ return;
+ }
+
+ a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
+ v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
+
+ if (a_engine->rtp_session) {
+ switch_rtp_del_dtls(a_engine->rtp_session, DTLS_TYPE_RTP|DTLS_TYPE_RTCP);
+ switch_rtp_set_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE);
+ switch_rtp_set_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_MUTE);
+ }
+
+ if (v_engine->rtp_session) {
+ switch_rtp_del_dtls(v_engine->rtp_session, DTLS_TYPE_RTP|DTLS_TYPE_RTCP);
+ switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE);
+ switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_MUTE);
+ }
+
+
+}
+
+
//?
SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_t *session, switch_core_session_t *o_session)
stfu_n_reset(rtp_session->jb);
}
+ if (rtp_session->vb) {
+ switch_vb_reset(rtp_session->vb);
+ }
+
+ if (rtp_session->vbw) {
+ switch_vb_reset(rtp_session->vbw);
+ }
+
}
if ((type & DTLS_TYPE_RTCP) && rtp_session->rtcp_dtls) {
if (proto == IPR_RTP) {
ice = &rtp_session->ice;
+
+ rtp_session->flags[SWITCH_RTP_FLAG_PAUSE] = 0;
+ rtp_session->flags[SWITCH_RTP_FLAG_MUTE] = 0;
+
+ switch_core_session_video_reinit(rtp_session->session);
if (ice->ready) {
if (rtp_session->vb) {