On IVR option need to call mysql routine


I am new to FREEPBX and exploring advance functionality of IVR module. Can someone hele me if possible that I can call mysql routine results in IVR.

for example if customer select a choice then i should sent that as parameter to mysql routine and save the info in mysql database, this was possible in Avaya IVR. I need to check how we call mysql routine on selection of option. Please guide.