Skip to content

Instantly share code, notes, and snippets.

@robotarmy
Forked from PeterBloom/gist:431952
Created June 9, 2010 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robotarmy/431961 to your computer and use it in GitHub Desktop.
Save robotarmy/431961 to your computer and use it in GitHub Desktop.
callOptions = { :channel => "VOICE",
:answerOnMedia => false,
:timeout => 30.0,
:callerID => applicationCallerID
}
sayOptions = {:voice => "kate"}
conferenceOptions = { :mute => false,
:playTones => false,
:terminator => "*",
:joinPrompt => "Connecting now.",
:leavePrompt => "We hope you enjoyed your call!"
}
# Create conference ID
conferenceID = get_conference_id()
# Call First Leg (Bandmember)
call('tel:+1' + $bandmemberNumberToDial, {
:onAnswer => lambda{|event|
log "@"*5 + "User has answered"
#Create second thread for second leg (Fan)
Thread.new do
log "@"*5 + "Start second tread: call to Fan"
call('tel:+1'+ $fanNumberToDial,{
:onAnswer=>lambda{|event|
log "@"*5 + "Fan answered join conference"
newCall = event.value
# announce caller (Bandmember)
wait(2000)
newCall.say("You have a call from the rolling stones!")
# join Fan to conference
newCall.conference(conferenceID,conferenceOptions)
}.merge(callOptions))
}.merge(callOptions))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment