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

FS-10088: [freeswitch-core] Backports #resolve

上级 70f4c411
差异被折叠。
......@@ -231,8 +231,8 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_MAX_TRANS 2000
#define SWITCH_CORE_SESSION_MAX_PRIVATES 2
#define SWITCH_DEFAULT_VIDEO_SIZE 1200
#define SWITCH_RTCP_AUDIO_INTERVAL_MSEC "5000"
#define SWITCH_RTCP_VIDEO_INTERVAL_MSEC "2000"
#define SWITCH_RTCP_AUDIO_INTERVAL_MSEC "1000"
#define SWITCH_RTCP_VIDEO_INTERVAL_MSEC "1000"
#define MAX_FMTP_LEN 256
......@@ -773,6 +773,7 @@ typedef enum {
SWITCH_RTP_FLAG_GEN_TS_DELTA,
SWITCH_RTP_FLAG_GEN_TS_MANUAL,
SWITCH_RTP_FLAG_DETECT_SSRC,
SWITCH_RTP_FLAG_OLD_FIR,
SWITCH_RTP_FLAG_INVALID
} switch_rtp_flag_t;
......
......@@ -3554,6 +3554,8 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
if (engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr && engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_port) {
char tmp[80] = "";
const char *media_varname = NULL, *port_varname = NULL;
engine->cur_payload_map->remote_sdp_ip = switch_core_session_strdup(smh->session, (char *) engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG,
"setting remote %s ice addr to index %d %s:%d based on candidate\n", type2str(type), engine->ice_in.chosen[0],
......@@ -3570,12 +3572,23 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
smh->mparams->remote_ip = engine->cur_payload_map->remote_sdp_ip;
}
if (engine->type == SWITCH_MEDIA_TYPE_VIDEO) {
media_varname = "remote_video_rtp_ip";
port_varname = "remote_video_rtp_port";
} else if (engine->type == SWITCH_MEDIA_TYPE_AUDIO) {
media_varname = "remote_audio_rtp_ip";
port_varname = "remote_audio_rtp_port";
}
switch_snprintf(tmp, sizeof(tmp), "%d", engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_port);
switch_channel_set_variable(smh->session->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr);
switch_channel_set_variable(smh->session->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
switch_channel_set_variable(smh->session->channel, media_varname, engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr);
switch_channel_set_variable(smh->session->channel, port_varname, tmp);
}
if (engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port) {
char tmp[80] = "";
const char *media_varname = NULL, *port_varname = NULL;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG,
"Setting remote rtcp %s addr to %s:%d based on candidate\n", type2str(type),
engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr, engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port);
......@@ -3583,6 +3596,20 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
engine->remote_rtcp_ice_addr = switch_core_session_strdup(smh->session, engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr);
engine->remote_rtcp_port = engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port;
if (engine->type == SWITCH_MEDIA_TYPE_VIDEO) {
media_varname = "remote_video_rtcp_ip";
port_varname = "remote_video_rtcp_port";
} else if (engine->type == SWITCH_MEDIA_TYPE_AUDIO) {
media_varname = "remote_audio_rtcp_ip";
port_varname = "remote_audio_rtcp_port";
}
switch_snprintf(tmp, sizeof(tmp), "%d", engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port);
switch_channel_set_variable(smh->session->channel, media_varname, engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr);
switch_channel_set_variable(smh->session->channel, port_varname, tmp);
}
......@@ -5093,7 +5120,33 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
done:
t38_done:
if (v_engine->rtp_session) {
if (v_engine->fir) {
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_FIR);
} else {
switch_rtp_clear_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_FIR);
}
if (v_engine->pli) {
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PLI);
} else {
switch_rtp_clear_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PLI);
}
if (v_engine->nack) {
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_NACK);
} else {
switch_rtp_clear_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_NACK);
}
if (v_engine->tmmbr) {
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_TMMBR);
} else {
switch_rtp_clear_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_TMMBR);
}
}
if (parser) {
sdp_parser_free(parser);
}
......@@ -7250,7 +7303,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if (v_engine->tmmbr) {
flags[SWITCH_RTP_FLAG_TMMBR]++;
}
v_engine->rtp_session = switch_rtp_new(a_engine->local_sdp_ip,
v_engine->local_sdp_port,
v_engine->cur_payload_map->remote_sdp_ip,
......
差异被折叠。
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论