Odbc sip registration

hello all,

i have a little problem,

there is a asterisk 11 box with odbc mysql configuration, when i register sip account, asterisk shows odbc errors,

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

SQL Execute error -1! Verifying connection to asterisk

Connection is down attempting to reconnect

And recconect

Registration is successful but there are no fullcontact, useragent, ip addr in database.


Post any odbc related configuration file.

thanks for reply

there are config files


enabled => yes
dsn => asterisk
username => user
password => pass
pooling => no
pre-connect => yes


Driver = MySQL
Database = asterisk
Server = ip addr
User = user
Password = pass
Port = 3306
Socket = /var/lib/mysql/mysql.sock
Trace = On


Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1

and also there are mysql queries in func_odbc.conf

Post your func_odbc file.

for now, func_odbc.conf file looks like this , but asterisk still shows error


; ODBC_ANTIGF - A blacklist.
dsn=mysql1,mysql2 ; Use mysql1 as the primary handle, but fall back to mysql2
** ; if mysql1 is down. Supports up to 5 comma-separated**
** ; DSNs. “dsn” may also be specified as “readhandle” and**
** ; “writehandle”, if it is important to separate reads and**
** ; writes to different databases.**
readsql=SELECT COUNT(*) FROM exgirlfriends WHERE callerid=’${SQL_ESC(${ARG1})}'
synopsis=Check if a specified callerid is contained in the ex-gf database

; ODBC_PRESENCE - Retrieve and update presence
readsql=SELECT location FROM presence WHERE id=’${SQL_ESC(${ARG1})}'
writesql=UPDATE presence SET location=’${SQL_ESC(${VAL1})}’ WHERE id=’${SQL_ESC(${ARG1})}’