From bb10e6391d425f43a95f87337c4f216e4af058be Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 3 Mar 2009 20:55:39 +0000 Subject: [PATCH] FSCORE-313 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12395 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_dptools/mod_dptools.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 1a1df50fcf..b81b961689 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -2238,6 +2238,8 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session, unsigned int timelimit = 60; switch_channel_t *new_channel = NULL; switch_event_t *params = NULL; + char stupid[128] = ""; + if (switch_strlen_zero(outbound_profile->destination_number)) { goto done; } @@ -2357,7 +2359,11 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session, myflags |= SOF_NOBLOCK; } - if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, + switch_snprintf(stupid, sizeof(stupid), "user/%s", user); + if (switch_stristr(stupid, d_dest)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Waddya Daft? You almost called '%s' in an infinate loop!\n", stupid); + cause = SWITCH_CAUSE_INVALID_IE_CONTENTS; + } else if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, cid_name_override, cid_num_override, NULL, var_event, myflags) == SWITCH_STATUS_SUCCESS) { const char *context; switch_caller_profile_t *cp;