Guest User

Untitled

a guest
Mar 1st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'rubygems'
  4. require 'adhearsion'
  5. require 'adhearsion/voip/asterisk/manager_interface'
  6. require 'timeout'
  7.  
  8. include Adhearsion::VoIP::Asterisk::Manager
  9.  
  10. status = Timeout::timeout(60) do
  11. asterisk = ManagerInterface::connect(
  12. :host => "localhost",
  13. :username => "localconnect",
  14. :password => "ranchbone",
  15. :events => true)
  16.  
  17. response = asterisk.send_action_synchronously("Originate",
  18. "Channel" => "SIP/sip.tollfreegateway.com/#{ARGV[0]}",
  19. "Context" => "demo", "Exten" => "6000", "Priority" => "1")
  20.  
  21.  
  22. end
Add Comment
Please, Sign In to add comment