Author: mikej Date: Wed Oct 22 22:46:36 2008 New Revision: 10122 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Log: tweak Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Oct 22 22:46:36 2008 @@ -2114,11 +2114,6 @@ tech_pvt->dest_to = tech_pvt->dest; } - switch_channel_set_flag(nchannel, CF_OUTBOUND); - switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); - - sofia_glue_attach_private(nsession, profile, tech_pvt, dest); - if (tech_pvt->local_url) { switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url); if (profile->pres_type) { @@ -2130,7 +2125,12 @@ caller_profile = switch_caller_profile_clone(nsession, outbound_profile); caller_profile->destination_number = switch_core_strdup(caller_profile->pool, dest); switch_channel_set_caller_profile(nchannel, caller_profile); + switch_channel_set_flag(nchannel, CF_OUTBOUND); + switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION); + + sofia_glue_attach_private(nsession, profile, tech_pvt, dest); + if (switch_channel_get_state(nchannel) == CS_NEW) { switch_channel_set_state(nchannel, CS_INIT); }