Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get '/call' do
- case Time.now.utc.hour
- when 9..19 then redirect '/support'
- else redirect '/voicemail'
- end
- end
- get '/voicemail' do
- response =<<EOF
- <Response>
- <Say>
- Welcome to moocode. Sorry our support team is not available.
- Please leave a message including your phone number or email address
- after the beep.
- </Say>
- <Record action="/recording" />
- </Response>
- EOF
- end
- get '/support' do
- response =<<EOF
- <Response>
- <Say>Welcome to moocode. Please wait while we connect you.</Say>
- <Dial>+440123456789</Dial>
- </Response>
- EOF
- end
- post '/recording' do
- recording_url = params['RecordingUrl']
- # email the recording url to the support team via sendhub.net ;)
- response =<<EOF
- <Response>
- <Say>Thank you. We'll be in touch shortly. Goodbye.</Say>
- <Hangup/>
- </Response>
- EOF
- end
Add Comment
Please, Sign In to add comment