troubleshooting Question

Asterisk IVR scripting to capture key presses

Avatar of pzabel
pzabel asked on
Voice Over IPIP Telephony
1 Comment1 Solution3080 ViewsLast Modified:
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()
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros