📄 session.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*************************************************************************
Disclaimer:
This code and information is provided "as is" without warranty of
any kind, either expressed or implied, including but not limited to
the implied warranties of merchantability and/or fitness for a
particular purpose.
Module Name:
Session.h
Abstract:
CSession class definitions. CSession is a wrapper for IRTCSession
that internalizes much of the error handling and session information.
Notes:
**************************************************************************/
#ifndef _SESSION_H_
#define _SESSION_H_
#include "rtcinternal.h"
class CSession
{
public:
// Constructors
CSession();
CSession( IRTCSession* pSess, SWCB_FN_PTR fnSWCB );
CSession( SWCB_FN_PTR fnSWCB );
CSession( IRTCSession* pSess, RTC_SESSION_TYPE enRST, RTC_SESSION_STATE enRSS, SWCB_FN_PTR fnSWCB );
// Destructor
~CSession();
// RTC related functions
HRESULT OpenIMSession( IN P_PARTICIPANT_INFO pPart, OUT HANDLE& hSession);
HRESULT OpenVoiceSession( IN P_PARTICIPANT_INFO pPart, RTC_SESSION_TYPE enRST, OUT HANDLE& hSession );
BOOL AddParticipantToSession( IN P_PARTICIPANT_INFO pPartInfo, IN FARPROC fnSWCB);
BOOL SendIM( P_IM_MSG msg );
BOOL Hangup( RTC_TERMINATE_REASON enReason = RTCTR_NORMAL );
BOOL Reject();
BOOL Accept();
// Class functions
VOID Clear();
// accessor functions
IRTCSession* get_Session();
VOID put_Session( IRTCSession* pSess );
RTC_SESSION_TYPE get_SessionType();
VOID put_SessionType( RTC_SESSION_TYPE enRST );
RTC_SESSION_STATE get_SessionState();
VOID put_SessionState( RTC_SESSION_STATE enRSS );
// for all the participant related info:
BSTR get_ParticipantName( IRTCParticipant* pPart);
BSTR get_ParticipantIpAddr(IRTCParticipant* pPart);
P_PARTICIPANT_INFO get_ParticipantInfo( IRTCParticipant* pPart);
BOOL put_LocalPhoneURI( IN BSTR bstrLocalPhoneURI, IN BOOL bRealloc = TRUE );
BOOL isValid();
SWCB_FN_PTR get_SWCBfn();
VOID put_SWCBfn( IN FARPROC fnSWCB);
private:
HRESULT m_NewSession(HANDLE& hSess);
VOID m_Init();
BOOL m_Valid;
RTC_SESSION_STATE m_enRSS;
RTC_SESSION_TYPE m_enRST;
IRTCSession* m_pSess;
PARTICIPANT_INFO m_sPartInfo;
IRTCProfile* m_pProfile;
BSTR m_bstrRemoteURI;
LONG m_lSessionFlags;
BSTR m_bstrLocalPhoneURI;
SWCB_FN_PTR m_fnSWCB;
};
#endif _SESSION_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -