sipxtacklib  Version 3.3
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
SipTransaction Class Reference

SipTransaction correlates requests and responses. More...

#include <SipTransaction.h>

Inheritance diagram for SipTransaction:
Inheritance graph
[legend]
Collaboration diagram for SipTransaction:
Collaboration graph
[legend]

Public Types

enum  transactionStates {
  TRANSACTION_UNKNOWN = 0,
  TRANSACTION_LOCALLY_INIITATED,
  TRANSACTION_CALLING,
  TRANSACTION_PROCEEDING,
  TRANSACTION_COMPLETE,
  TRANSACTION_CONFIRMED,
  TRANSACTION_TERMINATED
}
 
enum  messageRelationship {
  MESSAGE_UNKNOWN,
  MESSAGE_UNRELATED,
  MESSAGE_SAME_SESSION,
  MESSAGE_DIFFERENT_BRANCH,
  MESSAGE_REQUEST,
  MESSAGE_PROVISIONAL,
  MESSAGE_FINAL,
  MESSAGE_NEW_FINAL,
  MESSAGE_CANCEL,
  MESSAGE_CANCEL_RESPONSE,
  MESSAGE_ACK,
  MESSAGE_2XX_ACK,
  MESSAGE_DUPLICATE
}
 The relationship of a message to a transaction. More...
 

Public Member Functions

 SipTransaction (SipMessage *request=NULL, UtlBoolean isOutgoing=TRUE, UtlBoolean userAgentTransaction=TRUE)
 
virtual ~SipTransaction ()
 param: userAgentTransaction - user agent (vs proxy) client or More...
 
void getNewBranchId (SipMessage &request, UtlString &branchId)
 
UtlBoolean handleOutgoing (SipMessage &outgoingMessage, SipUserAgent &userAgent, SipTransactionList &transactionList, enum messageRelationship relationship, SIPX_TRANSPORT_DATA *pTransport=NULL)
 
void handleResendEvent (const SipMessage &outgoingMessage, SipUserAgent &userAgent, enum messageRelationship relationship, SipTransactionList &transactionList, int &nextTimeout, SipMessage *&delayedDispatchedMessage, SIPX_TRANSPORT_DATA *pTransport)
 
void handleExpiresEvent (const SipMessage &outgoingMessage, SipUserAgent &userAgent, enum messageRelationship relationship, SipTransactionList &transactionList, int &nextTimeout, SipMessage *&delayedDispatchedMessage, SIPX_TRANSPORT_DATA *pTransport)
 
UtlBoolean handleIncoming (SipMessage &incomingMessage, SipUserAgent &userAgent, enum messageRelationship relationship, SipTransactionList &transactionList, SipMessage *&delayedDispatchedMessage, SIPX_TRANSPORT_DATA *pTransport)
 
void removeTimer (OsTimer *timer)
 
void stopTimers ()
 
void startTimers ()
 
void deleteTimers ()
 
void linkChild (SipTransaction &child)
 
void toString (UtlString &dumpString, UtlBoolean dumpMessagesAlso)
 
void dumpTransactionTree (UtlString &dumpstring, UtlBoolean dumpMessagesAlso)
 
void dumpChildren (UtlString &dumpstring, UtlBoolean dumpMessagesAlso)
 
SipTransactiongetTopMostParent () const
 
void getCallId (UtlString &callId) const
 
enum transactionStates getState () const
 
long getStartTime () const
 
long getTimeStamp () const
 
void touch ()
 
void touchBelow (int newDate)
 
SipMessagegetRequest ()
 
SipMessagegetLastProvisionalResponse ()
 
SipMessagegetLastFinalResponse ()
 
void cancel (SipUserAgent &userAgent, SipTransactionList &transactionList)
 
void markBusy ()
 
void markAvailable ()
 
void notifyWhenAvailable (OsEvent *availableEvent)
 
void signalNextAvailable ()
 
void signalAllAvailable ()
 
UtlBoolean isServerTransaction () const
 
UtlBoolean isDnsSrvChild () const
 Inquiry as to whether this transaction is a recursed DNS SRV child. More...
 
UtlBoolean isUaTransaction () const
 
UtlBoolean isChildSerial ()
 
UtlBoolean isEarlyDialogWithMedia ()
 
UtlBoolean isChildEarlyDialogWithMedia ()
 
UtlBoolean isMethod (const char *methodToMatch) const
 
enum messageRelationship whatRelation (const SipMessage &message, UtlBoolean isOutgoing) const
 
UtlBoolean isBusy ()
 
UtlBoolean isUriChild (Url &uri)
 
UtlBoolean isUriRecursed (Url &uri)
 
UtlBoolean isUriRecursedChildren (UtlString &uriString)
 
void setTransport (SIPX_TRANSPORT_DATA *pTransport)
 

Static Public Member Functions

static void getStateString (enum transactionStates state, UtlString &stateString)
 
static void getRelationshipString (enum messageRelationship relationship, UtlString &relationshipString)
 
static void buildHash (const SipMessage &message, UtlBoolean isOutgoing, UtlString &hash)
 

Static Public Attributes

static int smTransactionNum = 0
 
static UtlString smBranchIdBase
 

Protected Member Functions

void handleChildTimeoutEvent (SipTransaction &child, const SipMessage &outgoingMessage, SipUserAgent &userAgent, enum messageRelationship relationship, SipTransactionList &transactionList, int &nextTimeout, SipMessage *&delayedDispatchedMessage, SIPX_TRANSPORT_DATA *pTransport)
 
UtlBoolean handleChildIncoming (SipMessage &incomingMessage, SipUserAgent &userAgent, enum messageRelationship relationship, SipTransactionList &transactionList, UtlBoolean childSaysShouldDispatch, SipMessage *&delayedDispatchedMessage, SIPX_TRANSPORT_DATA *pTransport)
 
UtlBoolean startSequentialSearch (SipUserAgent &userAgent, SipTransactionList &transactionList, SIPX_TRANSPORT_DATA *pTransport)
 returns: TRUE/FALSE as to whether the message should be dispatched to applications More...
 
UtlBoolean recurseChildren (SipUserAgent &userAgent, SipTransactionList &transactionList)
 
UtlBoolean recurseDnsSrvChildren (SipUserAgent &userAgent, SipTransactionList &transactionList, SIPX_TRANSPORT_DATA *pTransport)
 
UtlBoolean findBestResponse (SipMessage &bestResponse)
 
enum messageRelationship addResponse (SipMessage *&response, UtlBoolean isOutGoing, enum messageRelationship relationship=MESSAGE_UNKNOWN)
 
void cancelChildren (SipUserAgent &userAgent, SipTransactionList &transactionList)
 
void doMarkBusy (int markValue)
 

Detailed Description

SipTransaction correlates requests and responses.

CallId + 's' or 'c' (for server or client) is used as the key for the hash (i.e. stored as the string/data in the parent UtlString.

Member Enumeration Documentation

Enumerator
TRANSACTION_UNKNOWN 

not yet set

TRANSACTION_LOCALLY_INIITATED 

No messages sent (usually client)

TRANSACTION_CALLING 

Request sent.

TRANSACTION_PROCEEDING 

Provisional response received.

TRANSACTION_COMPLETE 

Final response received.

TRANSACTION_CONFIRMED 

ACK recieved for 300-699 response classes.

TRANSACTION_TERMINATED 

The relationship of a message to a transaction.

Enumerator
MESSAGE_UNKNOWN 

Relationship not yet determined, or error.

MESSAGE_UNRELATED 

A with different Call-Id, To or From.

MESSAGE_SAME_SESSION 

But not part of this TX or related branches.

MESSAGE_DIFFERENT_BRANCH 

Same Call-Id, to, from, cseq but different TX.

MESSAGE_REQUEST 

The request to this TX.

MESSAGE_PROVISIONAL 

A provision response to this TX.

MESSAGE_FINAL 

The first final response to this TX.

MESSAGE_NEW_FINAL 

A different final response for this TX.

MESSAGE_CANCEL 

A cancel for this TX.

MESSAGE_CANCEL_RESPONSE 
MESSAGE_ACK 

An ACK for this non-2xx TX.

MESSAGE_2XX_ACK 

An ACK assocated with this TX (but considered a different TX)

MESSAGE_DUPLICATE 

A duplicate message for this TX.

Constructor & Destructor Documentation

SipTransaction ( SipMessage request = NULL,
UtlBoolean  isOutgoing = TRUE,
UtlBoolean  userAgentTransaction = TRUE 
)
~SipTransaction ( )
virtual

param: userAgentTransaction - user agent (vs proxy) client or

Member Function Documentation

void getNewBranchId ( SipMessage request,
UtlString &  branchId 
)
UtlBoolean handleOutgoing ( SipMessage outgoingMessage,
SipUserAgent userAgent,
SipTransactionList transactionList,
enum messageRelationship  relationship,
SIPX_TRANSPORT_DATA pTransport = NULL 
)
void handleResendEvent ( const SipMessage outgoingMessage,
SipUserAgent userAgent,
enum messageRelationship  relationship,
SipTransactionList transactionList,
int &  nextTimeout,
SipMessage *&  delayedDispatchedMessage,
SIPX_TRANSPORT_DATA pTransport 
)
void handleExpiresEvent ( const SipMessage outgoingMessage,
SipUserAgent userAgent,
enum messageRelationship  relationship,
SipTransactionList transactionList,
int &  nextTimeout,
SipMessage *&  delayedDispatchedMessage,
SIPX_TRANSPORT_DATA pTransport 
)
UtlBoolean handleIncoming ( SipMessage incomingMessage,
SipUserAgent userAgent,
enum messageRelationship  relationship,
SipTransactionList transactionList,
SipMessage *&  delayedDispatchedMessage,
SIPX_TRANSPORT_DATA pTransport 
)
void removeTimer ( OsTimer *  timer)
void stopTimers ( )
void startTimers ( )
void deleteTimers ( )
void linkChild ( SipTransaction child)
void toString ( UtlString &  dumpString,
UtlBoolean  dumpMessagesAlso 
)
void dumpTransactionTree ( UtlString &  dumpstring,
UtlBoolean  dumpMessagesAlso 
)
void dumpChildren ( UtlString &  dumpstring,
UtlBoolean  dumpMessagesAlso 
)
void getStateString ( enum transactionStates  state,
UtlString &  stateString 
)
static
void getRelationshipString ( enum messageRelationship  relationship,
UtlString &  relationshipString 
)
static
void buildHash ( const SipMessage message,
UtlBoolean  isOutgoing,
UtlString &  hash 
)
static
SipTransaction * getTopMostParent ( ) const
void getCallId ( UtlString &  callId) const
enum SipTransaction::transactionStates getState ( ) const
long getStartTime ( ) const
long getTimeStamp ( ) const
void touch ( )
void touchBelow ( int  newDate)
SipMessage * getRequest ( )
SipMessage * getLastProvisionalResponse ( )
SipMessage * getLastFinalResponse ( )
void cancel ( SipUserAgent userAgent,
SipTransactionList transactionList 
)
void markBusy ( )
void markAvailable ( )
void notifyWhenAvailable ( OsEvent *  availableEvent)
void signalNextAvailable ( )
void signalAllAvailable ( )
UtlBoolean isServerTransaction ( ) const
UtlBoolean isDnsSrvChild ( ) const

Inquiry as to whether this transaction is a recursed DNS SRV child.

UtlBoolean isUaTransaction ( ) const
UtlBoolean isChildSerial ( )
UtlBoolean isEarlyDialogWithMedia ( )
UtlBoolean isChildEarlyDialogWithMedia ( )
UtlBoolean isMethod ( const char *  methodToMatch) const
enum SipTransaction::messageRelationship whatRelation ( const SipMessage message,
UtlBoolean  isOutgoing 
) const
UtlBoolean isBusy ( )
UtlBoolean isUriChild ( Url uri)
UtlBoolean isUriRecursed ( Url uri)
UtlBoolean isUriRecursedChildren ( UtlString &  uriString)
void setTransport ( SIPX_TRANSPORT_DATA pTransport)
inline
void handleChildTimeoutEvent ( SipTransaction child,
const SipMessage outgoingMessage,
SipUserAgent userAgent,
enum messageRelationship  relationship,
SipTransactionList transactionList,
int &  nextTimeout,
SipMessage *&  delayedDispatchedMessage,
SIPX_TRANSPORT_DATA pTransport 
)
protected
UtlBoolean handleChildIncoming ( SipMessage incomingMessage,
SipUserAgent userAgent,
enum messageRelationship  relationship,
SipTransactionList transactionList,
UtlBoolean  childSaysShouldDispatch,
SipMessage *&  delayedDispatchedMessage,
SIPX_TRANSPORT_DATA pTransport 
)
protected
UtlBoolean startSequentialSearch ( SipUserAgent userAgent,
SipTransactionList transactionList,
SIPX_TRANSPORT_DATA pTransport 
)
protected

returns: TRUE/FALSE as to whether the message should be dispatched to applications

UtlBoolean recurseChildren ( SipUserAgent userAgent,
SipTransactionList transactionList 
)
protected
UtlBoolean recurseDnsSrvChildren ( SipUserAgent userAgent,
SipTransactionList transactionList,
SIPX_TRANSPORT_DATA pTransport 
)
protected
UtlBoolean findBestResponse ( SipMessage bestResponse)
protected
enum SipTransaction::messageRelationship addResponse ( SipMessage *&  response,
UtlBoolean  isOutGoing,
enum messageRelationship  relationship = MESSAGE_UNKNOWN 
)
protected
void cancelChildren ( SipUserAgent userAgent,
SipTransactionList transactionList 
)
protected
void doMarkBusy ( int  markValue)
protected

Member Data Documentation

int smTransactionNum = 0
static
UtlString smBranchIdBase
static

sipXtackLib home page