From 22d838b4f6264359e529ec9bafec3094ae537e5a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 21 Dec 2012 18:21:20 -0600 Subject: [PATCH] pass2 --- src/mod/endpoints/mod_sofia/mod_sofia.h | 2 +- src/mod/endpoints/mod_sofia/rtp.c | 2 +- src/mod/endpoints/mod_sofia/sofia.c | 46 +++++++-------- src/mod/endpoints/mod_sofia/sofia_glue.c | 68 +++++++++++------------ src/mod/endpoints/mod_sofia/sofia_media.c | 12 ++-- 5 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 0faf8ae914..03d10a8705 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -573,7 +573,7 @@ struct sofia_profile { switch_core_media_flag_t media_flags[SCMF_MAX]; unsigned int mflags; unsigned int ndlb; - unsigned int mndlb; + unsigned int mdlb; uint32_t max_calls; uint32_t nonce_ttl; nua_t *nua; diff --git a/src/mod/endpoints/mod_sofia/rtp.c b/src/mod/endpoints/mod_sofia/rtp.c index 1376b32b44..46c69df20d 100644 --- a/src/mod/endpoints/mod_sofia/rtp.c +++ b/src/mod/endpoints/mod_sofia/rtp.c @@ -200,7 +200,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi tech_pvt->local_address = switch_core_session_strdup(*new_session, local_addr); tech_pvt->local_port = local_port; tech_pvt->remote_address = switch_core_session_strdup(*new_session, remote_addr); - tech-pvt->mparams->remote_port = remote_port; + tech_pvt->remote_port = remote_port; tech_pvt->ptime = ptime; tech_pvt->agreed_pt = pt; tech_pvt->dtmf_type = DTMF_2833; /* XXX */ diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index ffb89fe020..ebd14049c0 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4861,9 +4861,9 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip); } - tech-pvt->mparams->last_sdp_str = NULL; + tech_pvt->last_sdp_str = NULL; if (!sofia_use_soa(tech_pvt) && sip->sip_payload && sip->sip_payload->pl_data) { - tech-pvt->mparams->last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data); + tech_pvt->last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data); } @@ -5200,8 +5200,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status if (sip->sip_payload && sip->sip_payload->pl_data && sip->sip_content_type && sip->sip_content_type->c_subtype && switch_stristr("sdp", sip->sip_content_type->c_subtype)) { - tech-pvt->mparams->remote_sdp_str = switch_core_session_strdup(tech_pvt->session, sip->sip_payload->pl_data); - r_sdp = tech-pvt->mparams->remote_sdp_str; + tech_pvt->remote_sdp_str = switch_core_session_strdup(tech_pvt->session, sip->sip_payload->pl_data); + r_sdp = tech_pvt->remote_sdp_str; sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL); } @@ -5543,8 +5543,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } } - if (status > 100 && status < 300 && tech_pvt && !sofia_use_soa(tech_pvt) && !r_sdp && tech-pvt->mparams->last_sdp_str) { - r_sdp = tech-pvt->mparams->last_sdp_str; + if (status > 100 && status < 300 && tech_pvt && !sofia_use_soa(tech_pvt) && !r_sdp && tech_pvt->last_sdp_str) { + r_sdp = tech_pvt->last_sdp_str; } if ((channel && (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA))) || @@ -5599,12 +5599,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (r_sdp) { - if (!(profile->mndlb & SM_NDLB_ALLOW_NONDUP_SDP) || (!zstr(tech-pvt->mparams->remote_sdp_str) && !strcmp(tech-pvt->mparams->remote_sdp_str, r_sdp))) { + if (!(profile->mndlb & SM_NDLB_ALLOW_NONDUP_SDP) || (!zstr(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp))) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp); is_dup_sdp = 1; } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp); - tech-pvt->mparams->remote_sdp_str = switch_core_session_strdup(session, r_sdp); + tech_pvt->remote_sdp_str = switch_core_session_strdup(session, r_sdp); switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp); if ((sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) { @@ -5909,7 +5909,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (sofia_use_soa(tech_pvt)) { nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->profile->url), - SOATAG_USER_SDP_STR(tech-pvt->mparams->local_sdp_str), + SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); @@ -5917,7 +5917,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, nua_respond(tech_pvt->nh, SIP_200_OK, NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTACT_STR(tech_pvt->profile->url), - SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech-pvt->mparams->local_sdp_str), TAG_END()); + SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); } } } else if (sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) { @@ -6025,7 +6025,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (sofia_use_soa(tech_pvt)) { nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SOATAG_USER_SDP_STR(tech-pvt->mparams->local_sdp_str), + SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); @@ -6033,7 +6033,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, nua_respond(tech_pvt->nh, SIP_200_OK, NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech-pvt->mparams->local_sdp_str), TAG_END()); + SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); } switch_channel_set_flag(channel, CF_PROXY_MODE); @@ -6150,7 +6150,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (sofia_use_soa(tech_pvt)) { nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SOATAG_USER_SDP_STR(tech-pvt->mparams->local_sdp_str), + SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END()); @@ -6158,7 +6158,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, nua_respond(tech_pvt->nh, SIP_200_OK, NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), - SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech-pvt->mparams->local_sdp_str), TAG_END()); + SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->local_sdp_str), TAG_END()); } if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REINVITE) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(session)); @@ -7805,8 +7805,8 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia - tech-pvt->mparams->remote_ip = switch_core_session_strdup(session, network_ip); - tech-pvt->mparams->remote_port = network_port; + tech_pvt->remote_ip = switch_core_session_strdup(session, network_ip); + tech_pvt->remote_port = network_port; channel = tech_pvt->channel = switch_core_session_get_channel(session); @@ -7827,7 +7827,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia if (sip->sip_contact && sip->sip_contact->m_url) { char tmp[35] = ""; - const char *ipv6 = strchr(tech-pvt->mparams->remote_ip, ':'); + const char *ipv6 = strchr(tech_pvt->remote_ip, ':'); transport = sofia_glue_url2transport(sip->sip_contact->m_url); @@ -7835,10 +7835,10 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_core_session_sprintf(session, "sip:%s@%s%s%s:%d;transport=%s", sip->sip_contact->m_url->url_user, - ipv6 ? "[" : "", tech-pvt->mparams->remote_ip, ipv6 ? "]" : "", tech-pvt->mparams->remote_port, sofia_glue_transport2str(transport)); + ipv6 ? "[" : "", tech_pvt->remote_ip, ipv6 ? "]" : "", tech_pvt->remote_port, sofia_glue_transport2str(transport)); - switch_channel_set_variable(channel, "sip_received_ip", tech-pvt->mparams->remote_ip); - snprintf(tmp, sizeof(tmp), "%d", tech-pvt->mparams->remote_port); + switch_channel_set_variable(channel, "sip_received_ip", tech_pvt->remote_ip); + snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_port); switch_channel_set_variable(channel, "sip_received_port", tmp); } @@ -8039,7 +8039,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia "sip:%s@%s%s%s:%d;transport=%s", user, ipv6 ? "[" : "", host, ipv6 ? "]" : "", port, sofia_glue_transport2str(transport)); - if (sofia_glue_check_nat(profile, tech-pvt->mparams->remote_ip)) { + if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) { url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url; check_nat = 1; } else { @@ -8079,7 +8079,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia } else { const char *url = NULL; - if (sofia_glue_check_nat(profile, tech-pvt->mparams->remote_ip)) { + if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) { url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url; } else { url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url; @@ -8101,7 +8101,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia } } - if (sofia_glue_check_nat(profile, tech-pvt->mparams->remote_ip)) { + if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) { tech_pvt->user_via = sofia_glue_create_external_via(session, profile, tech_pvt->transport); nua_set_hparams(tech_pvt->nh, SIPTAG_VIA_STR(tech_pvt->user_via), TAG_END()); } diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index c20194277d..767400f4d4 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -173,7 +173,7 @@ void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_optio switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "%s image media sdp:\n%s\n", - switch_channel_get_name(tech_pvt->channel), tech-pvt->mparams->local_sdp_str); + switch_channel_get_name(tech_pvt->channel), tech_pvt->local_sdp_str); } @@ -222,7 +222,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t * tech_pvt->profile = profile; - tech-pvt->mparams->rtpip = switch_core_session_strdup(session, profile->rtpip[profile->rtpip_next++]); + tech_pvt->rtpip = switch_core_session_strdup(session, profile->rtpip[profile->rtpip_next++]); if (profile->rtpip_next >= profile->rtpip_index) { profile->rtpip_next = 0; } @@ -769,7 +769,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) return status; } - if (!switch_channel_get_private(tech_pvt->channel, "t38_options") || zstr(tech-pvt->mparams->local_sdp_str)) { + if (!switch_channel_get_private(tech_pvt->channel, "t38_options") || zstr(tech_pvt->local_sdp_str)) { sofia_media_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); } @@ -816,7 +816,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) sipip = tech_pvt->profile->sipip; - if (!zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { sipip = tech_pvt->profile->extsipip; } @@ -856,7 +856,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTO_NAT)) { - if (!zstr(tech-pvt->mparams->remote_ip) && !zstr(tech_pvt->profile->extsipip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (!zstr(tech_pvt->remote_ip) && !zstr(tech_pvt->profile->extsipip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { rpid_domain = tech_pvt->profile->extsipip; } else { rpid_domain = tech_pvt->profile->sipip; @@ -890,7 +890,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } } - if (!zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { tech_pvt->user_via = sofia_glue_create_external_via(session, tech_pvt->profile, tech_pvt->transport); } @@ -905,7 +905,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) char *ip_addr = tech_pvt->profile->sipip; char *ipv6; - if ( !zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip ) ) { + if ( !zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip ) ) { ip_addr = tech_pvt->profile->extsipip; } @@ -922,7 +922,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (sofia_glue_transport_has_tls(tech_pvt->transport)) { tech_pvt->invite_contact = tech_pvt->profile->tls_url; } else { - if (!zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { tech_pvt->invite_contact = tech_pvt->profile->public_url; } else { tech_pvt->invite_contact = tech_pvt->profile->url; @@ -1231,7 +1231,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) tech_pvt->nh->nh_has_invite = 1; } - if ((mp = sofia_media_get_multipart(session, SOFIA_MULTIPART_PREFIX, tech-pvt->mparams->local_sdp_str, &mp_type))) { + if ((mp = sofia_media_get_multipart(session, SOFIA_MULTIPART_PREFIX, tech_pvt->local_sdp_str, &mp_type))) { sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); } @@ -1241,16 +1241,16 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) tech_pvt->session_refresher = nua_no_refresher; } - if (tech-pvt->mparams->local_sdp_str) { + if (tech_pvt->local_sdp_str) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, - "Local SDP:\n%s\n", tech-pvt->mparams->local_sdp_str); + "Local SDP:\n%s\n", tech_pvt->local_sdp_str); } if (sofia_use_soa(tech_pvt)) { nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), - //TAG_IF(zstr(tech-pvt->mparams->local_sdp_str), NUTAG_AUTOACK(0)), - //TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), NUTAG_AUTOACK(1)), + //TAG_IF(zstr(tech_pvt->local_sdp_str), NUTAG_AUTOACK(0)), + //TAG_IF(!zstr(tech_pvt->local_sdp_str), NUTAG_AUTOACK(1)), // The code above is breaking things...... grrr WE need this because we handle our own acks and there are 3pcc cases in there too NUTAG_AUTOACK(0), NUTAG_SESSION_TIMER(tech_pvt->session_timeout), @@ -1274,16 +1274,16 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(!zstr(route), SIPTAG_ROUTE_STR(route)), TAG_IF(tech_pvt->profile->minimum_session_expires, NUTAG_MIN_SE(tech_pvt->profile->minimum_session_expires)), TAG_IF(cseq, SIPTAG_CSEQ(cseq)), - TAG_IF(zstr(tech-pvt->mparams->local_sdp_str), SIPTAG_PAYLOAD_STR("")), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_USER_SDP_STR(tech-pvt->mparams->local_sdp_str)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_REUSE_REJECTED(1)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_ORDERED_USER(1)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL)), + TAG_IF(zstr(tech_pvt->local_sdp_str), SIPTAG_PAYLOAD_STR("")), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip)), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str)), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1)), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_ORDERED_USER(1)), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE)), + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL)), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_IF(!require_timer, NUTAG_TIMER_AUTOREQUIRE(0)), - TAG_IF(!zstr(tech-pvt->mparams->local_sdp_str), SOATAG_HOLD(holdstr)), TAG_END()); + TAG_IF(!zstr(tech_pvt->local_sdp_str), SOATAG_HOLD(holdstr)), TAG_END()); } else { nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), @@ -1312,7 +1312,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(cseq, SIPTAG_CSEQ(cseq)), NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTENT_TYPE_STR(mp_type ? mp_type : "application/sdp"), - SIPTAG_PAYLOAD_STR(mp ? mp : tech-pvt->mparams->local_sdp_str), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END()); + SIPTAG_PAYLOAD_STR(mp ? mp : tech_pvt->local_sdp_str), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END()); } sofia_glue_free_destination(dst); @@ -1334,7 +1334,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session) switch_mutex_lock(tech_pvt->sofia_mutex); caller_profile = switch_channel_get_caller_profile(channel); - if (!zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { sipip = tech_pvt->profile->extsipip; contact_url = tech_pvt->profile->public_url; } else { @@ -1357,7 +1357,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session) SIPTAG_CONTACT_STR(contact_url), TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip), - SOATAG_USER_SDP_STR(tech-pvt->mparams->local_sdp_str), + SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_END()); @@ -1430,11 +1430,11 @@ void sofia_glue_deactivate_rtp(private_object_t *tech_pvt) if (tech_pvt->video_rtp_session) { switch_rtp_destroy(&tech_pvt->video_rtp_session); } else if (tech_pvt->local_sdp_video_port) { - switch_rtp_release_port(tech-pvt->mparams->rtpip, tech_pvt->local_sdp_video_port); + switch_rtp_release_port(tech_pvt->rtpip, tech_pvt->local_sdp_video_port); } - if (tech_pvt->local_sdp_video_port > 0 && !zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (tech_pvt->local_sdp_video_port > 0 && !zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { switch_nat_del_mapping((switch_port_t) tech_pvt->local_sdp_video_port, SWITCH_NAT_UDP); switch_nat_del_mapping((switch_port_t) tech_pvt->local_sdp_video_port + 1, SWITCH_NAT_UDP); } @@ -1443,10 +1443,10 @@ void sofia_glue_deactivate_rtp(private_object_t *tech_pvt) if (tech_pvt->rtp_session) { switch_rtp_destroy(&tech_pvt->rtp_session); } else if (tech_pvt->local_sdp_audio_port) { - switch_rtp_release_port(tech-pvt->mparams->rtpip, tech_pvt->local_sdp_audio_port); + switch_rtp_release_port(tech_pvt->rtpip, tech_pvt->local_sdp_audio_port); } - if (tech_pvt->local_sdp_audio_port > 0 && !zstr(tech-pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech-pvt->mparams->remote_ip)) { + if (tech_pvt->local_sdp_audio_port > 0 && !zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) { switch_nat_del_mapping((switch_port_t) tech_pvt->local_sdp_audio_port, SWITCH_NAT_UDP); switch_nat_del_mapping((switch_port_t) tech_pvt->local_sdp_audio_port + 1, SWITCH_NAT_UDP); } @@ -1903,8 +1903,8 @@ int sofia_recover_callback(switch_core_session_t *session) switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); switch_mutex_init(&tech_pvt->sofia_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - tech-pvt->mparams->remote_ip = (char *) switch_channel_get_variable(channel, "sip_network_ip"); - tech-pvt->mparams->remote_port = atoi(switch_str_nil(switch_channel_get_variable(channel, "sip_network_port"))); + tech_pvt->remote_ip = (char *) switch_channel_get_variable(channel, "sip_network_ip"); + tech_pvt->remote_port = atoi(switch_str_nil(switch_channel_get_variable(channel, "sip_network_port"))); tech_pvt->caller_profile = switch_channel_get_caller_profile(channel); if ((tmp = switch_channel_get_variable(tech_pvt->channel, "sip_2833_send_payload"))) { @@ -1963,11 +1963,11 @@ int sofia_recover_callback(switch_core_session_t *session) switch_core_session_get_recovery_crypto_key(session, SWITCH_MEDIA_TYPE_VIDEO, "srtp_remote_video_crypto_key"); if ((tmp = switch_channel_get_variable(channel, "sip_local_sdp_str"))) { - tech-pvt->mparams->local_sdp_str = switch_core_session_strdup(session, tmp); + tech_pvt->local_sdp_str = switch_core_session_strdup(session, tmp); } if ((tmp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) { - tech-pvt->mparams->remote_sdp_str = switch_core_session_strdup(session, tmp); + tech_pvt->remote_sdp_str = switch_core_session_strdup(session, tmp); } switch_channel_set_variable(channel, "sip_invite_call_id", switch_channel_get_variable(channel, "sip_call_id")); @@ -2018,12 +2018,12 @@ int sofia_recover_callback(switch_core_session_t *session) switch_core_media_set_codec(tech_pvt->session, 1, tech_pvt->profile->codec_flags); - tech_pvt->adv_sdp_audio_ip = tech-pvt->mparams->extrtpip = (char *) ip; + tech_pvt->adv_sdp_audio_ip = tech_pvt->extrtpip = (char *) ip; tech_pvt->adv_sdp_audio_port = tech_pvt->local_sdp_audio_port = (switch_port_t)atoi(port); if (!zstr(ip)) { tech_pvt->local_sdp_audio_ip = switch_core_session_strdup(session, ip); - tech-pvt->mparams->rtpip = tech_pvt->local_sdp_audio_ip; + tech_pvt->rtpip = tech_pvt->local_sdp_audio_ip; } if (!zstr(a_ip)) { diff --git a/src/mod/endpoints/mod_sofia/sofia_media.c b/src/mod/endpoints/mod_sofia/sofia_media.c index 7fb6ada3d7..6b66806b80 100644 --- a/src/mod/endpoints/mod_sofia/sofia_media.c +++ b/src/mod/endpoints/mod_sofia/sofia_media.c @@ -521,14 +521,14 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt) char *new_sdp; int bad = 0; - if (zstr(tech-pvt->mparams->local_sdp_str)) { + if (zstr(tech_pvt->local_sdp_str)) { return; } - len = strlen(tech-pvt->mparams->local_sdp_str) * 2; + len = strlen(tech_pvt->local_sdp_str) * 2; if (switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) && - (switch_stristr("sendonly", tech-pvt->mparams->local_sdp_str) || switch_stristr("0.0.0.0", tech-pvt->mparams->local_sdp_str))) { + (switch_stristr("sendonly", tech_pvt->local_sdp_str) || switch_stristr("0.0.0.0", tech_pvt->local_sdp_str))) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n"); return; } @@ -548,7 +548,7 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt) switch_snprintf(port_buf, sizeof(port_buf), "%u", tech_pvt->adv_sdp_audio_port); - p = tech-pvt->mparams->local_sdp_str; + p = tech_pvt->local_sdp_str; q = new_sdp; pe = p + strlen(p); qe = q + len - 1; @@ -775,13 +775,13 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt) if (!has_ip && !has_audio) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "%s SDP has no audio in it.\n%s\n", - switch_channel_get_name(tech_pvt->channel), tech-pvt->mparams->local_sdp_str); + switch_channel_get_name(tech_pvt->channel), tech_pvt->local_sdp_str); return; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "%s Patched SDP\n---\n%s\n+++\n%s\n", - switch_channel_get_name(tech_pvt->channel), tech-pvt->mparams->local_sdp_str, new_sdp); + switch_channel_get_name(tech_pvt->channel), tech_pvt->local_sdp_str, new_sdp); sofia_media_tech_set_local_sdp(tech_pvt, new_sdp, SWITCH_FALSE);