Created
June 9, 2010 18:41
-
-
Save PeterBloom/431952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, callOptions, { | |
#:callerID => applicationCallerID, | |
: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, callOptions { | |
#:callerID=>applicationCallerID, | |
: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) | |
} | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment