FS-7509: stop media on verto detach
This commit is contained in:
parent
59fa1b9ac7
commit
4d100bc2e8
|
@ -319,6 +319,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_lock_unlock(switch_core_s
|
|||
#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
|
||||
|
|
|
@ -1210,7 +1210,7 @@ static void detach_calls(jsock_t *jsock)
|
|||
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch_core_session_stop_media(tech_pvt->session);
|
||||
tech_pvt->detach_time = switch_epoch_time_now(NULL);
|
||||
globals.detached++;
|
||||
attach_wake();
|
||||
|
|
|
@ -8995,6 +8995,36 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_codec_chosen(switch_core_sessi
|
|||
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)
|
||||
|
|
|
@ -2974,6 +2974,14 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_del_dtls(switch_rtp_t *rtp_session, d
|
|||
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) {
|
||||
|
@ -3941,6 +3949,11 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
|
|||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue