SWITCH_DECLARE(switch_status_t) switch_core_media_get_vid_params(switch_core_session_t *session, switch_vid_params_t *vid_params);
SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_session_t *session, switch_file_handle_t *fh, switch_rw_t rw);
SWITCH_DECLARE(switch_bool_t) switch_core_session_in_video_thread(switch_core_session_t *session);
-SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t *session);
+SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t *session, switch_media_type_t type);
SWITCH_END_EXTERN_C
#endif
const char *uuid;
switch_core_session_t *other_session;
+ switch_core_media_check_dtls(channel->session, SWITCH_MEDIA_TYPE_AUDIO);
+
switch_channel_check_zrtp(channel);
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
return SWITCH_STATUS_SUCCESS;
}
+ switch_core_media_check_dtls(channel->session, SWITCH_MEDIA_TYPE_AUDIO);
+
if (channel->caller_profile && channel->caller_profile->times) {
switch_mutex_lock(channel->profile_mutex);
channel->caller_profile->times->answered = switch_micro_time_now();
mh->up = 1;
switch_mutex_lock(mh->cond_mutex);
+ switch_core_media_check_dtls(session, SWITCH_MEDIA_TYPE_VIDEO);
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Video thread started. Echo is %s\n",
switch_channel_get_name(session->channel), switch_channel_test_flag(channel, CF_VIDEO_ECHO) ? "on" : "off");
switch_core_session_request_video_refresh(session);
return 1;
}
-SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t *session)
+SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t *session, switch_media_type_t type)
{
switch_media_handle_t *smh;
- switch_rtp_engine_t *a_engine, *v_engine;
- int audio_checking = 0, video_checking = 0;
+ switch_rtp_engine_t *engine;
+ int checking = 0;
switch_assert(session);
return SWITCH_TRUE;
}
- a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
- v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
+ engine = &smh->engines[type];
do {
- if (a_engine->rtp_session) audio_checking = check_engine(a_engine);
- if (v_engine->rtp_session) check_engine(v_engine);
- } while (switch_channel_ready(session->channel) && (audio_checking || video_checking));
-
- if (!audio_checking && !video_checking) {
+ if (engine->rtp_session) checking = check_engine(engine);
+ } while (switch_channel_ready(session->channel) && checking);
+
+ if (!checking) {
return SWITCH_TRUE;
}
}
}
- if (state > CS_INIT && switch_channel_media_up(session->channel)) {
- switch_core_media_check_dtls(session);
- }
-
switch (state) {
case CS_NEW: /* Just created, Waiting for first instructions */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "(%s) State NEW\n", switch_channel_get_name(session->channel));