i have a running database connected to asterisk, the connection is there and i tested it with odbc show in the Asterisk CLI and echo “select 1” | isql -v asterisk-connector, and both show the database is connected. but here comes the problems when i try to read it from the database, this is the error i get:
Failed to execute query. [SELECT phone FROM caller_id WHERE store =‘3004’]
this is how i defined the odbc_fun, may be this is where i am have messed it up.
readsql=SELECT number FROM caller_id WHERE name =’${ARG1}’
and here is how i configured my extension.conf:
exten => _NXXXXXXXXX,1,Set(CALLERID(num)=ODBC_GET_CALLER_ID(${CALLERID(num):1:4}))
exten => _NXXXXXXXXX,n,Dial(SIP/Provider/${EXTEN})
if you guys can help i would really appreciate,thanks.