Created
May 22, 2009 03:03
-
-
Save jsierles/115894 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
| require '/Volumes/37s/campfire/app/models/conference_call' | |
| sandbox { | |
| conference = nil | |
| #Give the user 3 chances to enter a correct conference number | |
| 3.times do | |
| result = input 6, | |
| :play => 'conf-getconfno', | |
| :timeout => 7, | |
| :accept_key => '#' | |
| conference = ConferenceCall.find_by_pin result | |
| if conference | |
| if !conference.active? | |
| #Conference is locked, too bad | |
| play ['that-conference-is-now-locked', 'goodbye'] | |
| hangup | |
| else | |
| #The user has entered a valid conference, break for the next step | |
| break | |
| end | |
| else | |
| #Ask the user to try again | |
| play ['invalid-entry', 'please-try-again'] | |
| end | |
| set_variable 'conference_id', conference.id.to_s | |
| execute('conference', conference.id.to_s + '/Sm') | |
| end | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment