MySQL Dialplan application

I have read that mySQL application is depreceated and is no longer supported. I had written this code using mySQL application
exten => s,2,MYSQL(Connect connid Server Username Password Database)
exten => s,3,MYSQL(Query resultid {connid} CALL spFindAgent({CallID}))
exten => s,4,MYSQL(Fetch fetchid ${resultid} AgentID AgentExtension IPAddress MessageToSend);

how do I do something similar with ODBC connectivity. Thanks

Using the ODBC dialplan function you can query your backend database. You essentially define your own dialplan function in the func_odbc.conf file. Then you can use it in the dialplan. For example (not tested):

exten => 100,1,NoOp()
same => n,Answer()
same => n,Verbose(presence=${ODBC_PRESENCE(${EXTEN})}) ; calls readsql defined under [PRESENCE]
same => n,Set(ODBC_PRESENCE(${EXTEN})=arrakis) ; calls writesql defined under [PRESENCE]
same => n,Hangup()

You can go on to define all your own custom queries. See the func_odbc sample config for more information, and more examples can be found here.