Skip to content

Instantly share code, notes, and snippets.

View radralph's full-sized avatar
😮

Ralph Sutacio radralph

😮
View GitHub Profile
call("9175744034");
say("heloo there");
say("Hi! This is a sample of text to speech");
@radralph
radralph / play_mp3.rb
Created April 30, 2014 02:49
sample call [sir paul's]
say "http://auto-sms.herokuapp.com/call2.mp3"
hangup
@radralph
radralph / conference.rb
Last active January 25, 2017 15:42
trying out the tropo conference
#call "sip:[email protected]", { :callerID => 'sip:[email protected]'}
#call "sip:[email protected]"
#call "9175744034"
say "hello there"
command = Thread.new do
my_sesh = $currentCall.sessionId
Kernel.system "curl -k 'ip.sessions?action=create&token=534472466c5255447961417779474a59676e46795876564b6e4a4341644a53507a6a7a46504e72726c697665'"
end
command.join
# answer
log $currentCall.sessionId + "-------------"
say "this is a test"
say "joining session"
conference "1137", {
:conferenceId => "1137",
:playTones => true,
:allowSignals => "exit",
:onSignal => lambda { |event|
<?php
say("Welcome to Tropo!");
?>
call $caller, {:callerID => 'sip:[email protected]'}
say "Hello! This is to inform you that we have sent a document you requested to the email you gave us. Kindly check your inbox or your spam folder for the message."
result = ask "Were you able to receive the document you requested? Press '1' for YES, or press '2' for NO.", {
:choices => "1,2",
:timeout => 10.0,
:attempts => 3,
:terminator => '#'
}
ans = result.value.to_s
SMS API
Complete and Correct request parameters [normal accounts]
responds with code 201
Complete and Correct request parameters [bypassed acct]
responds with code 201
insufficient dev wallet
error: Insufficient Wallet Balance.
invalid shortcode
Error: invalid shortcode
Missing access_token[normal acct]
call $caller, {:callerID => 'sip:[email protected]'}
say "Hello This is a demo call"
hangup
@radralph
radralph / extended_voice.rb
Last active December 4, 2015 05:54
test script for voice extended
msisdn = $currentCall.getHeader("TO").split(" ").first
msisdn = msisdn[8..msisdn.length]
sesh = $currentCall.sessionId
#say "Please wait while we transfer your call. Press star to cancel the transfer."
##Insert 30sec AD Below:
##
#say ""