Skip to content

Commit

Permalink
The ask method now supports playing back the Asterisk Sound files sto…
Browse files Browse the repository at this point in the history
…red on the Tropo Cloud, like the playback method.
  • Loading branch information
jsgoecke committed Oct 9, 2010
1 parent 5a17aa1 commit ea94c4d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/tropo-agitate.rb
Expand Up @@ -108,7 +108,16 @@ def answer
def ask(options={})
options[:args][:recognizer] = @tropo_agi_config['tropo']['recognizer'] if options[:args]['recognizer'].nil?
options[:args][:voice] = @tropo_agi_config['tropo']['voice'] if options[:args]['voice'].nil?
response = @current_call.ask options[:args]['prompt'], options[:args]

# Check for Asterisk sounds
asterisk_sound_url = fetch_asterisk_sound(options[:args]['prompt'])
if asterisk_sound_url
prompt = asterisk_sound_url
else
prompt = options[:args]['prompt']
end

response = @current_call.ask prompt, options[:args]
if response.value == 'NO_SPEECH' || response.value == 'NO_MATCH'
result = { :interpretation => response.value }
else
Expand Down

0 comments on commit ea94c4d

Please sign in to comment.