Revision
16464
Author
rupa
Date
2010-01-22 12:38:30 -0600 (Fri, 22 Jan 2010)

Log Message

do not allow vars in looked up CIDs

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c (16463 => 16464)


--- freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	2010-01-22 18:07:54 UTC (rev 16463)
+++ freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	2010-01-22 18:38:30 UTC (rev 16464)
@@ -696,6 +696,11 @@
 		cid = do_lookup(pool, event, number, skipurl, skipcitystate);
 	}
 	
+	if (switch_string_var_check_const(cid->name)) {
+		switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name);	
+		switch_goto_status(SWITCH_STATUS_GENERR, done);
+	}
+	
 	if (cid && channel) {
 		switch_channel_set_variable(channel, "original_caller_id_name", switch_core_strdup(pool, profile->caller_id_name));
 		if (!zstr(cid->src)) {
@@ -778,6 +783,11 @@
 
 		cid = do_lookup(pool, event, argv[0], skipurl, skipcitystate);
 		if (cid) {
+			if (switch_string_var_check_const(cid->name)) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid CID data {%s} contains a variable\n", cid->name);	
+				stream->write_function(stream, "-ERR Invalid CID data {%s} contains a variable\n", cid->name);
+				switch_goto_status(SWITCH_STATUS_SUCCESS, done);
+			}
 			stream->write_function(stream, cid->name);
 			if (verbose) {
 				stream->write_function(stream, " (%s) [%s]", cid->area, cid->src);