switch_sockaddr_get_port(rtp_session->rtp_from_addr));
if (channel) {
- switch_channel_set_variable(channel, "remote_media_ip_reported", switch_channel_get_variable(channel, "remote_media_ip"));
- switch_channel_set_variable(channel, "remote_media_ip", tx_host);
+ char varname[80] = "";
+
+ switch_snprintf(varname, sizeof(varname), "remote_%s_ip_reported", rtp_type(rtp_session));
+ switch_channel_set_variable(channel, varname, switch_channel_get_variable(channel, "remote_media_ip"));
+
+ switch_snprintf(varname, sizeof(varname), "remote_%s_ip", rtp_type(rtp_session));
+ switch_channel_set_variable(channel, varname, tx_host);
+
+ switch_snprintf(varname, sizeof(varname), "remote_%s_port_reported", rtp_type(rtp_session));
switch_snprintf(adj_port, sizeof(adj_port), "%u", switch_sockaddr_get_port(rtp_session->rtp_from_addr));
- switch_channel_set_variable(channel, "remote_media_port_reported", switch_channel_get_variable(channel, "remote_media_port"));
- switch_channel_set_variable(channel, "remote_media_port", adj_port);
- switch_channel_set_variable(channel, "rtp_auto_adjust", "true");
+ switch_channel_set_variable(channel, varname, switch_channel_get_variable(channel, "remote_media_port"));
+
+ switch_snprintf(varname, sizeof(varname), "remote_%s_port", rtp_type(rtp_session));
+ switch_channel_set_variable(channel, varname, adj_port);
+
+ switch_snprintf(varname, sizeof(varname), "rtp_auto_adjust_%s", rtp_type(rtp_session));
+ switch_channel_set_variable(channel, varname, "true");
}
rtp_session->auto_adj_used = 1;
switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->rtp_from_addr), 0, SWITCH_FALSE, &err);
if ((rtp_session->rtp_bugs & RTP_BUG_ALWAYS_AUTO_ADJUST)) {
switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
} else {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n");
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Correct %s ip/port confirmed.\n", rtp_type(rtp_session));
switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
}
rtp_session->auto_adj_used = 0;