I've been searching around but can't find a good example. I'm currently writing an IVR script in the dialplan to capture key presses. Can anyone provide a simple example of how I would capture key presses from the caller and store the digit string into a variable?
My current script is below...I am using the AGI function to call a C script that resides on my server which accepts a variable as an argument. Ideally, I would like the digits that our captured from the caller to be stored in this variable called 'optcode', which I can then pass that variable to my script when I call it with AGI. The script is pretty linear and simple right now, but I'm just trying to get the basics done first as I am pretty new to this. Thanks!
exten => s,1,Answer()
exten => s,2,Wait(2)
exten => s,3,BackGround(greeting)
exten => s,4,Wait(2)
------------CAPTURE KEY PRESS CODE WOULD GO HERE, STORE TO VARIABLE NAMED 'optcode'
exten => s,5,AGI(/home/scripts/data.out|optcode)
exten => s,6,Wait(2)
exten => s,7,Hangup()