Class: FSR::Cmd::SofiaContact

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

Constant Summary

Constants inherited from Command

DEFAULT_OPTIONS

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Command

#default_options

Constructor Details

- (SofiaContact) initialize(fs_socket = nil, contact = {})

A new instance of SofiaContact



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

def initialize(fs_socket = nil, contact = {})
  @fs_socket = fs_socket # FSR::CommandSocket obj
  @contact = contact[:contact]
  #puts @contact
end

Instance Attribute Details

- (Object) contact (readonly)

Returns the value of attribute contact



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

def contact
  @contact
end

Instance Method Details

- (Object) raw

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



24
25
26
# File 'lib/fsr/cmd/sofia_contact.rb', line 24

def raw
  orig_command = "sofia_contact #{@contact}"
end

- (Object) run(api_method = :api)

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



17
18
19
20
21
# File 'lib/fsr/cmd/sofia_contact.rb', line 17

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