MYSQL Application Not working on Asterisk 11

Hi,

I am new to Asterisk platform, have being using it for a couple of months, i tried to use MYSQL application on Asterisk 11 but i noticed the application is deprecated on make menuselect

xxx apps_mysql,

I tried to copy apps_mysql from previous add ons when i try to load it am getting an error

Anyway my purpose is to check whether dailed numbers are existing customers in the database and here is my extension.conf script.

exten => _128,1,Answer()
exten => _128,n, MYSQL(Connect connid localhost root ila@123 asterisk)
exten => _128,n,Read(number,/home/ilhdlwlc,10,3,10)
exten => _128,n, MYSQL(Query resultid ${connid} SELECT tel from users where ${number})
exten => _128,n, MYSQL(Fetch fetchid ${resultid} telephone)
exten => _128,n,GotoIf($["${fetchid}" = “0”]?surahnotfound)
exten => _128,n,Dial(SIP/dialogic/${telephone})
exten => _128,n(surahnotfound),Playback(/etc/asterisk/sounds/extra/you-dialed-wrong-number)
exten => _128,n,Hangup()

If apps_mysql application is deprecated is there any other methods to query the database.

In order to enable the deprecated app_mysql you need to install the dependencies, if I recall you just need the mysql-devel library, then re run the configure script then select the app via menuselect and compile asterisk.

If you dont want to recompile asterisk switch to an AGI script to do that.