[Freeswitch-trunk] [commit] r12395 - freeswitch/trunk/src/mod/applications/mod_dptools

FreeSWITCH SVN anthm at freeswitch.org
Tue Mar 3 12:55:39 PST 2009


Author: anthm
Date: Tue Mar  3 14:55:39 2009
New Revision: 12395

Log:
FSCORE-313

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Tue Mar  3 14:55:39 2009
@@ -2238,6 +2238,8 @@
 	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 @@
 			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;



More information about the Freeswitch-trunk mailing list