I have used ODBC successfully in the past, but now it is refusing to cooperate for some reason.
cdr_odbc.conf
[phonevm]
dsn => asterisk-connector
readsql=SELECT mailbox from extension where extension='${ARG1}'
odbc.ini
[asterisk-connector]
driver = MySQL
Database = dbname
Server = localhost
Socket = /var/lib/mysql/mysql.sock
User = dbuser
Password = dbpass
extensions.conf
exten => 2988,1,Set(CALLERID(num)=121)
exten => 2988,n,set(ODBC_phonevm(${CALLERID(num)})=vmnumber)
exten => 2988,n,noop(--${vmnumber}--)
ERROR
-- Executing [s@main-ivr:1] Answer("SIP/gw1-00000002", "") in new stack
-- Executing [s@main-ivr:2] Wait("SIP/gw1-00000002", "1") in new stack
-- Executing [s@main-ivr:3] Set("SIP/gw1-00000002", "closed=") in new stack
-- Executing [s@main-ivr:4] GotoIf("SIP/gw1-00000002", "0?closed-message,s,1") in new stack
-- Executing [s@main-ivr:5] BackGround("SIP/gw1-00000002", "en/custom/main_night") in new stack
-- <SIP/gw1-00000002> Playing 'en/custom/main_night.slin' (language 'en')
== CDR updated on SIP/gw1-00000002
-- Executing [2988@main-ivr:1] Set("SIP/gw1-00000002", "CALLERID(num)=121") in new stack
-- Executing [2988@main-ivr:2] Set("SIP/gw1-00000002", "ODBC_phonevm(121)=vmnumber") in new stack
[Oct 8 01:29:30] ERROR[28546]: pbx.c:3732 ast_func_write: Function ODBC_phonevm not registered
-- Executing [2988@main-ivr:3] NoOp("SIP/gw1-00000002", "----") in new stack
-- Auto fallthrough, channel 'SIP/gw1-00000002' status is 'UNKNOWN'
[Oct 8 01:29:30] ERROR[28546]: cdr_odbc.c:148 odbc_log: Unable to retrieve database handle. CDR failed.
Does anyone have any idea how to compel odbc to work as it should?
Thanks