Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created May 22, 2009 03:03
Show Gist options
  • Select an option

  • Save jsierles/115894 to your computer and use it in GitHub Desktop.

Select an option

Save jsierles/115894 to your computer and use it in GitHub Desktop.
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