Class: FSR::Cmd::Fsctl
Constant Summary
Constants inherited from Command
Instance Attribute Summary (collapse)
-
- (Object) command
readonly
Returns the value of attribute command.
Instance Method Summary (collapse)
-
- (Fsctl) initialize(fs_socket = nil)
constructor
A new instance of Fsctl.
-
- (Object) max_sessions
Get max sessions.
-
- (Object) max_sessions=(sessions)
Set max sessions.
-
- (Object) raw
This method builds the API command to send to the freeswitch event socket.
-
- (Object) run(api_method = :api)
Send the command to the event socket, using api by default.
Methods inherited from Command
Constructor Details
- (Fsctl) initialize(fs_socket = nil)
A new instance of Fsctl
10 11 12 |
# File 'lib/fsr/cmd/fsctl.rb', line 10 def initialize(fs_socket = nil) @fs_socket = fs_socket # FSR::CommandSocket obj end |
Instance Attribute Details
- (Object) command (readonly)
Returns the value of attribute command
8 9 10 |
# File 'lib/fsr/cmd/fsctl.rb', line 8 def command @command end |
Instance Method Details
- (Object) max_sessions
Get max sessions
15 16 17 18 |
# File 'lib/fsr/cmd/fsctl.rb', line 15 def max_sessions @command = "max_sessions" run end |
- (Object) max_sessions=(sessions)
Set max sessions
21 22 23 24 |
# File 'lib/fsr/cmd/fsctl.rb', line 21 def max_sessions=(sessions) @command = "max_sessions #{sessions}" run end |
- (Object) raw
This method builds the API command to send to the freeswitch event socket
34 35 36 |
# File 'lib/fsr/cmd/fsctl.rb', line 34 def raw orig_command = "fsctl #{@command}" end |
- (Object) run(api_method = :api)
Send the command to the event socket, using api by default.
27 28 29 30 31 |
# File 'lib/fsr/cmd/fsctl.rb', line 27 def run(api_method = :api) orig_command = "%s %s" % [api_method, raw] Log.debug "saying #{orig_command}" @fs_socket.say(orig_command) end |