|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lastbamboo.common.sip.client.SipClientImpl
public class SipClientImpl
Creates a new SIP client. This class supplies the interface for writing all SIP messages. It queues up messages on a separate thread from in-order writing.
| Field Summary |
|---|
| Fields inherited from interface org.littleshoot.mina.common.IoFutureListener |
|---|
CLOSE |
| Constructor Summary | |
|---|---|
SipClientImpl(URI sipClientUri,
URI proxyUri,
org.lastbamboo.common.sip.stack.message.SipMessageFactory messageFactory,
org.lastbamboo.common.sip.stack.transaction.client.SipTransactionTracker transactionTracker,
org.lastbamboo.common.offer.answer.OfferAnswerFactory offerAnswerFactory,
InetSocketAddress serverAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
org.lastbamboo.common.sip.stack.util.UriUtils uriUtils,
org.lastbamboo.common.sip.stack.transport.SipTcpTransportLayer transportLayer,
SipClientCloseListener closeListener,
CrlfDelayCalculator calculator,
org.lastbamboo.common.sip.stack.IdleSipSessionListener idleSipSessionListener)
Creates a new SIP client connection to an individual SIP proxy server. |
|
| Method Summary | |
|---|---|
void |
connect()
Connects to the proxy server. |
URI |
getContactUri()
Accessor the contact URI for the client. |
org.apache.commons.id.uuid.UUID |
getInstanceId()
Accessor for the unique instance ID for this client. |
URI |
getProxyUri()
Accessor for the URI of the SIP proxy the client is connected to and registered with. |
URI |
getSipUri()
Accessor for the SIP URI for this client. |
void |
offer(URI sipUri,
byte[] body,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener,
org.littleshoot.util.KeyStorage keyStore)
|
void |
onTransactionFailed(org.lastbamboo.common.offer.answer.OfferAnswerMessage message)
|
void |
onTransactionSucceeded(org.lastbamboo.common.offer.answer.OfferAnswerMessage message)
|
void |
operationComplete(org.littleshoot.mina.common.IoFuture future)
|
void |
register()
Registers the SIP client. |
void |
serviceActivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
|
void |
serviceDeactivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
|
void |
sessionCreated(org.littleshoot.mina.common.IoSession session)
|
void |
sessionDestroyed(org.littleshoot.mina.common.IoSession session)
|
void |
writeCrlfKeepAlive()
Sends a CRLF keep-alive message, as specified in the SIP outbound draft at: http://www.ietf.org/internet-drafts/draft-ietf-sip-outbound-08.txt |
void |
writeInviteOk(org.lastbamboo.common.sip.stack.message.Invite invite,
org.littleshoot.mina.common.ByteBuffer body)
Sends an INVITE OK message. |
void |
writeInviteRejected(org.lastbamboo.common.sip.stack.message.Invite invite,
int responseCode,
String reasonPhrase)
Writes an INVITE rejected response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SipClientImpl(URI sipClientUri,
URI proxyUri,
org.lastbamboo.common.sip.stack.message.SipMessageFactory messageFactory,
org.lastbamboo.common.sip.stack.transaction.client.SipTransactionTracker transactionTracker,
org.lastbamboo.common.offer.answer.OfferAnswerFactory offerAnswerFactory,
InetSocketAddress serverAddress,
org.littleshoot.util.SessionSocketListener callSocketListener,
org.lastbamboo.common.sip.stack.util.UriUtils uriUtils,
org.lastbamboo.common.sip.stack.transport.SipTcpTransportLayer transportLayer,
SipClientCloseListener closeListener,
CrlfDelayCalculator calculator,
org.lastbamboo.common.sip.stack.IdleSipSessionListener idleSipSessionListener)
sipClientUri - The URI of the client.proxyUri - The URI of the proxy.messageFactory - The factory for creating new SIP messages.transactionTracker - The class for keeping track of SIP client
transactions.offerAnswerFactory - Factory for creating classes capable of
handling offers and answers.serverAddress - The listener for incoming sockets on the answerer.uriUtils - Utilities for handling SIP URIs.transportLayer - The class for actually sending SIP messages.closeListener - The class that listens for closed connections to
proxies.calculator - The class that calculates the delay between double CRLF
keep-alive messages, passed in for testing.idleSipSessionListener - Listener for idle SIP sessions.| Method Detail |
|---|
public void connect()
throws IOException
SipClient
connect in interface SipClientIOException - If we cannot connect.
public void register()
throws IOException
SipClient
register in interface SipClientIOException - If we do not get a successful registration response.public void writeCrlfKeepAlive()
SipClient
writeCrlfKeepAlive in interface SipClient
public void offer(URI sipUri,
byte[] body,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener,
org.littleshoot.util.KeyStorage keyStore)
throws IOException
offer in interface org.lastbamboo.common.offer.answer.OffererIOExceptionpublic org.apache.commons.id.uuid.UUID getInstanceId()
SipClient
getInstanceId in interface SipClientpublic URI getContactUri()
SipClient
getContactUri in interface SipClientpublic URI getSipUri()
SipClient
getSipUri in interface SipClientpublic URI getProxyUri()
SipClient
getProxyUri in interface SipClientpublic void onTransactionSucceeded(org.lastbamboo.common.offer.answer.OfferAnswerMessage message)
onTransactionSucceeded in interface org.lastbamboo.common.offer.answer.OfferAnswerTransactionListenerpublic void onTransactionFailed(org.lastbamboo.common.offer.answer.OfferAnswerMessage message)
onTransactionFailed in interface org.lastbamboo.common.offer.answer.OfferAnswerTransactionListenerpublic void operationComplete(org.littleshoot.mina.common.IoFuture future)
operationComplete in interface org.littleshoot.mina.common.IoFutureListener
public void writeInviteOk(org.lastbamboo.common.sip.stack.message.Invite invite,
org.littleshoot.mina.common.ByteBuffer body)
SipClient
writeInviteOk in interface SipClientinvite - The INVITE we're responding to.body - The body of the INVITE OK.
public void writeInviteRejected(org.lastbamboo.common.sip.stack.message.Invite invite,
int responseCode,
String reasonPhrase)
SipClient
writeInviteRejected in interface SipClientinvite - The invite.responseCode - The response code.reasonPhrase - The reason phrase for the error.
public void serviceActivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
serviceActivated in interface org.littleshoot.mina.common.IoServiceListener
public void serviceDeactivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
serviceDeactivated in interface org.littleshoot.mina.common.IoServiceListenerpublic void sessionCreated(org.littleshoot.mina.common.IoSession session)
sessionCreated in interface org.littleshoot.mina.common.IoServiceListenerpublic void sessionDestroyed(org.littleshoot.mina.common.IoSession session)
sessionDestroyed in interface org.littleshoot.mina.common.IoServiceListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||