sipexstateinviting.cpp

来自「an example for sip for symbian」· C++ 代码 · 共 79 行

CPP
79
字号
/*
* ==============================================================================
*  Name        : SIPExStateInviting.cpp
*  Part of     : SIPExEngine
*  Interface   : 
*  Description : 
*  Version     : 
*
*  Copyright (c) 2004-2006 Nokia Corporation.
*  This material, including documentation and any related 
*  computer programs, is protected by copyright controlled by 
*  Nokia Corporation.
* ==============================================================================
*/

// INCLUDES
#include    "SIPExStateInviting.h"
#include    "SIPExGameEngine.h"
#include    "SIPExSIPEngine.h"

// -----------------------------------------------------------------------------
// TSIPExStateInviting::InviteAcceptedByRemote
// Resets game, sets the peer to client and starts to connect to the remote 
// peer. The active state is changed to the Connecting
// -----------------------------------------------------------------------------
//
void TSIPExStateInviting::InviteAcceptedByRemote( 
    CSIPExEngine* aContext, 
    const TInetAddr& aIPAddress, 
    const TUint32 aIapId )
    {
    Info( aContext, K200Received() ); 
    Info( aContext, KSendingAck() ); 
    ChangeState( aContext, aContext->iStateConnecting );
    aContext->ResetGame();
    aContext->SetPeer( CSIPExEngine::EClient );
    aContext->SocketEngineL()->ConnectL( aIapId, aIPAddress );
    aContext->InfoL( KConnecting() );
    }

// -----------------------------------------------------------------------------
// TSIPExStateInviting::InviteDeclinedByRemote
// The active state is changed to the Registered and the UI is notified.
// -----------------------------------------------------------------------------
//  
void TSIPExStateInviting::InviteDeclinedByRemote( 
    CSIPExEngine* aContext, 
    const TInt aResponse )
    {
    ChangeState( aContext, aContext->iStateRegistered );
    TRAPD( ignore, 
        CombineAndShowInfoL( aContext, KInviteDeclinedByRemote(), aResponse ) );
    StatusInfo( aContext, KGameOver() );
    }

// -----------------------------------------------------------------------------
// TSIPExStateInviting::InvitationCancelled
// Notifies the UI and changes the active state to the Registered.
// -----------------------------------------------------------------------------
//          
void TSIPExStateInviting::InvitationCancelled( CSIPExEngine* aContext ) 
    {
    ChangeState( aContext, aContext->iStateRegistered );
    Info( aContext, KInvitationCancelled() );
    StatusInfo( aContext, KGameOver() );
    }

// -----------------------------------------------------------------------------
// TSIPExStateInviting::EndGameL
// The SIP session will be ended.
// -----------------------------------------------------------------------------
//
void TSIPExStateInviting::EndGameL( CSIPExEngine* aContext )
    {
    aContext->SIPEngine()->CancelInviteL();
    }
// End of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?