Class: Quaff::TCPSIPEndpoint
Instance Attribute Summary collapse
Attributes inherited from BaseEndpoint
#instance_id, #msg_log, #msg_trace, #sdp_port, #sdp_socket, #uri
Instance Method Summary
collapse
#add_call_id, #create_aka_client, #create_client, #create_server, #generate_call_id, #get_new_call_id, #get_new_message, #incoming_call, #initialize, #local_port, #mark_call_dead, #outgoing_call, #register, #send_msg, #set_aka_credentials, #setup_sdp, #unregister
Instance Attribute Details
#sockets ⇒ Object
Returns the value of attribute sockets.
161
162
163
|
# File 'lib/endpoint.rb', line 161
def sockets
@sockets
end
|
Instance Method Details
#add_sock(sock) ⇒ Object
182
183
184
|
# File 'lib/endpoint.rb', line 182
def add_sock sock
@sockets.push sock
end
|
#initialize_connection ⇒ Object
163
164
165
166
167
168
169
170
171
172
|
# File 'lib/endpoint.rb', line 163
def initialize_connection
if @lport != :anyport
@cxn = TCPServer.new(@lport)
else
@cxn = TCPServer.new(0)
@lport = @cxn.addr[1]
end
@parser = SipParser.new
@sockets = []
end
|
#new_source(host, port) ⇒ Object
Also known as:
new_connection
178
179
180
|
# File 'lib/endpoint.rb', line 178
def new_source host, port
return TCPSource.new host, port
end
|
#terminate ⇒ Object
186
187
188
189
190
191
192
193
|
# File 'lib/endpoint.rb', line 186
def terminate
oldsockets = @sockets.dup
@sockets = []
oldsockets.each do |s| s.close unless s.closed? end
mycxn = @cxn
@cxn = nil
mycxn.close
end
|
#transport ⇒ Object
174
175
176
|
# File 'lib/endpoint.rb', line 174
def transport
"TCP"
end
|