Skip to content
deathsyn edited this page Mar 10, 2011 · 1 revision

An example of using FSR::CommandSocket to originate a new call in irb:

irb(main):001:0> require 'fsr'
=> true

irb(main):002:0> FSR.load_all_commands
=> [:sofia, :originate]

irb(main):003:0> sock = FSR::CommandSocket.new
=> #<FSR::CommandSocket:0xb7a89104 @server="127.0.0.1", @socket=#<TCPSocket:0xb7a8908c>, @port="8021", @auth="ClueCon">

irb(main):007:0> sock.originate(:target => 'sofia/gateway/carlos/8179395222', :endpoint => FSR::App::Bridge.new("user/bougyman")).run
=> {"Job-UUID"=>"732075a4-7dd5-4258-b124-6284a82a5ae7", "body"=>"", "Content-Type"=>"command/reply", "Reply-Text"=>"+OK Job-UUID: 732075a4-7dd5-4258-b124-6284a82a5ae7"}
Clone this wiki locally