cid_data_t *cidtmp = NULL;
switch_bool_t save_cache = SWITCH_FALSE;
- cid = switch_core_alloc(pool, sizeof(cid_data_t));
- switch_assert(cid);
-
number = string_digitsonly(pool, num);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "caller_id_number", number);
if (globals.odbc_dsn && globals.sql) {
name = do_db_lookup(pool, event, number, globals.sql);
if (name) {
+ cid = switch_core_alloc(pool, sizeof(cid_data_t));
+ switch_assert(cid);
cid->name = name;
cid->src = "phone_database";
goto done;
}
}
+ if (!cid) {
+ cid = switch_core_alloc(pool, sizeof(cid_data_t));
+ switch_assert(cid);
+ }
+
if (!skipurl && globals.url) {
url_query = switch_event_expand_headers(event, globals.url);
do_lookup_url(pool, event, &name, url_query, NULL, NULL, 0);
}
done:
- if (!cid) {
- cid = switch_core_alloc(pool, sizeof(cid_data_t));
- switch_assert(cid);
- }
/* append area if we can */
if (!cid->area && !skipcitystate && strlen(number) == 11 && number[0] == '1' && globals.odbc_dsn && globals.citystate_sql) {