org.lastbamboo.common.sip.stack.transport
Interface SipTcpTransportLayer

All Known Implementing Classes:
SipTcpTransportLayerImpl

public interface SipTcpTransportLayer

Interface for calls to the TCP transport layer, as specified in section 18 of RFC 3261, starting on page 141.


Method Summary
 void addConnection(org.littleshoot.mina.common.IoSession io)
          Adds a mapping between the remote host for the connection and the class for reading and writing data from and to that host.
 boolean hasConnectionForAny(Collection<InetSocketAddress> socketAddresses)
          Checks whether or not the transport layer has a connection to any of the specified socket addresses.
 SipClientTransaction invite(Invite message, org.littleshoot.mina.common.IoSession io, org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
          Writes a message that is a part of a transaction.
 SipClientTransaction register(Register message, org.littleshoot.mina.common.IoSession io, org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
          Writes a REGISTER request that is a part of a transaction.
 void removeConnection(org.littleshoot.mina.common.IoSession session)
          Removes this connection.
 org.littleshoot.mina.common.WriteFuture writeCrlfKeepAlive(org.littleshoot.mina.common.IoSession io)
          Writes a CRLF keep-alive message to the given reader/writer, as specified in the SIP outbound drafts.
 void writeRequest(Collection<InetSocketAddress> socketAddresses, Invite request)
          Writes the specified request to the first address in the collection we have a connection for.
 void writeRequestStatelessly(Invite request, org.littleshoot.mina.common.IoSession io)
          Writes the specified request without creating a transaction.
 boolean writeResponse(InetSocketAddress socketAddress, SipResponse response)
          Writes the specified response message to the connection associated with the specified address.
 void writeResponse(SipResponse response)
          Writes a response using the routing information in the topmost Via header.
 

Method Detail

addConnection

void addConnection(org.littleshoot.mina.common.IoSession io)
Adds a mapping between the remote host for the connection and the class for reading and writing data from and to that host.

Parameters:
io - The connection to the host.

register

SipClientTransaction register(Register message,
                              org.littleshoot.mina.common.IoSession io,
                              org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
Writes a REGISTER request that is a part of a transaction. This method should add the transaction to a transaction map prior to sending it to ensure we don't receive responses prior to the maintaining data for the transaction.

Parameters:
message - The SIP message we're sending.
io - The class for writing the message.
listener - Class that listens for transaction events.
Returns:
The client transaction for the request.

invite

SipClientTransaction invite(Invite message,
                            org.littleshoot.mina.common.IoSession io,
                            org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
Writes a message that is a part of a transaction. This method should add the transaction to a transaction map prior to sending it to ensure we don't receive responses prior to the maintaining data for the transaction.

Parameters:
message - The SIP message we're sending.
io - The class for writing the message.
listener - Class that listens for transaction events.
Returns:
The client transaction for the request.

writeRequestStatelessly

void writeRequestStatelessly(Invite request,
                             org.littleshoot.mina.common.IoSession io)
Writes the specified request without creating a transaction.

Parameters:
request - The SIP request to write.
io - The class that will write hte message.

writeResponse

boolean writeResponse(InetSocketAddress socketAddress,
                      SipResponse response)
Writes the specified response message to the connection associated with the specified address.

Parameters:
socketAddress - The address and port remote of the client to send the response to.
response - The response to send.
Returns:
Returns true of we successfull processed the response and passed it to the network for transport, otherwise false.

writeResponse

void writeResponse(SipResponse response)
                   throws IOException
Writes a response using the routing information in the topmost Via header.

Parameters:
response - The response to write.
Throws:
IOException - If we could not route the response for any reason.

hasConnectionForAny

boolean hasConnectionForAny(Collection<InetSocketAddress> socketAddresses)
Checks whether or not the transport layer has a connection to any of the specified socket addresses.

Parameters:
socketAddresses - The collection of socket addresses to look for.
Returns:
true if there is a connection to any of the specified addresses, otherwise false.

writeRequest

void writeRequest(Collection<InetSocketAddress> socketAddresses,
                  Invite request)
Writes the specified request to the first address in the collection we have a connection for.

Parameters:
socketAddresses - The socket addresses to attempt to send a message to.
request - The request to send.

writeCrlfKeepAlive

org.littleshoot.mina.common.WriteFuture writeCrlfKeepAlive(org.littleshoot.mina.common.IoSession io)
Writes a CRLF keep-alive message to the given reader/writer, as specified in the SIP outbound drafts. The keep-alive both keeps NATs from closing active connections and supplies insurance to detect when connections have been closed.

Parameters:
io - The reader/writer to write the messages over.
Returns:
The future for the write.

removeConnection

void removeConnection(org.littleshoot.mina.common.IoSession session)
Removes this connection.

Parameters:
session - The connection to remove.


Copyright © 2013 LittleShoot. All Rights Reserved.