How to save the selected keys during an IVR and send it by mail

Hello , I am pretty new to Asterisk.I just set up my IVR and I want to use it to make a voting system.
How? I want to receive a mail containing the DTMF key number a user selected.
For example if the user “user1” selected the key “2” I want to receive " The user user1 chose the candidate 2 ". OS= Ubuntu 16.04
How can i do it ?

You can use read() to save the dtmf key in a variable and system() to send ethe mail. also you can use background() and call the the system() app on each posible extension to be dialed

1 Like