switch_originate_flag_t myflags = SOF_NONE;
char *cid_name_override = NULL;
char *cid_num_override = NULL;
- char *domain = NULL;
+ char *domain = NULL, *dup_domain = NULL;
switch_channel_t *new_channel = NULL;
unsigned int timelimit = 60;
const char *skip, *var;
*domain++ = '\0';
} else {
domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
+ dup_domain = domain;
}
if (!domain) {
switch_safe_free(template);
switch_safe_free(group);
+ switch_safe_free(dup_domain);
if (cause == SWITCH_CAUSE_NONE) {
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
switch_call_cause_t *cancel_cause)
{
const char *profile;
+ char *dup_profile = NULL;
if (session) {
profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
} else {
- profile = switch_core_get_variable_pdup("sip_profile", switch_core_session_get_pool(session));
+ dup_profile = switch_core_get_variable_dup("sip_profile");
+ profile = dup_profile;
}
if (zstr(profile)) {
profile = "default";
UNPROTECT_INTERFACE(sip_endpoint_interface);
+ switch_safe_free(dup_profile);
+
return switch_core_session_outgoing_channel(session, var_event, "sofia", outbound_profile, new_session, pool, SOF_NONE, cancel_cause);
}