Module: RubyAsterisk::AMI::Commands::System
- Included in:
- RubyAsterisk::AMI::Client
- Defined in:
- lib/ruby-asterisk/ami/commands/system.rb
Overview
System commands
Instance Method Summary collapse
- #command(command) ⇒ Object
- #device_state_list ⇒ Object
- #event_mask(event_mask = 'off') ⇒ Object
- #parked_calls ⇒ Object
- #ping ⇒ Object
- #skinny_devices ⇒ Object
- #skinny_lines ⇒ Object
-
#wait_event(timeout: -1)) ⇒ Object
A negative Timeout tells Asterisk to wait indefinitely, so the Promise must not impose a deadline either: #value then blocks until an event arrives (pass an explicit
value(seconds)to bound the wait).
Instance Method Details
#command(command) ⇒ Object
44 45 46 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 44 def command(command) execute 'Command', { 'Command' => command } end |
#device_state_list ⇒ Object
15 16 17 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 15 def device_state_list execute 'DeviceStateList' end |
#event_mask(event_mask = 'off') ⇒ Object
31 32 33 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 31 def event_mask(event_mask = 'off') execute 'Events', { 'EventMask' => event_mask } end |
#parked_calls ⇒ Object
11 12 13 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 11 def parked_calls execute 'ParkedCalls' end |
#ping ⇒ Object
27 28 29 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 27 def ping execute 'Ping' end |
#skinny_devices ⇒ Object
19 20 21 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 19 def skinny_devices execute 'SKINNYdevices' end |
#skinny_lines ⇒ Object
23 24 25 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 23 def skinny_lines execute 'SKINNYlines' end |
#wait_event(timeout: -1)) ⇒ Object
A negative Timeout tells Asterisk to wait indefinitely, so the Promise
must not impose a deadline either: #value then blocks until an event
arrives (pass an explicit value(seconds) to bound the wait).
38 39 40 41 42 |
# File 'lib/ruby-asterisk/ami/commands/system.rb', line 38 def wait_event(timeout: -1) seconds = timeout.to_i execute 'WaitEvent', { 'Timeout' => timeout }, timeout: (seconds.negative? ? nil : [@timeout, seconds].max) end |