Nokia N97 SDK
Example Applications Guide

CSIPExSIPIdleState Class Reference

#include <SIPExSIPIdleState.h>

Inheritance diagram for CSIPExSIPIdleState:

CSIPExSIPStateBase List of all members.

Detailed Description

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

Definition at line 32 of file SIPExSIPIdleState.h.


Public Member Functions

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

Static Public Member Functions

static IMPORT_C CSIPExSIPIdleState *  NewL ()

Private Member Functions

  CSIPExSIPIdleState ()

Private Attributes

CSIPExSIPStateBase *  iClientEstablishingState
CSIPExSIPStateBase *  iServerOfferingState


Constructor & Destructor Documentation

EXPORT_C CSIPExSIPIdleState::~CSIPExSIPIdleState (   )  [virtual]
 

Destructor

Definition at line 40 of file SIPExSIPIdleState.cpp.

00041         {
00042         }

CSIPExSIPIdleState::CSIPExSIPIdleState (   )  [private]
 

C++ default constructor.

Definition at line 31 of file SIPExSIPIdleState.cpp.

Referenced by NewL().

00032         {
00033         }


Member Function Documentation

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

Two-phased constructor.

Definition at line 49 of file SIPExSIPIdleState.cpp.

References CSIPExSIPIdleState().

Referenced by CSIPExSIPEngine::ConstructL().

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

void CSIPExSIPIdleState::LinkStates (  CSIPExSIPStateBase &  aClientEstablishingState,
CSIPExSIPStateBase &  aServerOfferingState
) 
 

Links the states

Parameters:
aClientEstablishingState  Invitation with media parameters is sent to peer.
aServerOfferingState  Invitation with media parameters is received from peer.

Definition at line 60 of file SIPExSIPIdleState.cpp.

References iClientEstablishingState, and iServerOfferingState.

Referenced by CSIPExSIPEngine::ConstructL().

00063         {
00064         iClientEstablishingState = &aClientEstablishingState;
00065         iServerOfferingState = &aServerOfferingState;
00066         }

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

SendInviteL Sends an INVITE to peer.

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

Reimplemented from CSIPExSIPStateBase.

Definition at line 72 of file SIPExSIPIdleState.cpp.

References CSIPExSIPEngine::ConnectionL(), CSIPExSIPEngine::ConvertToUri8LC(), CSIPExSIPEngine::CreateMessageElementsLC(), iClientEstablishingState, CSIPExSIPEngine::Profile(), CSIPExSIPEngine::SetClientTx(), CSIPExSIPEngine::SetCurrentState(), and CSIPExSIPEngine::SetDialogAssoc().

00075         {
00076         // Retrieve the active profile and connection
00077         CSIPProfile& prof = aEngine.Profile();
00078         CSIPConnection& conn = aEngine.ConnectionL();
00079 
00080     // Create CUri8 from passed descriptor
00081     CUri8* uri8 = aEngine.ConvertToUri8LC( aSipUri );
00082     
00083         // Get dialog association, save for future use
00084         // The ownership of uri8 is transferred
00085         CSIPInviteDialogAssoc* dialogAssoc =
00086                 CSIPInviteDialogAssoc::NewL( conn, uri8, prof );
00087         CleanupStack::Pop( uri8 );      
00088                 
00089         aEngine.SetDialogAssoc( *dialogAssoc ); //Ownership is transferred!!
00090 
00091         // Create the necessary message elements
00092         CSIPMessageElements* msgElements = aEngine.CreateMessageElementsLC();
00093 
00094         // Send the INVITE in the dialog
00095         // The ownership of msgElements is transferred
00096         CSIPClientTransaction* tx = dialogAssoc->SendInviteL( msgElements );
00097         CleanupStack::Pop( msgElements );
00098 
00099         // Save the pointer to the transaction to the Engine
00100         aEngine.SetClientTx( tx );
00101 
00102         // Change machine state
00103         aEngine.SetCurrentState( iClientEstablishingState );
00104         }

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

InviteReceivedL INVITE has been received.

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

Reimplemented from CSIPExSIPStateBase.

Definition at line 111 of file SIPExSIPIdleState.cpp.

References MSIPExSIPEngineObserver::InviteReceived(), iServerOfferingState, CSIPExSIPEngine::Observer(), CSIPExSIPEngine::Profile(), CSIPExSIPEngine::SetCurrentState(), CSIPExSIPEngine::SetDialogAssoc(), and MSIPExSIPEngineObserver::WriteLog().

00114         {
00115         _LIT8( KLogEntry, "180 Ringing sent" );
00116 
00117         // Get dialog association, save for future use
00118         CSIPInviteDialogAssoc* dialogAssoc =
00119                 CSIPInviteDialogAssoc::NewL( *aTransaction );
00120         aEngine.SetDialogAssoc( *dialogAssoc );
00121     
00122         // Create the necessary response elements and send
00123     CSIPResponseElements* elem =
00124         CSIPResponseElements::NewLC( 
00125             180, SIPStrings::StringF( SipStrConsts::EPhraseRinging ) );
00126     aTransaction->SendResponseL( elem );
00127     CleanupStack::Pop( elem );
00128         aEngine.Observer()->WriteLog( KLogEntry );
00129 
00130         // Get the From header from the request
00131         const CSIPRequestElements* reqElem = aTransaction->RequestElements();
00132         const CSIPFromHeader* fromHeader = reqElem->FromHeader();
00133         
00134         // Change machine state
00135         aEngine.SetCurrentState( iServerOfferingState );
00136 
00137     TUint32 iapId( 0 );
00138         User::LeaveIfError( 
00139                 aEngine.Profile().GetParameter( KSIPAccessPointId, iapId ) );
00140         
00141         // Send user name from the From header to the Engine Observer 
00142         // as a parameter. Send also id of used IAP.
00143         aEngine.Observer()->InviteReceived( 
00144             fromHeader->SIPAddress().Uri8().Uri().Extract( EUriUserinfo ), iapId );
00145         }

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

ResponseReceivedL A SIP response has been received from the network.

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

Reimplemented in CSIPExSIPClientEstablishingState, CSIPExSIPClientOfferingState, CSIPExSIPEstablishedState, and CSIPExSIPTerminatingState.

Definition at line 98 of file SIPExSIPStateBase.cpp.

00101         {
00102         //User::Leave( KErrTotalLossOfPrecision );
00103         }

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::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