Guest User

Untitled

a guest
Nov 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. get '/call' do
  2. case Time.now.utc.hour
  3. when 9..19 then redirect '/support'
  4. else redirect '/voicemail'
  5. end
  6. end
  7.  
  8. get '/voicemail' do
  9. response =<<EOF
  10. <Response>
  11. <Say>
  12. Welcome to moocode. Sorry our support team is not available.
  13. Please leave a message including your phone number or email address
  14. after the beep.
  15. </Say>
  16. <Record action="/recording" />
  17. </Response>
  18. EOF
  19. end
  20.  
  21. get '/support' do
  22. response =<<EOF
  23. <Response>
  24. <Say>Welcome to moocode. Please wait while we connect you.</Say>
  25. <Dial>+440123456789</Dial>
  26. </Response>
  27. EOF
  28. end
  29.  
  30. post '/recording' do
  31. recording_url = params['RecordingUrl']
  32. # email the recording url to the support team via sendhub.net ;)
  33. response =<<EOF
  34. <Response>
  35. <Say>Thank you. We'll be in touch shortly. Goodbye.</Say>
  36. <Hangup/>
  37. </Response>
  38. EOF
  39. end
Add Comment
Please, Sign In to add comment