Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save jsierles/116848 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__)+'/../app/models/conference_call'
flowroute_inbound {
conference = nil
#Give the user 3 chances to enter a correct conference number
3.times do
result = input 6,
:play => 'conf-getconfno',
:timeout => 10,
: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
if conference.participant_count == 0
record "/u/apps/campfire/current/public/sounds/#{conference.id}.wav"
end
#The user has entered a valid conference, break for the next step
conference.add_caller
set_variable 'conference_id', conference.id.to_s
execute('conference', conference.id.to_s + '/Sm')
break
end
else
#Ask the user to try again
play ['invalid-entry', 'please-try-again']
end
end
hangup
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment