git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6489 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-12-04 13:48:20 +00:00
parent 194d086acc
commit 2cf93afc1b
3 changed files with 10 additions and 2 deletions

View 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,6 +1487,8 @@ 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);
}

View 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;

View 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;