git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10081 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-10-20 15:10:46 +00:00
parent 264147a556
commit 65bba7db13
1 changed files with 10 additions and 8 deletions

View File

@ -834,12 +834,14 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt)
p++; p++;
} }
if (!(*rip && *rp)) {
if (switch_strlen_zero(tech_pvt->remote_sdp_audio_ip) || !tech_pvt->remote_sdp_audio_port) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid SDP\n");
tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(tech_pvt->session, rip); return SWITCH_STATUS_FALSE;
tech_pvt->remote_sdp_audio_port = (switch_port_t) atoi(rp);
} }
tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(tech_pvt->session, rip);
tech_pvt->remote_sdp_audio_port = (switch_port_t) atoi(rp);
if (*rvp) { if (*rvp) {
tech_pvt->remote_sdp_video_ip = switch_core_session_strdup(tech_pvt->session, rip); tech_pvt->remote_sdp_video_ip = switch_core_session_strdup(tech_pvt->session, rip);
tech_pvt->remote_sdp_video_port = (switch_port_t) atoi(rvp); tech_pvt->remote_sdp_video_port = (switch_port_t) atoi(rvp);
@ -870,11 +872,11 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt)
} }
} }
if (*rip && *rp && switch_rtp_ready(tech_pvt->rtp_session)) { if (switch_rtp_ready(tech_pvt->rtp_session)) {
char *remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session); char *remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session);
switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session), rpi = (switch_port_t) atoi(rp); switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
if (remote_host && remote_port && !strcmp(remote_host, rip) && remote_port == rpi) { if (remote_host && remote_port && !strcmp(remote_host, tech_pvt->remote_sdp_audio_ip) && remote_port == tech_pvt->remote_sdp_audio_port) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote address:port [%s:%d] has not changed.\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote address:port [%s:%d] has not changed.\n",
tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port); tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;