|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lastbamboo.common.sip.stack.message.SipMessageFactoryImpl
public class SipMessageFactoryImpl
Factory for creating SIP messages. This can create messages from scratch or messages that arrive over the wire.
| Constructor Summary | |
|---|---|
SipMessageFactoryImpl()
Creates a new SIP message factory with the default header factory. |
|
SipMessageFactoryImpl(SipHeaderFactory headerFactory)
Creates a new SIP message factory. |
|
| Method Summary | |
|---|---|
Invite |
addVia(Invite message,
SipHeader newHeader)
Copies all the data from the original message into a new message, adding the specified Via header. |
Register |
addVia(Register message,
SipHeader newHeader)
Copies all the data from the original message into a new message, adding the specified Via header. |
SipMessage |
createErrorResponse(SipMessage request,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
int responseCode,
String reasonPhrase)
Creates an error response to the specified request. |
SipResponse |
createInviteOk(Invite request,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
org.littleshoot.mina.common.ByteBuffer body)
Creates a new INVITE OK message, copying data from the specified request. |
Invite |
createInviteRequest(String displayName,
URI toUri,
URI fromUri,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
org.littleshoot.mina.common.ByteBuffer body)
Creates a new invite request outside of a dialog. |
Invite |
createInviteToForward(InetSocketAddress socketAddress,
Invite invite)
Creates a new message to forward with all of the appropriate modifications to the Via header based on the remote reading of the socket address and port. |
SipResponse |
createRegisterOk(Register request)
Creates a register OK message from the specified request. |
Register |
createRegisterRequest(URI requestUri,
String displayName,
URI toUri,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri)
Creates a new register request. |
SipResponse |
createRequestTimeoutResponse(SipMessage request)
Creates a 408 Request Timeout response. |
SipResponse |
stripVia(SipResponse response)
Strips the topmost Via header from the response, returning a new message without the topmost Via. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SipMessageFactoryImpl(SipHeaderFactory headerFactory)
headerFactory - The collaborator class for creating SIP headers.public SipMessageFactoryImpl()
| Method Detail |
|---|
public Register createRegisterRequest(URI requestUri,
String displayName,
URI toUri,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri)
SipMessageFactory
createRegisterRequest in interface SipMessageFactoryrequestUri - The request URI for the request start line.displayName - The display name to send the request to.toUri - The URI to send the request to.instanceId - The instance ID of the registering SIP entity.contactUri - The contact URI of the registering SIP entity.
public Invite createInviteRequest(String displayName,
URI toUri,
URI fromUri,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
org.littleshoot.mina.common.ByteBuffer body)
SipMessageFactory
createInviteRequest in interface SipMessageFactorydisplayName - The name to display.toUri - The SIP URI to send the message to.fromUri - The SIP URI the message is from.instanceId - The instance ID of the sending client, used in the
contact header.contactUri - The contact URI.body - The body of the INVITE. This is typcically SDP.
public SipResponse createInviteOk(Invite request,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
org.littleshoot.mina.common.ByteBuffer body)
SipMessageFactory
createInviteOk in interface SipMessageFactoryrequest - The request to respond to with an OK response.instanceId - The instance ID of the responding user.contactUri - The contact URI of the responding user.body - The body of the message.
public SipMessage createErrorResponse(SipMessage request,
org.apache.commons.id.uuid.UUID instanceId,
URI contactUri,
int responseCode,
String reasonPhrase)
SipMessageFactory
createErrorResponse in interface SipMessageFactoryrequest - The request to create a response for.instanceId - The instance ID of the resonding peer.contactUri - The contact URI of the responding peer.responseCode - The reason code for the response.reasonPhrase - The reason phrase for the response.
public Register addVia(Register message,
SipHeader newHeader)
SipMessageFactory
addVia in interface SipMessageFactorymessage - The original message to create a new message from.newHeader - The Via header to add.
public Invite addVia(Invite message,
SipHeader newHeader)
SipMessageFactory
addVia in interface SipMessageFactorymessage - The original message to create a new message from.newHeader - The Via header to add.
public SipResponse stripVia(SipResponse response)
SipMessageFactory
stripVia in interface SipMessageFactoryresponse - The response message to strip the Via from.
public SipResponse createRegisterOk(Register request)
SipMessageFactory
createRegisterOk in interface SipMessageFactoryrequest - The register request to create an OK response for.
public SipResponse createRequestTimeoutResponse(SipMessage request)
SipMessageFactory
createRequestTimeoutResponse in interface SipMessageFactoryrequest - The request that timed out.
public Invite createInviteToForward(InetSocketAddress socketAddress,
Invite invite)
throws IOException
SipMessageFactory
createInviteToForward in interface SipMessageFactorysocketAddress - The remote socket address the INVITE arrived from.invite - The incoming INVITE message.
IOException - If the message does not match the expected syntax.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||