Created
September 22, 2008 21:17
-
-
Save eric/12162 to your computer and use it in GitHub Desktop.
Example tutorial for collecting DTMF keypad digits while using text-to-speech
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example tutorial for collecting DTMF keypad digits while using | |
# text-to-speech (TTS). Tested on Cloudvox via AGI (Asterisk's | |
# phone call API) and Adhearsion Ruby library. | |
default { | |
execute 'swift', "%p" % "Please enter a number and we will tell you what it is when we are done talking." | |
# See if our talking was interrupted by DTMF, and if so, grab the digit | |
nums = variable('SWIFT_DTMF') | |
if nums.nil? || nums.length < 1 | |
# This would generally be replaced with calling "input(1)" in Adhearsion | |
execute 'Read', 'userconfirm||1|skip|2|2' | |
nums = variable('userconfirm') | |
end | |
execute 'swift', '%p' % "You entered: #{nums}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment