Class: FSR::Cmd::Sofia
- Defined in:
- lib/fsr/cmd/sofia.rb,
lib/fsr/cmd/sofia/status.rb,
lib/fsr/cmd/sofia/profile.rb
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(fs_socket = nil) ⇒ Sofia
constructor
A new instance of Sofia.
-
#profile(args = nil) ⇒ Object
sofia profile.
-
#raw ⇒ Object
This method builds the API command to send to the freeswitch event socket.
-
#run(api_method = :api) ⇒ Object
Send the command to the event socket, using api by default.
-
#status(args = {}) ⇒ Object
sofia status.
Constructor Details
#initialize(fs_socket = nil) ⇒ Sofia
Returns a new instance of Sofia.
5 6 7 |
# File 'lib/fsr/cmd/sofia.rb', line 5 def initialize(fs_socket = nil) @fs_socket = fs_socket # FSR::CommandSocket obj end |
Instance Method Details
#profile(args = nil) ⇒ Object
sofia profile
16 17 18 19 20 21 22 23 |
# File 'lib/fsr/cmd/sofia.rb', line 16 def profile(args = nil) require "fsr/cmd/sofia/profile" # Require sofia/profile if args == nil Profile.new(@fs_socket, :command_string => "") else Profile.new(@fs_socket, args) end end |
#raw ⇒ Object
This method builds the API command to send to the freeswitch event socket
33 34 35 |
# File 'lib/fsr/cmd/sofia.rb', line 33 def raw orig_command = "sofia" end |
#run(api_method = :api) ⇒ Object
Send the command to the event socket, using api by default.
26 27 28 29 30 |
# File 'lib/fsr/cmd/sofia.rb', line 26 def run(api_method = :api) orig_command = "%s %s" % [api_method, raw] Log.debug "saying #{orig_command}" @fs_socket.say(orig_command) end |