Class: FSR::Cmd::UuidDump

Inherits:
Command
  • Object
show all
Defined in:
lib/fsr/cmd/uuid_dump.rb

Constant Summary

Constants inherited from Command

Command::DEFAULT_OPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fs_socket = nil, unique_id = nil) ⇒ UuidDump

Returns a new instance of UuidDump.



7
8
9
10
# File 'lib/fsr/cmd/uuid_dump.rb', line 7

def initialize(fs_socket = nil, unique_id = nil)
  @fs_socket = fs_socket # FSR::CommandSocket obj
  @uuid = unique_id # Freeswitch Unique ID to dump
end

Instance Attribute Details

#uuidObject (readonly)

Returns the value of attribute uuid.



5
6
7
# File 'lib/fsr/cmd/uuid_dump.rb', line 5

def uuid
  @uuid
end

Instance Method Details

#rawObject

This method builds the API command to send to the freeswitch event socket



20
21
22
# File 'lib/fsr/cmd/uuid_dump.rb', line 20

def raw
  orig_command = "uuid_dump #{uuid}"
end

#run(api_method = :api) ⇒ Object

Send the command to the event socket, using bgapi by default.



13
14
15
16
17
# File 'lib/fsr/cmd/uuid_dump.rb', line 13

def run(api_method = :api)
  orig_command = "%s %s" % [api_method, raw]
  Log.debug "saying #{orig_command}"
  @fs_socket.say(orig_command)
end