Guest User

Untitled

a guest
Jul 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'sinatra'
  4. require 'erb'
  5. require 'fsr'
  6.  
  7. FSR.load_all_commands
  8.  
  9. get '/' do
  10. erb "<form action=\"/originate\" method=\"post\"><input type=\"text\" name=\"phone_number\"><input type=\"submit\"></form>"
  11. end
  12.  
  13. post '/originate' do
  14. sock = FSR::CommandSocket.new
  15. #sock.originate(:target => "sofia/gateway/gizmo/#{params[:session][:phone_number]}", :endpoint => FSR::App::Conference.new("3030", "default")).run
  16. sock.originate(:target => "sofia/internal/#{params[:phone_number]}@65.208.88.11", :endpoint => FSR::App::ExecuteApp.new("playback", "/tmp/200911271756500.fondo4.wav")).run
  17. redirect '/'
  18. end
Add Comment
Please, Sign In to add comment