S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExSIPServerEstablishingState.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExSIPServerEstablishingState.cpp
00004 *  Part of     : SIPExSIPEngine
00005 *  Interface   : 
00006 *  Description : 
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2004-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 // INCLUDE FILES
00017 #include        "SIPExSIPServerEstablishingState.h"
00018 #include        "SIPExSIPEngine.h"
00019 
00020 #include <sipstrings.h>
00021 #include <SipStrConsts.h>
00022 
00023 // ============================ MEMBER FUNCTIONS ===============================
00024 
00025 // -----------------------------------------------------------------------------
00026 // CSIPExSIPServerEstablishingState::CSIPExSIPServerEstablishingState
00027 // (other items were commented in a header).
00028 // -----------------------------------------------------------------------------
00029 //
00030 CSIPExSIPServerEstablishingState::CSIPExSIPServerEstablishingState()
00031         {
00032         }
00033 
00034 // -----------------------------------------------------------------------------
00035 // CSIPExSIPServerEstablishingState::~CSIPExSIPServerEstablishingState
00036 // (other items were commented in a header).
00037 // -----------------------------------------------------------------------------
00038 //
00039 EXPORT_C CSIPExSIPServerEstablishingState::~CSIPExSIPServerEstablishingState()
00040         {
00041         }
00042 
00043 // -----------------------------------------------------------------------------
00044 // CSIPExSIPServerEstablishingState::NewL()
00045 // (other items were commented in a header).
00046 // -----------------------------------------------------------------------------
00047 //
00048 EXPORT_C CSIPExSIPServerEstablishingState* CSIPExSIPServerEstablishingState::NewL()
00049         {
00050         CSIPExSIPServerEstablishingState* self =
00051                 new (ELeave) CSIPExSIPServerEstablishingState();
00052         return self;
00053         }
00054 
00055 // -----------------------------------------------------------------------------
00056 // CSIPExSIPServerEstablishingState::LinkStates()
00057 // (other items were commented in a header).
00058 // -----------------------------------------------------------------------------
00059 //
00060 void CSIPExSIPServerEstablishingState::LinkStates(
00061         CSIPExSIPStateBase& aEstablishedState,
00062         CSIPExSIPStateBase& aTerminatedState )
00063         {
00064         iEstablishedState = &aEstablishedState;
00065         iTerminatedState = &aTerminatedState;
00066         }
00067         
00068 // -----------------------------------------------------------------------------
00069 // CSIPExSIPServerEstablishingState::ByeReceivedL()
00070 // (other items were commented in a header).
00071 // -----------------------------------------------------------------------------
00072 void CSIPExSIPServerEstablishingState::ByeReceivedL(
00073         CSIPExSIPEngine& aEngine,
00074         CSIPServerTransaction& aTransaction )
00075         {
00076         // Create and send response
00077     CSIPResponseElements* elem = 
00078         CSIPResponseElements::NewLC( 
00079             200, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
00080     aTransaction.SendResponseL( elem );
00081     CleanupStack::Pop( elem );
00082 
00083         // Inform observer
00084         aEngine.Observer()->SessionEnded();
00085         
00086         // Set state
00087         aEngine.SetCurrentState( iTerminatedState );
00088         }
00089 
00090 // -----------------------------------------------------------------------------
00091 // CSIPExSIPServerEstablishingState::CancelReceivedL()
00092 // (other items were commented in a header).
00093 // -----------------------------------------------------------------------------
00094 void CSIPExSIPServerEstablishingState::CancelReceivedL(
00095         CSIPExSIPEngine& aEngine,
00096         CSIPClientTransaction& /*aTransaction */ )
00097         {
00098         aEngine.Observer()->SessionEnded();
00099         aEngine.SetCurrentState( iTerminatedState );
00100         }
00101 
00102 // -----------------------------------------------------------------------------
00103 // CSIPExSIPServerEstablishingState::AckReceivedL()
00104 // (other items were commented in a header).
00105 // -----------------------------------------------------------------------------
00106 void CSIPExSIPServerEstablishingState::AckReceivedL(
00107         CSIPExSIPEngine& aEngine,
00108         CSIPServerTransaction& /* aTransaction */ )
00109         {
00110         aEngine.Observer()->InviteAcceptedByUs();
00111         aEngine.SetCurrentState( iEstablishedState );
00112         }
00113 
00114 // End of file

© Nokia 2006

Back to top