]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4654 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 26 Sep 2012 13:01:25 +0000 (08:01 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 26 Sep 2012 13:01:25 +0000 (08:01 -0500)
src/switch_console.c
src/switch_core_sqldb.c

index 3945baec7c17329771f76f58894b099482d7bb6a..d461333860e707092c47f6af8e9912acd4deefa4 100644 (file)
@@ -684,7 +684,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
 #endif
 #endif
 
-       if (switch_core_persist_db_handle(&db) != SWITCH_STATUS_SUCCESS) {
+       if (switch_core_db_handle(&db) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Database Error\n");
                return CC_ERROR;
        }
@@ -1776,7 +1776,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
                        SWITCH_STANDARD_STREAM(mystream);
 
 
-                       if (switch_core_persist_db_handle(&db) != SWITCH_STATUS_SUCCESS) {
+                       if (switch_core_db_handle(&db) != SWITCH_STATUS_SUCCESS) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Database Error\n");
                                free(mystream.data);
                                free(mydata);
index b0f52b6150c0d5c764a20c8e2ff50fec5acc7fbc..5a76d0e1aeb2c5b568d05597c7e7ac62bac9443d 100644 (file)
@@ -2409,9 +2409,14 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
                break;
        }
 
+       {
+               switch_cache_db_handle_t *db = NULL;
+               switch_core_persist_db_handle(&db)
+               switch_cache_db_test_reactive(db, "select hostname from aliases", "DROP TABLE aliases", create_alias_sql);
+               switch_cache_db_release_db_handle(&db);
+       }
 
        switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from complete", "DROP TABLE complete", create_complete_sql);
-       switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from aliases", "DROP TABLE aliases", create_alias_sql);
        switch_cache_db_test_reactive(sql_manager.dbh, "select hostname from nat", "DROP TABLE nat", create_nat_sql);
        switch_cache_db_test_reactive(sql_manager.dbh, "delete from registrations where reg_user='' or network_proto='tcp' or network_proto='tls'", 
                                                                  "DROP TABLE registrations", create_registrations_sql);