Class: FSR::Cmd::Sofia

Inherits:
Command show all
Defined in:
lib/fsr/cmd/sofia.rb,
lib/fsr/cmd/sofia/status.rb,
lib/fsr/cmd/sofia/profile.rb

Defined Under Namespace

Classes: Profile, Status

Constant Summary

Constants inherited from Command

Command::DEFAULT_OPTIONS

Instance Method Summary collapse

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

#rawObject

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

#status(args = {}) ⇒ Object

sofia status



10
11
12
13
# File 'lib/fsr/cmd/sofia.rb', line 10

def status(args = {})
  require "fsr/cmd/sofia/status" # Require sofia/status
  Status.new(@fs_socket, args)
end