[Freeswitch-svn] [commit] r12999 - freeswitch/trunk/src/mod/applications/mod_cidlookup

FreeSWITCH SVN rupa at freeswitch.org
Fri Apr 10 23:37:45 PDT 2009


Author: rupa
Date: Sat Apr 11 01:37:45 2009
New Revision: 12999

Log:
database takes precedence over memcache


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

Modified: freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	Sat Apr 11 01:37:45 2009
@@ -392,18 +392,21 @@
 	number = string_digitsonly(pool, num);
 	switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "caller_id_number", number);
 
-	if (globals.cache) {
-		name = check_cache(pool, number);
-	}
 #ifdef SWITCH_HAVE_ODBC
-	if (!name && globals.master_odbc && globals.sql) {
+	/* database always wins */
+	if (globals.master_odbc && globals.sql) {
 		name = do_db_lookup(pool, event, number);
 	}
 #endif
-	if (!skipurl && !name && globals.url) {
-		name = do_lookup_url(pool, event, number);
-		if (globals.cache && name) {
-			set_cache(pool, number, name);
+	if (!name && globals.url) {
+		if (globals.cache) {
+			name = check_cache(pool, number);
+		}
+		if (!skipurl && !name) {
+			name = do_lookup_url(pool, event, number);
+			if (globals.cache && name) {
+				set_cache(pool, number, name);
+			}
 		}
 	}
 	return name;



More information about the Freeswitch-svn mailing list