Class: Adhearsion::VoIP::Asterisk::AGI::Server
- Defined in:
- lib/adhearsion/voip/asterisk/agi_server.rb
Defined Under Namespace
Classes: RubyServer
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :server_class => RubyServer, :port => 4573, :host => "0.0.0.0" }
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#server_class ⇒ Object
readonly
Returns the value of attribute server_class.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
- #join ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
59 60 61 62 63 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 59 def initialize( = {}) = DEFAULT_OPTIONS.merge @host, @port, @server_class = .values_at(:host, :port, :server_class) @server = server_class.new(port, host) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
57 58 59 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 57 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
57 58 59 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 57 def port @port end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
57 58 59 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 57 def server @server end |
#server_class ⇒ Object (readonly)
Returns the value of attribute server_class.
57 58 59 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 57 def server_class @server_class end |
Instance Method Details
#join ⇒ Object
73 74 75 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 73 def join server.join end |
#shutdown ⇒ Object
69 70 71 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 69 def shutdown server.stop end |
#start ⇒ Object
65 66 67 |
# File 'lib/adhearsion/voip/asterisk/agi_server.rb', line 65 def start server.start end |