提交 12aa84a8 authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Mike Jerris

FS-9654 additional changes

上级 d0da33c5
...@@ -752,7 +752,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se ...@@ -752,7 +752,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
int exists = 0; int exists = 0;
switch_media_handle_t *smh; switch_media_handle_t *smh;
switch_rtp_engine_t *engine; switch_rtp_engine_t *engine;
int local_pt = 0;
switch_assert(session); switch_assert(session);
...@@ -780,7 +779,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se ...@@ -780,7 +779,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) { if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) {
if (strcmp(pmap->rm_fmtp, fmtp)) { if (strcmp(pmap->rm_fmtp, fmtp)) {
exists = 0; exists = 0;
local_pt = pmap->pt;
continue; continue;
} }
} }
...@@ -795,7 +793,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se ...@@ -795,7 +793,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) { if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) {
if (strcmp(pmap->rm_fmtp, fmtp)) { if (strcmp(pmap->rm_fmtp, fmtp)) {
exists = 0; exists = 0;
local_pt = pmap->pt;
continue; continue;
} }
} }
...@@ -839,9 +836,11 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se ...@@ -839,9 +836,11 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
pmap->modname = switch_core_strdup(session->pool, modname); pmap->modname = switch_core_strdup(session->pool, modname);
} }
if (!zstr(fmtp) && (zstr(pmap->rm_fmtp) || strcmp(pmap->rm_fmtp, fmtp))) { if (!zstr(fmtp)) {
if (sdp_type == SDP_TYPE_REQUEST || !exists) {
pmap->rm_fmtp = switch_core_strdup(session->pool, fmtp); pmap->rm_fmtp = switch_core_strdup(session->pool, fmtp);
} }
}
pmap->allocated = 1; pmap->allocated = 1;
...@@ -849,7 +848,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se ...@@ -849,7 +848,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
if (sdp_type == SDP_TYPE_REQUEST || !exists) { if (sdp_type == SDP_TYPE_REQUEST || !exists) {
pmap->pt = (switch_payload_t) (local_pt ? local_pt : pt); pmap->pt = (switch_payload_t) pt;
} }
if (negotiated) { if (negotiated) {
...@@ -3775,7 +3774,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -3775,7 +3774,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
const char *tmp; const char *tmp;
int m_idx = 0, skip_rtcp = 0, skip_video_rtcp = 0, got_rtcp_mux = 0, got_video_rtcp_mux = 0; int m_idx = 0, skip_rtcp = 0, skip_video_rtcp = 0, got_rtcp_mux = 0, got_video_rtcp_mux = 0;
int nm_idx = 0; int nm_idx = 0;
int vmatch_pt = 0; int vmatch_pt = 1, consider_video_fmtp = 1;
int rtcp_auto_audio = 0, rtcp_auto_video = 0; int rtcp_auto_audio = 0, rtcp_auto_video = 0;
int got_audio_rtcp = 0, got_video_rtcp = 0; int got_audio_rtcp = 0, got_video_rtcp = 0;
switch_port_t audio_port = 0, video_port = 0; switch_port_t audio_port = 0, video_port = 0;
...@@ -4739,6 +4738,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -4739,6 +4738,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
const char *rm_encoding; const char *rm_encoding;
const switch_codec_implementation_t *mimp = NULL; const switch_codec_implementation_t *mimp = NULL;
int i; int i;
const char *inherit_video_fmtp = NULL;
vmatch = 0; vmatch = 0;
nm_idx = 0; nm_idx = 0;
...@@ -4905,23 +4905,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -4905,23 +4905,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
vmatch = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1; vmatch = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
} }
if (sdp_type == SDP_TYPE_RESPONSE && vmatch && map->rm_fmtp) { if (sdp_type == SDP_TYPE_RESPONSE && consider_video_fmtp && vmatch && !zstr(map->rm_fmtp) && !zstr(smh->fmtps[i])) {
int fmatch = 0; vmatch = !strcasecmp(smh->fmtps[i], map->rm_fmtp);
int fcount = 0;
payload_map_t *pmap;
for (pmap = v_engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) {
if (pmap->rm_fmtp) {
fcount++;
if ((fmatch = !strcasecmp(pmap->rm_fmtp, map->rm_fmtp))) {
break;
}
}
}
if (fcount && !fmatch) {
vmatch = 0;
}
} }
if (vmatch && vmatch_pt) { if (vmatch && vmatch_pt) {
...@@ -4931,6 +4916,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -4931,6 +4916,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
int opt = atoi(other_pt); int opt = atoi(other_pt);
if (map->rm_pt != opt) { if (map->rm_pt != opt) {
vmatch = 0; vmatch = 0;
} else {
if (switch_channel_var_true(channel, "inherit_video_fmtp")) {
inherit_video_fmtp = switch_channel_get_variable_partner(channel, "rtp_video_fmtp");
}
} }
} }
} }
...@@ -4949,7 +4938,14 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -4949,7 +4938,14 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
} }
} }
if (consider_video_fmtp && !m_idx) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No matches with FTMP, fallback to ignoring FMTP\n");
consider_video_fmtp = 0;
goto compare;
}
if (vmatch_pt && !m_idx) { if (vmatch_pt && !m_idx) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No matches with inherit_codec, fallback to ignoring PT\n");
vmatch_pt = 0; vmatch_pt = 0;
goto compare; goto compare;
} }
...@@ -5004,7 +5000,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -5004,7 +5000,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
pmap->remote_sdp_ip = switch_core_session_strdup(session, (char *) connection->c_address); pmap->remote_sdp_ip = switch_core_session_strdup(session, (char *) connection->c_address);
pmap->remote_sdp_port = (switch_port_t) m->m_port; pmap->remote_sdp_port = (switch_port_t) m->m_port;
pmap->rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp); pmap->rm_fmtp = switch_core_session_strdup(session, (char *) inherit_video_fmtp ? inherit_video_fmtp : map->rm_fmtp);
smh->negotiated_codecs[smh->num_negotiated_codecs++] = mimp; smh->negotiated_codecs[smh->num_negotiated_codecs++] = mimp;
#if 0 #if 0
...@@ -8101,7 +8097,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess ...@@ -8101,7 +8097,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
smh->ianacodes[i] = orig_pt; smh->ianacodes[i] = orig_pt;
if (orig_fmtp) { if (!zstr(orig_fmtp)) {
smh->fmtps[i] = switch_core_session_strdup(session, orig_fmtp); smh->fmtps[i] = switch_core_session_strdup(session, orig_fmtp);
} }
} else { } else {
......
...@@ -2090,6 +2090,11 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session ...@@ -2090,6 +2090,11 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
switch_channel_set_variable(bchannel, "park_after_bridge", "true"); switch_channel_set_variable(bchannel, "park_after_bridge", "true");
} }
if ((var = switch_channel_get_variable(channel, "intercept_pre_bond")) && switch_true(var)) {
switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, uuid);
switch_channel_set_variable_partner(channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session));
}
switch_channel_set_flag(rchannel, CF_INTERCEPTED); switch_channel_set_flag(rchannel, CF_INTERCEPTED);
switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid); switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
switch_core_session_rwunlock(rsession); switch_core_session_rwunlock(rsession);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论