]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Dec 2007 13:48:20 +0000 (13:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 4 Dec 2007 13:48:20 +0000 (13:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6489 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index c766549391e3ff7f8709b609de6ed02295318386..e960207233078e7028d600206c243f333b05e7e4 100644 (file)
@@ -1452,6 +1452,8 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
        data = switch_core_session_strdup(nsession, outbound_profile->destination_number);
        profile_name = data;
 
+       nchannel = switch_core_session_get_channel(nsession);
+
        if (!strncasecmp(profile_name, "gateway", 7)) {
                char *gw;
                sofia_gateway_t *gateway_ptr = NULL;
@@ -1485,7 +1487,9 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                }
 
                profile = gateway_ptr->profile;
-
+               tech_pvt->gateway_name = switch_core_session_strdup(nsession, gateway_ptr->name);
+               switch_channel_set_variable(nchannel, "sip_gateway_name", gateway_ptr->name);
+               
                if (!switch_test_flag(gateway_ptr, REG_FLAG_CALLERID)) {
                        tech_pvt->gateway_from_str = switch_core_session_strdup(nsession, gateway_ptr->register_from);
                }
@@ -1559,7 +1563,7 @@ 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);
        }
index b3fb4261f7605638c119d555ef71a3f77e7138af..a19cc47707dce8db60b33602787809cb12e3dfe0 100644 (file)
@@ -318,6 +318,7 @@ struct private_object {
        char *call_id;
        char *invite_contact;
        char *local_url;
+       char *gateway_name;
        unsigned long rm_rate;
        switch_payload_t pt;
        switch_mutex_t *flag_mutex;
index ee740e74f7a035850cc35baf44e562fa4109d23f..80a146dfd80985c5a3543e3b958ab345ef545c59 100644 (file)
@@ -111,6 +111,9 @@ void sofia_event_callback(nua_event_t event,
                                        tech_pvt->call_id = switch_core_session_strdup(session, sip->sip_call_id->i_id);
                                        switch_channel_set_variable(channel, "sip_call_id", tech_pvt->call_id);
                                }
+                               if (tech_pvt->gateway_name) {
+                                       gateway = sofia_reg_find_gateway(tech_pvt->gateway_name);
+                               }
                        } else {
                                /* too late */
                                return;