Skip to content

Instantly share code, notes, and snippets.

<?php
say("Hello to you all, PHP Conference Attendees!");
say("How are you today?");
say("Connecting to a conference call, to disconnect press the asterisk key.");
conference("PHPConf2016", array(
"terminator"=>"*",
"mute" => false,
"playTones" => true
)
say "Hello, this call to transfer to a client"
result = ask "Press 1 to hear a music, press 2 to transfer the call to Globe Labs.", {
:choices => "[1 DIGIT]",
:timeout => 5.0,
:attempts => 2}
say result.value
num = result.value.to_s
if num == "1"
call 9175881251, { :callerID => 'sip:21581201@sip.tropo.net'}
@amsantos
amsantos / grouptalk.rb
Last active August 29, 2015 14:05
talk.rb
say "Hi, welcome to GroupTalk. Reservation is done via SMS. Text RESERVE to 21588255 and Enjoy FREE 30 minutes of group or conference call to your Globe or TM friends or family."
require 'net/http'
require 'uri'
require 'json'
n = $currentCall.callerID
pin = rand.to_s[2..4]
slot = 0
i = 1
v = false
t = ""
@amsantos
amsantos / Glass.rb
Last active August 29, 2015 14:05
Glass.rb
require 'net/http'
require 'uri'
require 'json'
n = $currentCall.callerID
n = n[2, n.length]
v = "false"
say "You have reached the reservation hotline of Globe Labs for Google Glass 15-minute session."
say "Hi, we have plenty of slots for the Google Glass 10-minute session to wear and play. Just drop-by Basement 1 at the Help Conference Room, between ten am to 12 noon, and one pm to five pm."
say "See you there. Oh, this is a free call. Thanks you."
hangup
call $number, { :callerID => 'sip:21581101@sip.tropo.net'}
say "Hello, this is a sample callout from Globe Labs."
result = ask " Would you like to avail of this promo? press 1 if Yes 2 for No", {
:choices => "[1 DIGIT]",
:mode => "dtmf",
:timeout => 5.0,
:attempts => 3,
:terminator => '#'
}
if result.value == "1"
say "Hello, this is a sample callout"
result = ask "You have been selected for a promo for a chance to win amazing gadget from TechX. Would you like to avail of this promo say Yes or No.", {
:choices => "[1 DIGIT]",
:timeout => 5.0,
:attempts => 2}
say result.value
num = result.value.to_s
if num == "1"
say "Thank you. To avail this promo, kindly proceed to the nearest Business Center in Greenbelt or Glorietta, Makati. Thank you!"
@amsantos
amsantos / sampleOutgoingCall.php
Created June 14, 2014 05:15
sampleOutgoingCall.php
<?php
call(array("9175881251"), array(
"timeout" => 120,
"callerID" => 'sip:2150177@sip.tropo.net',
"onAnswer" => "answerFCN",
"onTimeout" => "timeoutFCN",
"onCallFailure" => "callFailureFCN"
)
);
function answerFCN($event) {