cseq = sip_cseq_create(nh->nh_home, callsequence, SIP_METHOD_NOTIFY);
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
- from = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_to");
- to = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_from");
-
+ if (tech_pvt->sent_last_invite || !tech_pvt->recv_invites) {
+ from = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_from");
+ to = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_to");
+ } else {
+ from = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_to");
+ to = (char *)switch_channel_get_variable(tech_pvt->channel, "sip_full_from");
+ }
+
nua_info(nh,
TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)),
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
case nua_callstate_authenticating:
break;
case nua_callstate_calling:
+ tech_pvt->sent_last_invite = 1;
+ tech_pvt->sent_invites++;
break;
case nua_callstate_proceeding:
}
goto done;
case nua_callstate_received:
+ tech_pvt->recv_invites++;
+ tech_pvt->sent_last_invite = 0;
if (!sofia_test_flag(tech_pvt, TFLAG_SDP)) {
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
private_object_t *other_tech_pvt = switch_core_session_get_private(other_session);
switch_channel_get_name(tech_pvt->channel), switch_version_full_human(),
tech_pvt->mparams.local_sdp_str ? tech_pvt->mparams.local_sdp_str : "NO SDP PRESENT\n");
- tech_pvt->sent_invites++;
+
if (sofia_use_soa(tech_pvt)) {
nua_invite(tech_pvt->nh,