Class: OverSIP::SIP::Reactor

Inherits:
EM::Connection
  • Object
show all
Includes:
Logger, MessageProcessor
Defined in:
lib/oversip/sip/listeners/reactor.rb

Direct Known Subclasses

TcpReactor, UdpReactor

Constant Summary

Constants included from MessageProcessor

MessageProcessor::MSG_TYPE

Constants included from Logger

Logger::SYSLOG_POSIXMQ_MAPPING

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logger

close, #fatal, fg_system_msg2str, init_logger_mq, load_methods, #log_id, syslog_system_msg2str, syslog_user_msg2str

Constructor Details

#initializeReactor

Returns a new instance of Reactor.



22
23
24
25
26
27
28
29
30
# File 'lib/oversip/sip/listeners/reactor.rb', line 22

def initialize
  @parser = ::OverSIP::SIP::MessageParser.new
  @buffer = ::IO::Buffer.new
  @state = :init

  # Set the socket sending error handling to report the error:
  # :ERRORHANDLING_KILL, :ERRORHANDLING_IGNORE, :ERRORHANDLING_REPORT
  self.send_error_handling = :ERRORHANDLING_REPORT
end

Class Attribute Details

.connectionsObject

Returns the value of attribute connections.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def connections
  @connections
end

.invite_client_transactionsObject

Returns the value of attribute invite_client_transactions.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def invite_client_transactions
  @invite_client_transactions
end

.invite_server_transactionsObject

Returns the value of attribute invite_server_transactions.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def invite_server_transactions
  @invite_server_transactions
end

.ipObject

Returns the value of attribute ip.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def ip
  @ip
end

.ip_typeObject

Returns the value of attribute ip_type.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def ip_type
  @ip_type
end

.non_invite_client_transactionsObject

Returns the value of attribute non_invite_client_transactions.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def non_invite_client_transactions
  @non_invite_client_transactions
end

.non_invite_server_transactionsObject

Returns the value of attribute non_invite_server_transactions.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def non_invite_server_transactions
  @non_invite_server_transactions
end

.outbound_path_fragmentObject

Returns the value of attribute outbound_path_fragment.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def outbound_path_fragment
  @outbound_path_fragment
end

.outbound_record_route_fragmentObject

Returns the value of attribute outbound_record_route_fragment.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def outbound_record_route_fragment
  @outbound_record_route_fragment
end

.portObject

Returns the value of attribute port.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def port
  @port
end

.record_routeObject

Returns the value of attribute record_route.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def record_route
  @record_route
end

.transportObject

Returns the value of attribute transport.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def transport
  @transport
end

.via_coreObject

Returns the value of attribute via_core.



9
10
11
# File 'lib/oversip/sip/listeners/reactor.rb', line 9

def via_core
  @via_core
end

Class Method Details

.reliable_transport_listener?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/oversip/sip/listeners/reactor.rb', line 17

def reliable_transport_listener?
  @is_reliable_transport_listener
end

Instance Method Details

#receive_senderror(error, data) ⇒ Object



32
33
34
# File 'lib/oversip/sip/listeners/reactor.rb', line 32

def receive_senderror error, data
  log_system_error "Socket sending error: #{error.inspect}, #{data.inspect}"
end