📄 tapiconn.h
字号:
//-----------------------------------------------------------------------
// Copyright (c) 2002 Avaya Global SME Solutions
//-----------------------------------------------------------------------
// Project name: TAPI 3 Test Harness
// Module file : TAPIConn.h
// Compiler : Visual C++ 6.0
//-----------------------------------------------------------------------
// Description :
// This class handles Windows TAPI connection and represents the
// TAPI services.
//-----------------------------------------------------------------------
#if !defined(_TAPICONN_H)
#define _TAPICONN_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TAPIAddr.h"
#include "TAPIEventNotification.h"
#define TAPI3_EVENTS TE_ADDRESS|TE_CALLNOTIFICATION|TE_CALLSTATE|TE_CALLINFOCHANGE
class CTAPIConn
{
public:
CTAPIConn();
virtual ~CTAPIConn();
// Handle used by TAPI to notify the main app when a TAPI event has occured.
static HANDLE m_hEventHandle;
// Handle of the TAPI LineApp, Session identifier to TAPI.
static HLINEAPP m_hLineApp;
// Methods
// Initialise the TAPI subsystem
// return True if TAPI was successfully opened and all line opened. false otherwise.
bool Init();
// Shutdown the TAPI subsystem
// Always return true
bool DeInit();
static CString GetASCIITAPIError(long lError);
// New Stuff starts here
// Helper Functions
static void GetCallerAddress(ITCallInfo* pInfo, CString& sAddr);
static void GetCalledAddress(ITCallInfo* pInfo, CString& sAddr);
static void GetAddressName(ITCallInfo *pInfo, CString& sAddr);
static void GetRedirectionAddress(ITCallInfo* pInfo, CString& sAddr);
static void GetRedirectingAddress(ITCallInfo* pInfo, CString& sAddr);
static void GetDialableAddress(ITCallInfo* pInfo, CString& sAddr);
// Debug Functions
static void GetASCIIMediaType(long& Type, CString& T);
static void GetASCIICallReason(long dwReason, CString& sReason);
static void GetASCIICallState(CALL_STATE cState, CString& sState);
static void GetASCIICallOrigin(long dwOrigin, CString& sOrigin);
static void GetASCIICallInfoChange(CALLINFOCHANGE_CAUSE Cause, CString& sCause);
static void GetASCIICallHubEvent(CALLHUB_EVENT Event, CString& sEvent);
static void GetASCIICallStateEventCause(CALL_STATE_EVENT_CAUSE cause, CString& sCause);
private:
// Boolean variable maintains the initialisation state of TAPI
bool m_bInit;
// Number of line devices available
DWORD m_dwNumDevs;
// Negotiated TAPI Version
DWORD m_dwTAPIVersion;
long OpenAllAddresses();
// New stuff starts here...
ITTAPI* m_pTAPI3;
CTAPIEventNotification* m_pTAPIEventNotify;
ULONG m_ulAdviseCookie;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -