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;
}
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);
}
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);
}
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;