return (char *) custom_sql;
}
-static switch_bool_t lcr_execute_sql_callback(char *sql, switch_core_db_callback_func_t callback, void *pdata)
+static switch_status_t lcr_execute_sql_callback(char *sql, switch_core_db_callback_func_t callback, void *pdata)
{
- switch_bool_t retval = SWITCH_FALSE;
+ switch_status_t retval = SWITCH_STATUS_GENERR;
switch_cache_db_handle_t *dbh = NULL;
if (globals.odbc_dsn && (dbh = lcr_get_db_handle())) {
if (switch_cache_db_execute_sql_callback(dbh, sql, callback, pdata, NULL) != SWITCH_STATUS_SUCCESS) {
- retval = SWITCH_FALSE;
+ retval = SWITCH_STATUS_GENERR;
} else {
- retval = SWITCH_TRUE;
+ retval = SWITCH_STATUS_SUCCESS;
}
}
switch_cache_db_release_db_handle(&dbh);
char *digits_expanded = NULL;
char *lrn_digits_expanded = NULL;
profile_t *profile = cb_struct->profile;
- switch_bool_t lookup_status;
+ switch_status_t lookup_status;
switch_channel_t *channel;
char *id_str;
char *safe_sql = NULL;
switch_safe_free(sql_stream.data);
switch_core_hash_destroy(&cb_struct->dedup_hash);
- if (lookup_status) {
- return SWITCH_STATUS_SUCCESS;
- } else {
- return SWITCH_STATUS_GENERR;
- }
+ return lookup_status;
}
static switch_bool_t test_profile(char *lcr_profile)
if (db_check("ALTER TABLE carrier_gateway add codec varchar(255);") == SWITCH_TRUE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "adding codec field your lcr carrier_gateway database schema.\n");
} else {
- return SWITCH_FALSE;
+ return SWITCH_STATUS_FALSE;
}
}
if (db_check("ALTER TABLE lcr add cid varchar(32);") == SWITCH_TRUE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "adding cid field to your lcr database schema.\n");
} else {
- return SWITCH_FALSE;
+ return SWITCH_STATUS_FALSE;
}
}
if (db_check("ALTER TABLE lcr ADD lrn BOOLEAN NOT NULL DEFAULT false")) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "adding lrn field to your lcr database schema.\n");
} else {
- return SWITCH_FALSE;
+ return SWITCH_STATUS_FALSE;
}
}