Nokia N97 SDK
Example Applications Guide

CSIPExSIPClientEstablishingState Class Reference

#include <SIPExSIPClientEstablishingState.h>

Inheritance diagram for CSIPExSIPClientEstablishingState:

CSIPExSIPStateBase List of all members.

Detailed Description

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

Definition at line 32 of file SIPExSIPClientEstablishingState.h.


Public Member Functions

virtual IMPORT_C  ~CSIPExSIPClientEstablishingState ()
void  LinkStates (CSIPExSIPStateBase &aIdleState, CSIPExSIPStateBase &aClientOfferingState, CSIPExSIPStateBase &aEstablishedState)
void  CancelInviteL (CSIPExSIPEngine &aEngine)
void  ResponseReceivedL (CSIPExSIPEngine &aEngine, CSIPClientTransaction &aTransaction)
virtual void  SendInviteL (CSIPExSIPEngine &aEngine, const TDesC8 &aSipUri)
virtual void  AcceptInviteL (CSIPExSIPEngine &aEngine)
virtual void  DeclineInviteL (CSIPExSIPEngine &aEngine)
virtual void  EndSessionL (CSIPExSIPEngine &aEngine)
virtual void  AckReceivedL (CSIPExSIPEngine &aEngine, CSIPServerTransaction &aTransaction)
virtual void  ByeReceivedL (CSIPExSIPEngine &aEngine, CSIPServerTransaction &aTransaction)
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 CSIPExSIPClientEstablishingState *  NewL ()

Private Member Functions

  CSIPExSIPClientEstablishingState ()

Private Attributes

CSIPExSIPStateBase *  iIdleState
CSIPExSIPStateBase *  iClientOfferingState
CSIPExSIPStateBase *  iEstablishedState


Constructor & Destructor Documentation

EXPORT_C CSIPExSIPClientEstablishingState::~CSIPExSIPClientEstablishingState (   )  [virtual]
 

Destructor

Definition at line 36 of file SIPExSIPClientEstablishingState.cpp.

00037         {
00038         }

CSIPExSIPClientEstablishingState::CSIPExSIPClientEstablishingState (   )  [private]
 

C++ default constructor.

Definition at line 27 of file SIPExSIPClientEstablishingState.cpp.

Referenced by NewL().

00028         {
00029         }


Member Function Documentation

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

Two-phased constructor.

Definition at line 45 of file SIPExSIPClientEstablishingState.cpp.

References CSIPExSIPClientEstablishingState().

Referenced by CSIPExSIPEngine::ConstructL().

00046         {
00047         CSIPExSIPClientEstablishingState* self =
00048                 new (ELeave) CSIPExSIPClientEstablishingState();
00049         return self;
00050         }

void CSIPExSIPClientEstablishingState::LinkStates (  CSIPExSIPStateBase &  aIdleState,
CSIPExSIPStateBase &  aClientOfferingState,
CSIPExSIPStateBase &  aEstablishedState
) 
 

Links the states

Parameters:
aIdleState  The "waiting for something to happen" state.
aClientOfferingState  Provisional response to sent invitiation is received from peer.

Definition at line 57 of file SIPExSIPClientEstablishingState.cpp.

References iClientOfferingState, iEstablishedState, and iIdleState.

Referenced by CSIPExSIPEngine::ConstructL().

00061         {
00062         iIdleState = &aIdleState;
00063         iClientOfferingState = &aClientOfferingState;
00064         iEstablishedState = &aEstablishedState;
00065         }

void CSIPExSIPClientEstablishingState::CancelInviteL (  CSIPExSIPEngine &  aEngine  )  [virtual]
 

CancelInviteL Cancel an INVITE sent previously.

Parameters:
aEngine  Reference to Engine object.

Reimplemented from CSIPExSIPStateBase.

Definition at line 72 of file SIPExSIPClientEstablishingState.cpp.

References CSIPExSIPEngine::ClientTx(), iIdleState, MSIPExSIPEngineObserver::InvitationCancelled(), CSIPExSIPEngine::Observer(), and CSIPExSIPEngine::SetCurrentState().

00073         {
00074         // Get the current Client Transaction
00075         CSIPClientTransaction& clientTA = aEngine.ClientTx();
00076 
00077         // Use it the to send CANCEL request
00078     CSIPClientTransaction* ta = clientTA.CancelL();
00079     delete ta;
00080 
00081         aEngine.SetCurrentState( iIdleState );
00082         aEngine.Observer()->InvitationCancelled();
00083         }

void CSIPExSIPClientEstablishingState::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 91 of file SIPExSIPClientEstablishingState.cpp.

References CSIPExSIPEngine::DialogAssoc(), iClientOfferingState, iEstablishedState, iIdleState, MSIPExSIPEngineObserver::InviteAcceptedByRemote(), MSIPExSIPEngineObserver::InviteDeclinedByRemote(), MSIPExSIPEngineObserver::InviteReceivedByRemote(), CSIPExSIPEngine::IPAddressFromResponseElementsL(), CSIPExSIPEngine::Observer(), and CSIPExSIPEngine::SetCurrentState().

00094         {
00095         const CSIPResponseElements* respElem = aTransaction.ResponseElements();
00096 
00097         TUint statusCode = respElem->StatusCode();
00098 
00099         if ( statusCode >= 200 && statusCode < 300 )
00100                 {
00101                 // Final Response received from network.
00102                 // Get the IP Address of the remote party from the Response Elements
00103                 const TInetAddr addr = 
00104                             aEngine.IPAddressFromResponseElementsL( *respElem );
00105                 
00106                 // Get used iap's id
00107                 TUint32 iapId( 0 );
00108                 CSIPConnection* conn = aEngine.DialogAssoc().Dialog().Connection();
00109                 if ( conn )
00110                     {
00111                     iapId = conn->IapId();
00112                     }
00113 
00114                 // Then, send ACK to remote party
00115                 CSIPInviteDialogAssoc& dialogAssoc = aEngine.DialogAssoc();
00116                 dialogAssoc.SendAckL( aTransaction );
00117 
00118 
00119                 // After ACKing, notify observer, giving IP Address and IAP id
00120                 // as parameter
00121                 aEngine.Observer()->InviteAcceptedByRemote( addr, iapId );
00122 
00123 
00124                 // Finally, change engine state
00125                 aEngine.SetCurrentState( iEstablishedState );
00126                 }
00127         else if ( statusCode >= 100 && statusCode < 200 )
00128                 {
00129                 // Provisional Response received from network.
00130                 aEngine.Observer()->InviteReceivedByRemote( statusCode );
00131                 aEngine.SetCurrentState( iClientOfferingState );
00132                 }
00133         else
00134                 {
00135                 aEngine.Observer()->InviteDeclinedByRemote( statusCode );
00136                 aEngine.SetCurrentState( iIdleState );
00137                 }
00138         }

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::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::EndSessionL (  CSIPExSIPEngine &  aEngine  )  [virtual, inherited]
 

EndSessionL Send BYE in an established session.

Parameters:
aEngine  Reference to Engine object.

Reimplemented in CSIPExSIPEstablishedState.

Definition at line 88 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::EndSessionL().

00089         {
00090         //User::Leave( KErrTotalLossOfPrecision );
00091         }

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

AckReceivedL ACK has been received.

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

Reimplemented in CSIPExSIPEstablishedState, and CSIPExSIPServerEstablishingState.

Definition at line 110 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::IncomingRequest().

00113         {
00114         //User::Leave( KErrTotalLossOfPrecision );
00115         }

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

ByeReceivedL BYE has been received.

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

Reimplemented in CSIPExSIPEstablishedState, CSIPExSIPServerEstablishingState, and CSIPExSIPServerOfferingState.

Definition at line 122 of file SIPExSIPStateBase.cpp.

Referenced by CSIPExSIPEngine::IncomingRequest().

00125         {
00126         //User::Leave( KErrTotalLossOfPrecision );
00127         }

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