func_odbc.c:515 acf_odbc_read: Unable to execute query

ma618
Joined: Mon 04 of Jul, 2011

func_odbc.c:515 acf_odbc_read: Unable to execute query

Posted:Mon 04 of Jul, 2011 (19:33 UTC)
I am getting following error message in dialplan.

ERROR[2050]:  func_odbc.c:515 acf_odbc_read: Unable to execute query [Select status from asterisk.ast_hotdesk where extension = '9999'


System configuration

Ubuntu server
asterisk 1.8.4.2
mysql Ver 14.14 Distrib 5.1.54 for debian-linux-gnu (i686)


/etc/odbc.ini
Driver = MySQL
Database = asterisk
Server = localhost
Username = apbx
Password = 123456
Port = 3306
Socket = /var/run/mysqld/mysqld.sock
;         /var/lib/mysql/mysql.sock is not working in my case

/etc/asterisk/res_odbc.conf
[ast]
enabled => yes
dsn => asterisk-connector
username => apbx
password =>  123456
pooling => no
limit => 5
pre-connect => yes

apbx has all the privileges and table ast_hotdesk is in database asterisk

echo "select status from asterisk.ast_hotdesk" | isql -v asterisk-connector
Connected!
sql-statement
help [tablename]
quit

SQL RowCount return 4
4 row fetched


It seems ODBC is working

/etc/asterisk/func_odbc.conf
[INFO]
prefix=HOTDESK
readsql=SELECT ${ARG1} from asterisk.ast_hotdesk where extension '${SQL_ESC(${ARG2})}'
-- OR -- I also tried
readsql=SELECT ${ARG1} from asterisk.ast_hotdesk where extension '${ARG2}'

/etc/asterisk/extension.conf
[hotdesk]
exten => _110[1-5],1,NoOp()
same => n,Set(E=${EXTEN})
same => n,Set(${E}_STATUS=${HOTDESK_INFO(status,${E})})	



I can see ODBC connection in Dial plan
odbc show

Name = ast
DSN = asterisk-connector
Pooled = No
Connected = yes



Thanks,