Nokia N97 SDK
Example Applications Guide

CSIPExSIPEstablishedState Class Reference

#include <SIPExSIPEstablishedState.h>

Inheritance diagram for CSIPExSIPEstablishedState:

CSIPExSIPStateBase List of all members.

Detailed Description

Reacts to events that are possible in "Established" state.

Definition at line 32 of file SIPExSIPEstablishedState.h.


Public Member Functions

virtual IMPORT_C  ~CSIPExSIPEstablishedState ()
void  LinkStates (CSIPExSIPStateBase &aTerminatingState, CSIPExSIPStateBase &aTerminatedState)
void  EndSessionL (CSIPExSIPEngine &aEngine)
void  ByeReceivedL (CSIPExSIPEngine &aEngine, CSIPServerTransaction &aTransaction)
void  ResponseReceivedL (CSIPExSIPEngine &aEngine, CSIPClientTransaction &aTransaction)
void  AckReceivedL (CSIPExSIPEngine &aEngine, CSIPServerTransaction &aTransaction)
virtual void  SendInviteL (CSIPExSIPEngine &aEngine, const TDesC8 &aSipUri)
virtual void  CancelInviteL (CSIPExSIPEngine &aEngine)
virtual void  AcceptInviteL (CSIPExSIPEngine &aEngine)
virtual void  DeclineInviteL (CSIPExSIPEngine &aEngine)
virtual void  CancelReceivedL (CSIPExSIPEngine &aEngine, CSIPClientTransaction &aTransaction)
virtual void  InviteReceivedL (CSIPExSIPEngine &aEngine, CSIPServerTransaction *aTransaction)
virtual void  ErrorOccured (CSIPExSIPEngine &aEngine, TInt aError)

Static Public Member Functions

static IMPORT_C CSIPExSIPEstablishedState *  NewL ()

Private Member Functions

  CSIPExSIPEstablishedState ()

Private Attributes

CSIPExSIPStateBase *  iTerminatingState
CSIPExSIPStateBase *  iTerminatedState


Constructor & Destructor Documentation

EXPORT_C CSIPExSIPEstablishedState::~CSIPExSIPEstablishedState (   )  [virtual]
 

Destructor

Definition at line 39 of file SIPExSIPEstablishedState.cpp.

00040         {
00041         }

CSIPExSIPEstablishedState::CSIPExSIPEstablishedState (   )  [private]
 

C++ default constructor.

Definition at line 30 of file SIPExSIPEstablishedState.cpp.

Referenced by NewL().

00031         {
00032         }


Member Function Documentation

EXPORT_C CSIPExSIPEstablishedState * CSIPExSIPEstablishedState::NewL (   )  [static]
 

Two-phased constructor.

Definition at line 48 of file SIPExSIPEstablishedState.cpp.

References CSIPExSIPEstablishedState().

Referenced by CSIPExSIPEngine::ConstructL().

00049         {
00050         CSIPExSIPEstablishedState* self =
00051                 new (ELeave) CSIPExSIPEstablishedState();
00052         return self;
00053         }

void CSIPExSIPEstablishedState::LinkStates (  CSIPExSIPStateBase &  aTerminatingState,
CSIPExSIPStateBase &  aTerminatedState
) 
 

Links the states

Parameters:
aTerminatingState  BYE sent, waiting for response.
aTerminatedState  SIP Session has been ended.

Definition at line 60 of file SIPExSIPEstablishedState.cpp.

References iTerminatedState, and iTerminatingState.

Referenced by CSIPExSIPEngine::ConstructL().

00063         {
00064         iTerminatingState = &aTerminatingState;
00065         iTerminatedState = &aTerminatedState;
00066         }

void CSIPExSIPEstablishedState::EndSessionL (  CSIPExSIPEngine &  aEngine  )  [virtual]
 

EndSessionL Send BYE in an established session.

Parameters:
aEngine  Reference to Engine object.

Reimplemented from CSIPExSIPStateBase.

Definition at line 73 of file SIPExSIPEstablishedState.cpp.

References CSIPExSIPEngine::CreateMessageElementsLC(), CSIPExSIPEngine::DialogAssoc(), iTerminatingState, CSIPExSIPEngine::SetClientTx(), and CSIPExSIPEngine::SetCurrentState().

00074         {
00075         // Get the current Dialog Association
00076         CSIPInviteDialogAssoc& dialogAssoc = aEngine.DialogAssoc();
00077         // Create the Message Elements object
00078         CSIPMessageElements* msgElements = aEngine.CreateMessageElementsLC();
00079 
00080         // Use the Dialog Association to send BYE request
00081         CSIPClientTransaction* tx = dialogAssoc.SendByeL( msgElements );
00082         aEngine.SetClientTx( tx );
00083 
00084         CleanupStack::Pop( msgElements );
00085 
00086         aEngine.SetCurrentState( iTerminatingState );
00087         }

void CSIPExSIPEstablishedState::ByeReceivedL (  CSIPExSIPEngine &  aEngine,
CSIPServerTransaction &  aTransaction
)  [virtual]
 

ByeReceivedL BYE has been received.

Parameters:
aEngine  Reference to Engine object.
aTransaction  Contains response elements.

Reimplemented from CSIPExSIPStateBase.

Definition at line 94 of file SIPExSIPEstablishedState.cpp.

References iTerminatedState, CSIPExSIPEngine::Observer(), MSIPExSIPEngineObserver::SessionEnded(), and CSIPExSIPEngine::SetCurrentState().

00097         {
00098         // Create and send response
00099     CSIPResponseElements* elem = 
00100         CSIPResponseElements::NewLC( 
00101             200, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
00102     aTransaction.SendResponseL( elem );
00103     CleanupStack::Pop( elem );
00104 
00105         // Inform observer
00106         aEngine.Observer()->SessionEnded();
00107 
00108         // Set state ???
00109         aEngine.SetCurrentState( iTerminatedState );
00110         }

void CSIPExSIPEstablishedState::ResponseReceivedL (  CSIPExSIPEngine &  aEngine,
CSIPClientTransaction &  aTransaction
)  [virtual]
 

ResponseReceivedL A SIP response has been received from the network.

Parameters:
aEngine  Reference to Engine object.
aTransaction  Contains response elements.

Reimplemented from CSIPExSIPStateBase.

Definition at line 117 of file SIPExSIPEstablishedState.cpp.

References CSIPExSIPEngine::DialogAssoc(), MSIPExSIPEngineObserver::EngineError(), and CSIPExSIPEngine::Observer().

00120         {
00121         // We might receive some 200 (OK) responses from the network
00122         // after the session has been established. These should be
00123         // ACKed, other responses indicate errors.
00124 
00125         const CSIPResponseElements* respElem = aTransaction.ResponseElements();
00126 
00127         TUint statusCode = respElem->StatusCode();
00128 
00129         if ( statusCode >= 200 && statusCode < 300 )
00130                 {
00131                 // Send ACK to remote party
00132                 CSIPInviteDialogAssoc& dialogAssoc = aEngine.DialogAssoc();
00133                 dialogAssoc.SendAckL( aTransaction );
00134                 }
00135         else
00136                 {
00137                 aEngine.Observer()->EngineError( statusCode );
00138                 }
00139         }

void CSIPExSIPEstablishedState::AckReceivedL (  CSIPExSIPEngine &  aEngine,
CSIPServerTransaction &  aTransaction
)  [virtual]
 

AckReceivedL ACK has been received.

Parameters:
aEngine  Reference to Engine object.
aTransaction  Contains response elements.

Reimplemented from CSIPExSIPStateBase.

Definition at line 146 of file SIPExSIPEstablishedState.cpp.

References MSIPExSIPEngineObserver::InviteAcceptedByUs(), and CSIPExSIPEngine::Observer().

00149         {
00150         aEngine.Observer()->InviteAcceptedByUs();
00151         }

void CSIPExSIPStateBase::SendInviteL (  CSIPExSIPEngine &  aEngine,
const TDesC8 &  aSipUri
)  [virtual, inherited]
 

SendInviteL Sends an INVITE to peer.

Parameters:
aEngine  Reference to SIP Engine.
aSipUri  uri of recipient.

Reimplemented in CSIPExSIPIdleState.

Definition at line 43 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::SendInviteL().

00046         {
00047         //User::Leave( KErrTotalLossOfPrecision );
00048         }

void CSIPExSIPStateBase::CancelInviteL (  CSIPExSIPEngine &  aEngine  )  [virtual, inherited]
 

CancelInviteL Cancel an INVITE sent previously.

Parameters:
aEngine  Reference to Engine object.

Reimplemented in CSIPExSIPClientEstablishingState, and CSIPExSIPClientOfferingState.

Definition at line 54 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::CancelInviteL().

00056         {
00057         //User::Leave( KErrTotalLossOfPrecision );
00058         }

void CSIPExSIPStateBase::AcceptInviteL (  CSIPExSIPEngine &  aEngine  )  [virtual, inherited]
 

AcceptInviteL Send 200 (OK) as response to an INVITE received from peer.

Parameters:
aEngine  Reference to Engine object.

Reimplemented in CSIPExSIPServerOfferingState.

Definition at line 65 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::AcceptInviteL().

00067         {
00068         //User::Leave( KErrTotalLossOfPrecision );
00069         }

void CSIPExSIPStateBase::DeclineInviteL (  CSIPExSIPEngine &  aEngine  )  [virtual, inherited]
 

DeclineInviteL Send 486 (Busy Here) as response to an INVITE received from peer.

Parameters:
aEngine  Reference to Engine object.

Reimplemented in CSIPExSIPServerOfferingState.

Definition at line 76 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::DeclineInviteL().

00078         {
00079         //User::Leave( KErrTotalLossOfPrecision );
00080         }

void CSIPExSIPStateBase::CancelReceivedL (  CSIPExSIPEngine &  aEngine,
CSIPClientTransaction &  aTransaction
)  [virtual, inherited]
 

CancelReceivedL CANCEL has been received.

Parameters:
aEngine  Reference to Engine object.
aTransaction  Contains response elements.

Reimplemented in CSIPExSIPServerEstablishingState, and CSIPExSIPServerOfferingState.

Definition at line 134 of file SIPExSIPStateBase.cpp.

00137         {
00138         //User::Leave( KErrTotalLossOfPrecision );
00139         }

void CSIPExSIPStateBase::InviteReceivedL (  CSIPExSIPEngine &  aEngine,
CSIPServerTransaction *  aTransaction
)  [virtual, inherited]
 

InviteReceivedL INVITE has been received.

Parameters:
aEngine  Reference to Engine object.
aTransaction  Contains response elements. The ownership is transferred.

Reimplemented in CSIPExSIPIdleState.

Definition at line 146 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::IncomingRequest().

00149         {
00150         //User::Leave( KErrTotalLossOfPrecision );
00151         }

void CSIPExSIPStateBase::ErrorOccured (  CSIPExSIPEngine &  aEngine,
TInt  aError
)  [virtual, inherited]
 

An asynchronous error has occured related to a periodical refresh that relates to a registration.

Parameters:
aEngine  Reference to Engine object.
aError  error code
aSIPRegistration  associated registration

Definition at line 159 of file SIPExSIPStateBase.cpp.

00162         {
00163         }


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top