[INFO]
prefix = USER
dsn = server
readsql = SELECT ${ARG1} FROM user WHERE phone=’${ARG2}’
And also my extensions.conf
[test]
exten => _Z.,1,NoOp()
same => n, Playback(/var/lib/asterisk/sounds/en/system-processing)
same => n,Set(__phone=${DID_INFO(phone,${EXTEN})})
same => n,Set(__mode=${DID_INFO(mode,${EXTEN})})
same => n,GotoIf($[${ODBCROWS} < 0]?cancel:modecheck)
same => n(modecheck),GotoIf($["${__mode}" = “DIRECT-DIALING”]?continue,directdialing,1:continue,pindialing,1)
same => n(cancel),Playback(/var/lib/asterisk/sounds/en/invalid-did-destination)
same => n,Hangup()
But I am getting this error in the console
[Aug 14 03:17:47] ERROR[3662][C-00003093]: pbx_functions.c:593 ast_func_read: Function USER_INFO not registered
[Aug 14 03:17:47] ERROR[3662][C-00003093]: pbx_functions.c:593 ast_func_read: Function USER_INFO not registered
[Aug 14 03:17:47] WARNING[3662][C-00003093]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘<’, expecting $end; Input:
< 0
^
You can verify if the custom function exist on your system core show functions like INFO If there is no match you will need to review the configuration files listed above
It returns 0 matching custom functions installed.I tried to check module show like func_odbc.so but it is not loaded, you think that could be the cause
In order you can use the odbc func you need to make sure the asterisk odbc connection is properly configured, also your system is complaining about the sql statement, at this point I just have 1 of 2 suggestion :
recopile asterisk and make sure odbc is sucessfully installed
check your existing configuration files and try to load the odbc modules