uint32_t codec_ms = (int) (engine->read_frame.timestamp -
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s). \n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[CBR]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s). \n", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
}
if (codec_ms > 120) { /* yeah right */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
- "[%s]: Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
+ "[CBR]: Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
"That seems hard to believe so I am going to go on ahead and um ignore that, mmkay?\n",
- is_vbr?"VBR":"CBR",
(int) codec_ms);
engine->check_frames = MAX_CODEC_CHECK_FRAMES;
goto skip;
if (codec_ms != engine->cur_payload_map->codec_ms) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
- "[%s]: Asynchronous PTIME not supported, changing our end from %d to %d\n",
- is_vbr?"VBR":"CBR",
+ "[CBR]: Asynchronous PTIME not supported, changing our end from %d to %d\n",
(int) engine->cur_payload_map->codec_ms,
(int) codec_ms
);
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s)\n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[VBR]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s)\n", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
}
if (codec_ms > 120) {
/*will show too many times with packet loss*/
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3,
- "[%s]: Remote party is trying to send timestamps that suggest an increment of [%d] ms per packet, which is too high. Ignoring.\n",
- is_vbr?"VBR":"CBR",
+ "[VBR]: Remote party is trying to send timestamps that suggest an increment of [%d] ms per packet, which is too high. Ignoring.\n",
(int) codec_ms);
engine->last_ts = engine->read_frame.timestamp;
engine->last_seq = engine->read_frame.seq;
if (codec_ms != engine->cur_payload_map->codec_ms) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
- "[%s]: Packet size change detected. Remote PTIME changed from [%d] to [%d]\n",
- is_vbr?"VBR":"CBR",
+ "[VBR]: Packet size change detected. Remote PTIME changed from [%d] to [%d]\n",
(int) engine->cur_payload_map->codec_ms,
(int) codec_ms
);
{
dtls_state_t s = DS_OFF;
+ if (!rtp_session) {
+ return s;
+ }
+
switch_mutex_lock(rtp_session->ice_mutex);
- if (!rtp_session || (!rtp_session->dtls && !rtp_session->rtcp_dtls)) {
+ if (!rtp_session->dtls && !rtp_session->rtcp_dtls) {
s = DS_OFF;
goto done;
}
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
+ if (!rtp_session) {
+ return SWITCH_STATUS_FALSE;
+ }
+
switch_mutex_lock(rtp_session->ice_mutex);
- if (!rtp_session || (!rtp_session->dtls && !rtp_session->rtcp_dtls)) {
+ if (!rtp_session->dtls && !rtp_session->rtcp_dtls) {
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
elapsed, rtp_session->media_timeout);
if (elapsed > rtp_session->media_timeout) {
-
- if (rtp_session->session) {
switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session);
switch_channel_execute_on(channel, "execute_on_media_timeout");
switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT);
- }
}
}