]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add some vars
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 30 Nov 2007 21:02:41 +0000 (21:02 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 30 Nov 2007 21:02:41 +0000 (21:02 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6451 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h

index 28df47893cff23a95a934e3a2ec6250ced184719..c766549391e3ff7f8709b609de6ed02295318386 100644 (file)
@@ -1526,7 +1526,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                        *host++ = '\0';
                        if (sofia_reg_find_reg_url(profile, dest, host, buf, sizeof(buf))) {
                                tech_pvt->dest = switch_core_session_strdup(nsession, buf);
-
+                               tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, host);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, host);
                                cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
@@ -1539,7 +1539,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                        tech_pvt->e_dest = switch_core_session_strdup(nsession, dest);
                        if (sofia_reg_find_reg_url(profile, dest, profile_name, buf, sizeof(buf))) {
                                tech_pvt->dest = switch_core_session_strdup(nsession, buf);
-
+                               tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, profile_name);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, profile_name);
                                cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
@@ -1558,8 +1558,13 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
        }
 
        sofia_glue_attach_private(nsession, profile, tech_pvt, dest);
-
+       
        nchannel = switch_core_session_get_channel(nsession);
+       if (tech_pvt->local_url) {
+               switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url);
+       }
+       switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
+       
        caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
        switch_channel_set_caller_profile(nchannel, caller_profile);
        switch_channel_set_flag(nchannel, CF_OUTBOUND);
index 591d6d847758070d826f7f7b61dc64471f3daca1..7bb4942fe0a83838f51d880bcf0c85f3a63a9eeb 100644 (file)
@@ -317,6 +317,7 @@ struct private_object {
        char *e_dest;
        char *call_id;
        char *invite_contact;
+       char *local_url;
        unsigned long rm_rate;
        switch_payload_t pt;
        switch_mutex_t *flag_mutex;