Skip to content

Instantly share code, notes, and snippets.

View radralph's full-sized avatar
😮

Ralph Sutacio radralph

😮
View GitHub Profile
@radralph
radralph / mAds1.rb
Last active August 29, 2015 13:56
mADs call out script
require 'net/http'
call $caller, { :callerID => 'sip:21581082@sip.tropo.net'}
say "http://auto-sms.herokuapp.com/call2.mp3"
hangup
require 'net/http'
numbers = ["9164948855","9175744034"]
numbers.each do |n|
call n, { :callerID => 'sip:21581036@sip.tropo.net'}
say "http://guess-demo.herokuapp.com/call2.mp3"
end
require 'net/http'
#numbers = [""]
#numbers.each do |n|
call "9066490454", { :callerID => 'sip:21581039@sip.tropo.net'}
say "http://auto-sms.herokuapp.com/call2.mp3"
#end
call "9175744034", { :callerID => 'sip:21581095@sip.tropo.net'}
say "this is a sample call"
hangup
require 'net/http'
require 'open-uri'
say "hello, you will receive a call regarding this service."
msisdn = $currentCall.callerID
msisdn = msisdn.to_s.gsub('6309','9')
command = Thread.new do
call msisdn, { :callerID => 'sip:21581082@sip.tropo.net'}
say "Hello! this is a sample call from Globe Labs. Have a good day. Goodbye!"
hangup
end
call $caller, {:callerID => 'sip:917111@sip.tropo.net'}
say "Hello! this is a sample call from Globe Labs. Have a good day. Goodbye!"
hangup
wait(1500)
say "Starting to test ASR..."
result = ask "Choose from Tom, Nancy or Jeff.", {
:choices => "Tom, Nancy, Jeff",
:recognizer => "en-PH",
:timeout => 20,
:bargein => true,
:mode => "speech",
:onChoice => lambda { |event|
say "On Choice"
wait(3000)
result = ask "Hi, this is a test call....... please input number 1 or number 2....", {
:choices => "1, 2",
:mode => "dtmf",
:timeout => 15.0,
:attempts => 3,
:terminator => '#'
}
say "you chose number" + result.value
@radralph
radralph / say.rb
Last active August 29, 2015 13:57
say
say "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer efficitur lectus ac ultrices scelerisque. Duis sit amet scelerisque sem, in feugiat odio. Pellentesque efficitur blandit quam, vel eleifend justo sollicitudin ut. Quisque nec rhoncus odio, non efficitur sem. Aliquam dapibus interdum urna eu sodales. In molestie tortor non lacus tempus, vel blandit metus tristique. Maecenas vel elit vel metus faucibus cursus. Sed non augue pretium, aliquam odio ullamcorper, placerat ligula. Ut gravida a erat ut eleifend."
hangup
wait(1500)
result = ask "enter 3 numbers", {
:choices => "[3 DIGITS]",
:terminator => '#',
:timeout => 15.0,
:mode => "dtmf",
:onChoice => lambda { |event|
say "Thank you."
}
}