calls both ways still gotta push more into the core

This commit is contained in:
Anthony Minessale 2012-12-22 08:36:15 -06:00
parent 1f61ad76a4
commit faaf642d5c
3 changed files with 76 additions and 76 deletions

View File

@ -4847,9 +4847,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); caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip);
} }
tech_pvt->mparams->last_sdp_str = NULL; tech_pvt->mparams.last_sdp_str = NULL;
if (!sofia_use_soa(tech_pvt) && sip->sip_payload && sip->sip_payload->pl_data) { 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->mparams.last_sdp_str = switch_core_session_strdup(session, sip->sip_payload->pl_data);
} }
@ -5186,8 +5186,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if (sip->sip_payload && sip->sip_payload->pl_data && 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)) { 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); 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; r_sdp = tech_pvt->mparams.remote_sdp_str;
switch_core_media_proxy_remote_addr(session, NULL); switch_core_media_proxy_remote_addr(session, NULL);
} }
@ -5529,8 +5529,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) { 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; r_sdp = tech_pvt->mparams.last_sdp_str;
} }
if ((channel && (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA))) || if ((channel && (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA))) ||
@ -5585,12 +5585,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (r_sdp) { 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->mparams.remote_sdp_str) && !strcmp(tech_pvt->mparams.remote_sdp_str, r_sdp))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp);
is_dup_sdp = 1; is_dup_sdp = 1;
} else { } else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp); 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->mparams.remote_sdp_str = switch_core_session_strdup(session, r_sdp);
switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, 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)) { if ((sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) {
@ -5805,7 +5805,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
} else { } else {
uint8_t match = 0; uint8_t match = 0;
if (tech_pvt->mparams->num_codecs) { if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp); match = sofia_media_negotiate_sdp(session, r_sdp);
} }
@ -5895,7 +5895,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (sofia_use_soa(tech_pvt)) { if (sofia_use_soa(tech_pvt)) {
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->profile->url), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
SOATAG_USER_SDP_STR(tech_pvt->mparams->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
SOATAG_REUSE_REJECTED(1), SOATAG_REUSE_REJECTED(1),
SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), 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()); TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END());
@ -5903,7 +5903,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
NUTAG_MEDIA_ENABLE(0), NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTACT_STR(tech_pvt->profile->url), 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->mparams.local_sdp_str), TAG_END());
} }
} }
} else if (sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) { } else if (sofia_test_pflag(profile, PFLAG_3PCC_PROXY)) {
@ -6011,7 +6011,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (sofia_use_soa(tech_pvt)) { if (sofia_use_soa(tech_pvt)) {
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->mparams->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
SOATAG_REUSE_REJECTED(1), SOATAG_REUSE_REJECTED(1),
SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), 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()); TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END());
@ -6019,7 +6019,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
NUTAG_MEDIA_ENABLE(0), NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact), 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->mparams.local_sdp_str), TAG_END());
} }
switch_channel_set_flag(channel, CF_PROXY_MODE); switch_channel_set_flag(channel, CF_PROXY_MODE);
@ -6098,7 +6098,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE); switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
if (tech_pvt->mparams->num_codecs) { if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp); match = sofia_media_negotiate_sdp(session, r_sdp);
} }
@ -6136,7 +6136,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (sofia_use_soa(tech_pvt)) { if (sofia_use_soa(tech_pvt)) {
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->mparams->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
SOATAG_REUSE_REJECTED(1), SOATAG_REUSE_REJECTED(1),
SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), 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()); TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END());
@ -6144,7 +6144,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond(tech_pvt->nh, SIP_200_OK, nua_respond(tech_pvt->nh, SIP_200_OK,
NUTAG_MEDIA_ENABLE(0), NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact), 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->mparams.local_sdp_str), TAG_END());
} }
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REINVITE) == SWITCH_STATUS_SUCCESS) { 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)); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(session));
@ -6162,7 +6162,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_flag(tech_pvt->channel, CF_REINVITE); switch_channel_set_flag(tech_pvt->channel, CF_REINVITE);
if (tech_pvt->mparams->num_codecs) { if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp); match = sofia_media_negotiate_sdp(session, r_sdp);
} }
if (match) { if (match) {
@ -6222,7 +6222,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
uint8_t match = 0; uint8_t match = 0;
int is_ok = 1; int is_ok = 1;
if (tech_pvt->mparams->num_codecs) { if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp); match = sofia_media_negotiate_sdp(session, r_sdp);
} }
@ -6318,7 +6318,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
} else { } else {
uint8_t match = 0; uint8_t match = 0;
if (tech_pvt->mparams->num_codecs) { if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp); match = sofia_media_negotiate_sdp(session, r_sdp);
} }
@ -7791,8 +7791,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_ip = switch_core_session_strdup(session, network_ip);
tech_pvt->mparams->remote_port = network_port; tech_pvt->mparams.remote_port = network_port;
channel = tech_pvt->channel = switch_core_session_get_channel(session); channel = tech_pvt->channel = switch_core_session_get_channel(session);
@ -7813,7 +7813,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) { if (sip->sip_contact && sip->sip_contact->m_url) {
char tmp[35] = ""; char tmp[35] = "";
const char *ipv6 = strchr(tech_pvt->mparams->remote_ip, ':'); const char *ipv6 = strchr(tech_pvt->mparams.remote_ip, ':');
transport = sofia_glue_url2transport(sip->sip_contact->m_url); transport = sofia_glue_url2transport(sip->sip_contact->m_url);
@ -7821,10 +7821,10 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
switch_core_session_sprintf(session, switch_core_session_sprintf(session,
"sip:%s@%s%s%s:%d;transport=%s", "sip:%s@%s%s%s:%d;transport=%s",
sip->sip_contact->m_url->url_user, 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->mparams.remote_ip, ipv6 ? "]" : "", tech_pvt->mparams.remote_port, sofia_glue_transport2str(transport));
switch_channel_set_variable(channel, "sip_received_ip", tech_pvt->mparams->remote_ip); switch_channel_set_variable(channel, "sip_received_ip", tech_pvt->mparams.remote_ip);
snprintf(tmp, sizeof(tmp), "%d", tech_pvt->mparams->remote_port); snprintf(tmp, sizeof(tmp), "%d", tech_pvt->mparams.remote_port);
switch_channel_set_variable(channel, "sip_received_port", tmp); switch_channel_set_variable(channel, "sip_received_port", tmp);
} }
@ -8025,7 +8025,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
"sip:%s@%s%s%s:%d;transport=%s", "sip:%s@%s%s%s:%d;transport=%s",
user, ipv6 ? "[" : "", host, ipv6 ? "]" : "", port, sofia_glue_transport2str(transport)); 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->mparams.remote_ip)) {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url; url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
check_nat = 1; check_nat = 1;
} else { } else {
@ -8065,7 +8065,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
} else { } else {
const char *url = NULL; const char *url = NULL;
if (sofia_glue_check_nat(profile, tech_pvt->mparams->remote_ip)) { if (sofia_glue_check_nat(profile, tech_pvt->mparams.remote_ip)) {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url; url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
} else { } else {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url; url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
@ -8087,7 +8087,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->mparams.remote_ip)) {
tech_pvt->user_via = sofia_glue_create_external_via(session, profile, tech_pvt->transport); 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()); nua_set_hparams(tech_pvt->nh, SIPTAG_VIA_STR(tech_pvt->user_via), TAG_END());
} }

View File

@ -92,7 +92,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
tech_pvt->profile = profile; tech_pvt->profile = profile;
tech_pvt->mparams->rtpip = switch_core_session_strdup(session, profile->rtpip[profile->rtpip_next++]); tech_pvt->mparams.rtpip = switch_core_session_strdup(session, profile->rtpip[profile->rtpip_next++]);
if (profile->rtpip_next >= profile->rtpip_index) { if (profile->rtpip_next >= profile->rtpip_index) {
profile->rtpip_next = 0; profile->rtpip_next = 0;
} }
@ -104,7 +104,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
if (tech_pvt->bte) { if (tech_pvt->bte) {
tech_pvt->recv_te = tech_pvt->te = tech_pvt->bte; tech_pvt->recv_te = tech_pvt->te = tech_pvt->bte;
} else if (!tech_pvt->te) { } else if (!tech_pvt->te) {
tech_pvt->mparams->recv_te = tech_pvt->mparams->te = profile->te; tech_pvt->mparams.recv_te = tech_pvt->mparams.te = profile->te;
} }
tech_pvt->dtmf_type = tech_pvt->profile->dtmf_type; tech_pvt->dtmf_type = tech_pvt->profile->dtmf_type;
@ -140,25 +140,25 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
tech_pvt->mparams->ndlb = tech_pvt->profile->mndlb; tech_pvt->mparams.ndlb = tech_pvt->profile->mndlb;
tech_pvt->mparams->inbound_codec_string = profile->inbound_codec_string; tech_pvt->mparams.inbound_codec_string = profile->inbound_codec_string;
tech_pvt->mparams->outbound_codec_string = profile->outbound_codec_string; tech_pvt->mparams.outbound_codec_string = profile->outbound_codec_string;
tech_pvt->mparams->auto_rtp_bugs = profile->auto_rtp_bugs; tech_pvt->mparams.auto_rtp_bugs = profile->auto_rtp_bugs;
tech_pvt->mparams->timer_name = profile->timer_name; tech_pvt->mparams.timer_name = profile->timer_name;
tech_pvt->mparams->vflags = profile->vflags; tech_pvt->mparams.vflags = profile->vflags;
tech_pvt->mparams->manual_rtp_bugs = profile->manual_rtp_bugs; tech_pvt->mparams.manual_rtp_bugs = profile->manual_rtp_bugs;
tech_pvt->mparams->manual_video_rtp_bugs = profile->manual_video_rtp_bugs; tech_pvt->mparams.manual_video_rtp_bugs = profile->manual_video_rtp_bugs;
tech_pvt->mparams->extsipip = profile->extsipip; tech_pvt->mparams.extsipip = profile->extsipip;
tech_pvt->mparams->local_network = profile->local_network; tech_pvt->mparams.local_network = profile->local_network;
tech_pvt->mparams->mutex = tech_pvt->sofia_mutex; tech_pvt->mparams.mutex = tech_pvt->sofia_mutex;
tech_pvt->mparams->sipip = profile->sipip; tech_pvt->mparams.sipip = profile->sipip;
tech_pvt->mparams->jb_msec = profile->jb_msec; tech_pvt->mparams.jb_msec = profile->jb_msec;
tech_pvt->mparams->rtcp_audio_interval_msec = profile->rtcp_audio_interval_msec; tech_pvt->mparams.rtcp_audio_interval_msec = profile->rtcp_audio_interval_msec;
tech_pvt->mparams->rtcp_video_interval_msec = profile->rtcp_video_interval_msec; tech_pvt->mparams.rtcp_video_interval_msec = profile->rtcp_video_interval_msec;
tech_pvt->mparams->sdp_username = profile->sdp_username; tech_pvt->mparams.sdp_username = profile->sdp_username;
switch_media_handle_create(&tech_pvt->media_handle, session, tech_pvt->mparams); switch_media_handle_create(&tech_pvt->media_handle, session, &tech_pvt->mparams);
switch_media_handle_set_media_flags(tech_pvt->media_handle, tech_pvt->profile->media_flags); switch_media_handle_set_media_flags(tech_pvt->media_handle, tech_pvt->profile->media_flags);
@ -717,7 +717,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
return status; 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->mparams.local_sdp_str)) {
switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0); switch_core_media_gen_local_sdp(session, NULL, 0, NULL, 0);
} }
@ -764,7 +764,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
sipip = tech_pvt->profile->sipip; 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->mparams.remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip)) {
sipip = tech_pvt->profile->extsipip; sipip = tech_pvt->profile->extsipip;
} }
@ -804,7 +804,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
} }
if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTO_NAT)) { 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->mparams.remote_ip) && !zstr(tech_pvt->profile->extsipip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip)) {
rpid_domain = tech_pvt->profile->extsipip; rpid_domain = tech_pvt->profile->extsipip;
} else { } else {
rpid_domain = tech_pvt->profile->sipip; rpid_domain = tech_pvt->profile->sipip;
@ -838,7 +838,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->mparams.remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip)) {
tech_pvt->user_via = sofia_glue_create_external_via(session, tech_pvt->profile, tech_pvt->transport); tech_pvt->user_via = sofia_glue_create_external_via(session, tech_pvt->profile, tech_pvt->transport);
} }
@ -853,7 +853,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
char *ip_addr = tech_pvt->profile->sipip; char *ip_addr = tech_pvt->profile->sipip;
char *ipv6; 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->mparams.remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip ) ) {
ip_addr = tech_pvt->profile->extsipip; ip_addr = tech_pvt->profile->extsipip;
} }
@ -870,7 +870,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if (sofia_glue_transport_has_tls(tech_pvt->transport)) { if (sofia_glue_transport_has_tls(tech_pvt->transport)) {
tech_pvt->invite_contact = tech_pvt->profile->tls_url; tech_pvt->invite_contact = tech_pvt->profile->tls_url;
} else { } else {
if (!zstr(tech_pvt->mparams->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams->remote_ip)) { if (!zstr(tech_pvt->mparams.remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip)) {
tech_pvt->invite_contact = tech_pvt->profile->public_url; tech_pvt->invite_contact = tech_pvt->profile->public_url;
} else { } else {
tech_pvt->invite_contact = tech_pvt->profile->url; tech_pvt->invite_contact = tech_pvt->profile->url;
@ -1179,7 +1179,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
tech_pvt->nh->nh_has_invite = 1; 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->mparams.local_sdp_str, &mp_type))) {
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
} }
@ -1189,16 +1189,16 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
tech_pvt->session_refresher = nua_no_refresher; tech_pvt->session_refresher = nua_no_refresher;
} }
if (tech_pvt->mparams->local_sdp_str) { if (tech_pvt->mparams.local_sdp_str) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, 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->mparams.local_sdp_str);
} }
if (sofia_use_soa(tech_pvt)) { if (sofia_use_soa(tech_pvt)) {
nua_invite(tech_pvt->nh, nua_invite(tech_pvt->nh,
NUTAG_AUTOANSWER(0), 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(0)),
//TAG_IF(!zstr(tech_pvt->mparams->local_sdp_str), NUTAG_AUTOACK(1)), //TAG_IF(!zstr(tech_pvt->mparams.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 // 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_AUTOACK(0),
NUTAG_SESSION_TIMER(tech_pvt->session_timeout), NUTAG_SESSION_TIMER(tech_pvt->session_timeout),
@ -1222,16 +1222,16 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
TAG_IF(!zstr(route), SIPTAG_ROUTE_STR(route)), 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(tech_pvt->profile->minimum_session_expires, NUTAG_MIN_SE(tech_pvt->profile->minimum_session_expires)),
TAG_IF(cseq, SIPTAG_CSEQ(cseq)), 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), SIPTAG_PAYLOAD_STR("")),
TAG_IF(!zstr(tech_pvt->mparams->local_sdp_str), SOATAG_ADDRESS(tech_pvt->mparams->adv_sdp_audio_ip)), TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_ADDRESS(tech_pvt->mparams.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_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_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_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_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->mparams.local_sdp_str), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL)),
TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)),
TAG_IF(!require_timer, NUTAG_TIMER_AUTOREQUIRE(0)), 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->mparams.local_sdp_str), SOATAG_HOLD(holdstr)), TAG_END());
} else { } else {
nua_invite(tech_pvt->nh, nua_invite(tech_pvt->nh,
NUTAG_AUTOANSWER(0), NUTAG_AUTOANSWER(0),
@ -1260,7 +1260,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
TAG_IF(cseq, SIPTAG_CSEQ(cseq)), TAG_IF(cseq, SIPTAG_CSEQ(cseq)),
NUTAG_MEDIA_ENABLE(0), NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTENT_TYPE_STR(mp_type ? mp_type : "application/sdp"), 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->mparams.local_sdp_str), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END());
} }
sofia_glue_free_destination(dst); sofia_glue_free_destination(dst);
@ -1282,7 +1282,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
switch_mutex_lock(tech_pvt->sofia_mutex); switch_mutex_lock(tech_pvt->sofia_mutex);
caller_profile = switch_channel_get_caller_profile(channel); 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->mparams.remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->mparams.remote_ip)) {
sipip = tech_pvt->profile->extsipip; sipip = tech_pvt->profile->extsipip;
contact_url = tech_pvt->profile->public_url; contact_url = tech_pvt->profile->public_url;
} else { } else {
@ -1304,8 +1304,8 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
nua_invite(tech_pvt->nh2, nua_invite(tech_pvt->nh2,
SIPTAG_CONTACT_STR(contact_url), SIPTAG_CONTACT_STR(contact_url),
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
SOATAG_ADDRESS(tech_pvt->mparams->adv_sdp_audio_ip), SOATAG_ADDRESS(tech_pvt->mparams.adv_sdp_audio_ip),
SOATAG_USER_SDP_STR(tech_pvt->mparams->local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
SOATAG_REUSE_REJECTED(1), SOATAG_REUSE_REJECTED(1),
SOATAG_ORDERED_USER(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()); SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_END());
@ -1815,7 +1815,7 @@ 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->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)); 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_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->remote_port = atoi(switch_str_nil(switch_channel_get_variable(channel, "sip_network_port")));
tech_pvt->caller_profile = switch_channel_get_caller_profile(channel); tech_pvt->caller_profile = switch_channel_get_caller_profile(channel);
@ -1875,7 +1875,7 @@ 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"); 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"))) { 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->mparams.local_sdp_str = switch_core_session_strdup(session, tmp);
} }
if ((tmp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) { if ((tmp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) {
@ -1930,7 +1930,7 @@ int sofia_recover_callback(switch_core_session_t *session)
switch_core_media_set_codec(tech_pvt->session, 1, tech_pvt->profile->codec_flags); switch_core_media_set_codec(tech_pvt->session, 1, tech_pvt->profile->codec_flags);
tech_pvt->mparams->adv_sdp_audio_ip = tech_pvt->extrtpip = (char *) ip; tech_pvt->mparams.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); tech_pvt->adv_sdp_audio_port = tech_pvt->local_sdp_audio_port = (switch_port_t)atoi(port);
if (!zstr(ip)) { if (!zstr(ip)) {
@ -1939,7 +1939,7 @@ int sofia_recover_callback(switch_core_session_t *session)
} }
if (!zstr(a_ip)) { if (!zstr(a_ip)) {
tech_pvt->mparams->adv_sdp_audio_ip = switch_core_session_strdup(session, a_ip); tech_pvt->mparams.adv_sdp_audio_ip = switch_core_session_strdup(session, a_ip);
} }
if (r_ip && r_port) { if (r_ip && r_port) {

View File

@ -123,8 +123,8 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt)
switch_mutex_unlock(tech_pvt->sofia_mutex); switch_mutex_unlock(tech_pvt->sofia_mutex);
///HACK REMOVE ME ///HACK REMOVE ME
tech_pvt->rtp_session = tech_pvt->mparams->rtp_session; tech_pvt->rtp_session = tech_pvt->mparams.rtp_session;
tech_pvt->video_rtp_session = tech_pvt->mparams->video_rtp_session; tech_pvt->video_rtp_session = tech_pvt->mparams.video_rtp_session;
if (status == SWITCH_STATUS_SUCCESS) { if (status == SWITCH_STATUS_SUCCESS) {
sofia_set_flag(tech_pvt, TFLAG_RTP); sofia_set_flag(tech_pvt, TFLAG_RTP);