public abstract class TransactionHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
protected jain.protocol.ip.mgcp.JainMgcpCommandEvent |
commandEvent
Used to hold parsed command event
|
protected jain.protocol.ip.mgcp.message.parms.EndpointIdentifier |
endpoint |
static int |
LONGTRAN_TIMER_TIMEOUT |
static byte[] |
MGCP_VERSION |
static String |
NEW_LINE |
protected int |
remoteTID
Transaction handle sent from application to the MGCP provider.
|
protected jain.protocol.ip.mgcp.JainMgcpResponseEvent |
responseEvent
Used to hold parsed response event *
|
protected boolean |
retransmision |
static String |
SDP_NEW_LINE |
protected boolean |
sent
Is this a transaction on a command sent or received?
|
static String |
SINGLE_CHAR_SPACE |
protected Object |
source |
protected JainMgcpStackImpl |
stack |
static int |
THIST_TIMER_TIMEOUT |
protected static Timer |
transactionHandlerTimer
Expiration timer
|
| Constructor and Description |
|---|
TransactionHandler(JainMgcpStackImpl stack)
Creates a new instance of TransactionHandle
Used by provider to prepare origination transaction for sending command message from an application to the stack.
|
TransactionHandler(JainMgcpStackImpl stack,
InetAddress remoteAddress,
int port)
Creates a new instance of TransactionHandle.
|
| Modifier and Type | Method and Description |
|---|---|
abstract jain.protocol.ip.mgcp.JainMgcpCommandEvent |
decodeCommand(byte[] data,
SplitDetails[] message)
Decodes MGCP command message into jain mgcp command event object.
|
abstract jain.protocol.ip.mgcp.JainMgcpResponseEvent |
decodeResponse(byte[] data,
SplitDetails[] msg,
Integer txID,
jain.protocol.ip.mgcp.message.parms.ReturnCode returnCode)
Decodes MGCP response message into jain mgcp response event object.
|
abstract int |
encode(jain.protocol.ip.mgcp.JainMgcpCommandEvent event,
byte[] array)
Encodes command event object into MGCP command message.
|
abstract int |
encode(jain.protocol.ip.mgcp.JainMgcpResponseEvent event,
byte[] array)
Encodes response event object into MGCP response message.
|
String |
getEndpointId() |
int |
getLocalTID()
Returns the transaction handle sent from MGCP provider to listener.
|
protected Object |
getObjectSource(int tid)
constructs the object source for a command
|
abstract jain.protocol.ip.mgcp.JainMgcpResponseEvent |
getProvisionalResponse() |
int |
getRemoteTID()
Returns the transaction handle sent from application to the MGCP provider.
|
boolean |
isCommand() |
void |
markRetransmision() |
void |
receiveRequest(jain.protocol.ip.mgcp.message.parms.EndpointIdentifier endpoint,
byte[] data,
SplitDetails[] msg,
Integer remoteTID) |
void |
receiveResponse(byte[] data,
SplitDetails[] msg,
Integer txID,
jain.protocol.ip.mgcp.message.parms.ReturnCode returnCode)
Used by stack for relaying received MGCP response messages to the application.
|
protected void |
release()
Release this transaction and frees all allocated resources.
|
void |
send() |
protected void |
sendProvisionalResponse() |
void |
setCommand(boolean isCommand) |
void |
setCommandEvent(jain.protocol.ip.mgcp.JainMgcpCommandEvent commandEvent) |
void |
setResponseEvent(jain.protocol.ip.mgcp.JainMgcpResponseEvent responseEvent) |
public static final String NEW_LINE
public static final String SDP_NEW_LINE
public static final String SINGLE_CHAR_SPACE
public static final byte[] MGCP_VERSION
public static final int LONGTRAN_TIMER_TIMEOUT
public static final int THIST_TIMER_TIMEOUT
protected boolean sent
protected int remoteTID
protected JainMgcpStackImpl stack
protected jain.protocol.ip.mgcp.JainMgcpCommandEvent commandEvent
protected jain.protocol.ip.mgcp.JainMgcpResponseEvent responseEvent
protected static Timer transactionHandlerTimer
protected boolean retransmision
protected Object source
protected jain.protocol.ip.mgcp.message.parms.EndpointIdentifier endpoint
public TransactionHandler(JainMgcpStackImpl stack)
stack - the reference to the MGCP stack.public TransactionHandler(JainMgcpStackImpl stack, InetAddress remoteAddress, int port)
stack - the reference to the MGCP stack.protected void release()
public int getRemoteTID()
public int getLocalTID()
public abstract int encode(jain.protocol.ip.mgcp.JainMgcpCommandEvent event,
byte[] array)
event - the command event object.public abstract int encode(jain.protocol.ip.mgcp.JainMgcpResponseEvent event,
byte[] array)
event - the response event object.public abstract jain.protocol.ip.mgcp.JainMgcpCommandEvent decodeCommand(byte[] data,
SplitDetails[] message)
throws ParseException
MGCP - messageParseExceptionpublic abstract jain.protocol.ip.mgcp.JainMgcpResponseEvent decodeResponse(byte[] data,
SplitDetails[] msg,
Integer txID,
jain.protocol.ip.mgcp.message.parms.ReturnCode returnCode)
throws ParseException
MGCP - messageParseExceptionpublic abstract jain.protocol.ip.mgcp.JainMgcpResponseEvent getProvisionalResponse()
public void send()
protected void sendProvisionalResponse()
protected Object getObjectSource(int tid)
tid - public boolean isCommand()
public void setCommand(boolean isCommand)
public void setCommandEvent(jain.protocol.ip.mgcp.JainMgcpCommandEvent commandEvent)
public void setResponseEvent(jain.protocol.ip.mgcp.JainMgcpResponseEvent responseEvent)
public void markRetransmision()
public void receiveRequest(jain.protocol.ip.mgcp.message.parms.EndpointIdentifier endpoint,
byte[] data,
SplitDetails[] msg,
Integer remoteTID)
public void receiveResponse(byte[] data,
SplitDetails[] msg,
Integer txID,
jain.protocol.ip.mgcp.message.parms.ReturnCode returnCode)
message - receive MGCP response message.public String getEndpointId()
Copyright © 2014 TeleStax, Inc.. All Rights Reserved.