Reputation: 69
I have updated from Asterisk 1.6 to Asterisk 11. I was using MySQL command in asterisk dialplan to access the database on Asterisk 1.6, but now this command seems to be not working. After going through some previous posts, I guess that MySQL command is not supported by Asterisk 11. Can someone please tell me what can be the alternative to MySQL and how can i configure such alternative?
Following is what I'm trying to do in dialplan:
exten => _xxxx,n,MYSQL(Connect connid localhost user pswd db)
exten => _xxxx,n(noerror),MYSQL(Query resultid ${connid} SELECT system FROM user_to_system WHERE callerID='${CID}')
exten => _xxxx,n(fetchrow),MYSQL(Fetch foundRow ${resultid} system)
exten => _xxxx,n,MYSQL(Clear ${resultid})
exten => _xxxx,n,MYSQL(Disconnect ${connid})
Upvotes: 1
Views: 2207
Reputation: 15259
Most likly that mean you have no app_mysql and res_mysql compiled.
For new dialplan recommend use res_odbc and func_odbc for database access. It will manage connections for you, just need put sql you want and use like usual dialplan function.
This page describe how to use func_odbc
http://www.voip-info.org/wiki/view/Asterisk+func+func_odbc
As other option you can use REALTIME function, but it more complex to use. Mysql realtime can be compiled, but not recommended for use becuase of mysql license issues(will be removed in future builds)
Upvotes: 3