]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make contact: match the to: in 200OK for the sake of interop
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 May 2007 21:44:35 +0000 (21:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 May 2007 21:44:35 +0000 (21:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5208 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c

index d1cb37d901b03656c3d8c72e31aeaec0b5237364..98271d3d95840c4ca59c1d942038bbb0f93b9e42 100644 (file)
@@ -317,7 +317,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                }
 
                nua_respond(tech_pvt->nh, SIP_200_OK,
-                                       SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+                                       SIPTAG_CONTACT_STR(tech_pvt->to_uri),
                                        SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
 
        }
@@ -680,7 +680,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        sofia_glue_set_local_sdp(tech_pvt, ip, atoi(port), msg->string_arg, 1);
                }
                nua_respond(tech_pvt->nh, SIP_200_OK,
-                                       SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+                                       SIPTAG_CONTACT_STR(tech_pvt->to_uri),
                                        SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
                switch_channel_mark_answered(channel);
        }
index 09c2c665ac3185931ec470691b26434511370f7c..b1b4521a996a222d108922922ea64d764cdda2d5 100644 (file)
@@ -1812,7 +1812,13 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        }
 
        if (sip->sip_to && sip->sip_to->a_url) {
+               char *val;
                url_set_chanvars(session, sip->sip_to->a_url, sip_to);
+               if ((val = switch_channel_get_variable(channel, "sip_to_uri"))) {
+                       tech_pvt->to_uri = switch_core_session_sprintf(session, "sip:%s", val);
+               } else {
+                       tech_pvt->to_uri = tech_pvt->profile->url;
+               }
        }
 
        if (sip->sip_contact && sip->sip_contact->m_url) {