diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index b462db1d65..6fcbb9db80 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -1352,6 +1352,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session, if (switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n", user, domain); + cause = SWITCH_CAUSE_SUBSCRIBER_ABSENT; goto done; } diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 72131eb97f..07e04c8b3e 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -244,9 +244,11 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ } } - switch_assert(*new_session != NULL); - - if (*new_session) { + if (!*new_session) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "outgoing method for endpoint: [%s] returned: [%s] but there is no new session!\n", + endpoint_name, switch_channel_cause2str(cause)); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } else { switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL; switch_event_t *event; switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);