Skip to content

Instantly share code, notes, and snippets.

View radralph's full-sized avatar
😮

Ralph Sutacio radralph

😮
View GitHub Profile
say "Hi, this is a sample call from Globe Labs! Goodbye!"
hangup
ask "please choose from blue,yellow or green", {
:choices => "blue,yellow,green",
:recognizer => "en-PH",
:timeout => 20,
:bargein => false,
:mode => "speech",
:onChoice => lambda { |event| @answer = event.value},
:onBadChoice => lambda { |event| say "Sorry, we did not recognized your speech"},
:onTimeout => lambda { |event| say "Sorry, we did not receive your input"}}
def say_as(value,type)
ssml_start="<?xml version='1.0'?><speak>"
ssml_end="</say-as></speak>"
ssml ="<say-as interpret-as='vxml:#{type}'>#{value}"
complete_string = ssml_start + ssml + ssml_end
say complete_string
end
wait(1500)
say "Hi! how may we help you today?"
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
wait(1500)
say "This is a D T M F test"
ask "Please press a number between 1 and 4. Press pound when finished", {
:choices => "1,2,3,4",
:terminator => '#',
:timeout => 15.0,
:mode => "dtmf",
:interdigitTimeout => 5 ,
:onChoice => lambda { |event|
say "starting duration call"
wait(3600000)
say "Thank you and goodbye"
hangup
1.upto(1000) do |x|
say "hello there agent number " + x.to_s
end
hangup
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
say "starting 15 minute test"
wait(900000)
say "Thank you and goodbye"
hangup
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
say "starting 1 minute test"
wait(60000)
say "Thank you and goodbye"
hangup
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
wait(1500)
say "Please wait while we transfer your call. Press star to cancel the transfer."
transfer ["sip:9175744034@sip.tropo.net"], {
:callerID => 'sip:917111@sip.tropo.net',
:playvalue => "http://www.phono.com/audio/holdmusic.mp3",
:terminator => "*",
:onTimeout => lambda { |event|
say "Sorry, but nobody answered"}
}
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
wait(1500)
say "Please wait while we transfer your call. Press star to cancel the transfer."
transfer ["9175744034"], {
:callerID => 'sip:917111@sip.tropo.net',
:playvalue => "http://www.phono.com/audio/holdmusic.mp3",
:terminator => "*",
:onTimeout => lambda { |event|
say "Sorry, but nobody answered"}
}