提交 b086e6e7 authored 作者: Leon de Rooij's avatar Leon de Rooij

that doesn't work

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15519 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 91573339
......@@ -167,7 +167,6 @@ SWITCH_STANDARD_APP(odbc_query_app_function)
char *expanded_query = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_memory_pool_t *pool = switch_core_session_get_pool(session);
char *errmsg;
if (!channel) {
return;
......@@ -191,10 +190,8 @@ SWITCH_STANDARD_APP(odbc_query_app_function)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Performing query: [%s]\n", expanded_query);
if (switch_odbc_handle_callback_exec(globals.odbc_handle, expanded_query, odbc_query_callback, channel, &errmsg) != SWITCH_ODBC_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL error [%s] while doing query: [%s]\n", switch_str_nil(errmsg), expanded_query);
switch_core_db_free(errmsg);
errmsg = NULL;
if (switch_odbc_handle_callback_exec(globals.odbc_handle, expanded_query, odbc_query_callback, channel, NULL) != SWITCH_ODBC_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL error while doing query: [%s]\n", expanded_query);
}
}
......
......@@ -232,7 +232,6 @@ static switch_status_t xml_odbc_do_query(xml_odbc_session_helper_t *helper)
char *value = (char *) switch_xml_attr_soft(helper->xml_in_cur, "value");
char *empty_result_break_to = (char *) switch_xml_attr_soft(helper->xml_in_cur, "on-empty-result-break-to");
char *new_value = switch_event_expand_headers_by_pool(helper->pool, helper->event, value);
char *errmsg;
switch_status_t status = SWITCH_STATUS_FALSE;
if (globals.debug == SWITCH_TRUE) {
......@@ -241,10 +240,8 @@ static switch_status_t xml_odbc_do_query(xml_odbc_session_helper_t *helper)
helper->rowcount = 0;
if (switch_odbc_handle_callback_exec(globals.master_odbc, new_value, xml_odbc_query_callback, helper, &errmsg) != SWITCH_ODBC_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL error [%s] while doing query [%s]\n", switch_str_nil(errmsg), new_value);
switch_core_db_free(errmsg);
errmsg = NULL;
if (switch_odbc_handle_callback_exec(globals.master_odbc, new_value, xml_odbc_query_callback, helper, NULL) != SWITCH_ODBC_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL error while doing query [%s]\n", new_value);
goto done;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论