Survey in Asterisk

Hi , i m tryng to put a Survey in my Asterisk Dial Plan , is very simple , i just need something like .

If you are happy with the answer digit 1
If you are not happy with the answer digit 2

Then this put the Result in a Mysql DB , actually this work with this dialplan

exten => 1,1,Wait(1)
exten => 1,2,System(/etc/asterisk/survey.sh)
exten => 1,3,Playback(Thanks)
exten => 1,4,Hangup

survey.sh just put the result 1 or 2 in a Mysql DB , but i need to know how can i get the Sip Agent that is getting the call to put this in the DB too . I know that this is not the right method to do that … can somebody help me ?

Thanks
Roni
melhorempresadehospedagem.com

Hello.

You can set up an ODBC connection to the database from Asterisk and use ODBC functions in the dialplan to write (and read of course) to the database.

Check this document: asteriskdocs.org/en/3rd_Edit … _odbc.html

( I hope it’s better to read the 4th edition , I just haven’t found the link )

Key files to configure:
/etc/odbcinst.ini - system libraries
/etc/odbc.ini - creating an identifier which Asterisk will use
/etc/asterisk/res_odbc.conf - Asterisk ODBC connections

(There’s also an /etc/asterisk/extconfig.conf file, but I think you will not need it)

It’s really cool!