[asterisk-users] Dynamic realtime + queues.conf Unresolved

2013-04-19 Thread Tommy Cooper
Hi,
 
I want queues.conf to be stored on a MySQL database using dynamic realtime. I 
am using asterisk 11.2.1 and MySQL 5.1.67, the MySQL database is hosted on 
another server but I can access the database via ODBC.
 
I have created the following tables:
 
SQL show tables;
+-+
| Tables_in_asterisk
  |
+-+
| QueueDialplanParameters   |
| Queues
 |
| queue_log 
    |
| queue_member_table   |
+-+
SQLRowCount returns 4
4 rows fetched

Each table has all of the required fields, some people suggested that 
queue_name is missing but it's not.

I am getting the following errors from the asterisk console:
 
node1*CLI queue show support 
support has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s 
talktime), W:0, C:0, A:0, SL:0.0% within 60s
   No Members
   No Callers
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:645 ast_odbc_prepare_and_execute: 
SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 
Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use near 
''\' AND queue_name = ? ORDER BY interface' at line 1 (226)
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:657 ast_odbc_prepare_and_execute: 
SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:761 ast_odbc_sanity_check: 
Connection is down attempting to reconnect...
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1527 odbc_obj_connect: Connecting 
asterisk
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1559 odbc_obj_connect: res_odbc: 
Connected to asterisk [asterisk-connector]
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:645 ast_odbc_prepare_and_execute: 
SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 
Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use near 
''\' AND queue_name = ? ORDER BY interface' at line 1 (226)
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:657 ast_odbc_prepare_and_execute: 
SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:761 ast_odbc_sanity_check: 
Connection is down attempting to reconnect...
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1527 odbc_obj_connect: Connecting 
asterisk
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1559 odbc_obj_connect: res_odbc: 
Connected to asterisk [asterisk-connector]
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:645 ast_odbc_prepare_and_execute: 
SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 
Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use near 
''\' AND queue_name = ? ORDER BY interface' at line 1 (226)
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:657 ast_odbc_prepare_and_execute: 
SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:761 ast_odbc_sanity_check: 
Connection is down attempting to reconnect...
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1527 odbc_obj_connect: Connecting 
asterisk
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1559 odbc_obj_connect: res_odbc: 
Connected to asterisk [asterisk-connector]
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:645 ast_odbc_prepare_and_execute: 
SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 
Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use near 
''\' AND queue_name = ? ORDER BY interface' at line 1 (226)
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:657 ast_odbc_prepare_and_execute: 
SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
[Apr 19 22:37:05] WARNING[18366]: res_odbc.c:761 ast_odbc_sanity_check: 
Connection is down attempting to reconnect...
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1527 odbc_obj_connect: Connecting 
asterisk
[Apr 19 22:37:05] NOTICE[18366]: res_odbc.c:1559 odbc_obj_connect: res_odbc: 
Connected to asterisk [asterisk-connector]

 
The following error suggests that my syntax is incorrect, that syntax seems to 
be part of an SQL query. I do not have any SQL queries anywhere within my 
configuration.
You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near ''\' AND queue_name 

Re: [asterisk-users] Dynamic realtime + queues.conf Unresolved

2013-04-19 Thread Nathan Anderson
On Friday, April 19, 2013 1:45 PM, Tommy Cooper wrote:

 The following error suggests that my syntax is incorrect, that syntax
 seems to be part of an SQL query. I do not have any SQL queries anywhere
 within my configuration.  

iODBC or unixODBC?

I'm sure that the query is being generated on-the-fly by res_config_odbc based 
on information it is being fed by app_queue; there is no .conf file that you 
can edit to see or modify the query.  If Asterisk is doing something wrong when 
generating this query, it'll most likely have to be addressed in source 
somewhere.  It would definitely be helpful to see what the *whole* query is 
that Asterisk is trying to execute.  Try to enable trace/logging for your ODBC 
driver.  If unixODBC, for example, add:

[ODBC]
Trace = Yes
TraceFile = /tmp/sql.log 

...to your odbcinst.ini file.  This will dump detailed diagnostic information 
to the TraceFile, including the actual queries (in full) that are being 
executed.

Just from what little we already know from the Asterisk logs, though, it 
*almost* looks like an escaping problem of some kind.  What do you have the 
'backslash_is_escape' option for your DSN set to in res_odbc.conf?  Maybe try 
setting it to the opposite of whatever it's configured for now.

--
Nathan Anderson
First Step Internet, LLC
nath...@fsr.com

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users