#ifndef _TSPI_H
#define _TSPI_H

/* Telephony Service Provider Interface (TSPI) definitions */

#include <windows.h>

#include "tapi.h"

#if WIN32
#if TAPI_CURRENT_VERSION < 0x00020000
#error Building a 32bit 1.3 or 1.4 service provider is not supported.
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DECLARE_OPAQUE
#define DECLARE_OPAQUE(name)  struct name##__ { int unused; }; typedef const struct name##__ * name
#endif

#ifndef TSPIAPI
#define TSPIAPI PASCAL
#endif

DECLARE_OPAQUE(HDRVCALL);
DECLARE_OPAQUE(HDRVLINE);
DECLARE_OPAQUE(HDRVPHONE);
DECLARE_OPAQUE(HDRVDIALOGINSTANCE);
DECLARE_OPAQUE(HDRVMSPLINE);

typedef HDRVCALL *LPHDRVCALL;
typedef HDRVLINE *LPHDRVLINE;
typedef HDRVPHONE *LPHDRVPHONE;
typedef HDRVDIALOGINSTANCE *LPHDRVDIALOGINSTANCE;
typedef HDRVMSPLINE *LPHDRVMSPLINE;

DECLARE_OPAQUE(HTAPICALL);
DECLARE_OPAQUE(HTAPILINE);
DECLARE_OPAQUE(HTAPIPHONE);
DECLARE_OPAQUE(HTAPIDIALOGINSTANCE);
DECLARE_OPAQUE(HTAPIMSPLINE);

typedef HTAPICALL *LPHTAPICALL;
typedef HTAPILINE *LPHTAPILINE;
typedef HTAPIPHONE *LPHTAPIPHONE;
typedef HTAPIDIALOGINSTANCE *LPHTAPIDIALOGINSTANCE;
typedef HTAPIMSPLINE *LPHTAPIMSPLINE;

DECLARE_OPAQUE(HPROVIDER);

typedef HPROVIDER *LPHPROVIDER;
typedef DWORD DRV_REQUESTID;

typedef void (CALLBACK *ASYNC_COMPLETION)(DRV_REQUESTID,LONG);
typedef void (CALLBACK *LINEEVENT)(HTAPILINE,HTAPICALL,DWORD,DWORD_PTR,DWORD_PTR,DWORD_PTR);
typedef void (CALLBACK *PHONEEVENT)(HTAPIPHONE,DWORD,DWORD_PTR,DWORD_PTR,DWORD_PTR);
typedef LONG(CALLBACK *TUISPIDLLCALLBACK)(DWORD_PTR,DWORD,LPVOID,DWORD);

#if (TAPI_CURRENT_VERSION >= 0x00020000)
typedef struct tuispicreatedialoginstanceparams_tag {
    DRV_REQUESTID dwRequestID;
    HDRVDIALOGINSTANCE hdDlgInst;
    HTAPIDIALOGINSTANCE htDlgInst;
    LPCWSTR lpszUIDLLName;
    LPVOID lpParams;
    DWORD dwSize;
} TUISPICREATEDIALOGINSTANCEPARAMS, *LPTUISPICREATEDIALOGINSTANCEPARAMS;
#endif /* TAPI_CURRENT_VERSION >= 0x00020000 */

#if (TAPI_CURRENT_VERSION >= 0x00030000)

#define LINEQOSSTRUCT_KEY  ((DWORD)'LQSK')

typedef struct LINEQOSSERVICELEVEL_tag {
    DWORD dwMediaMode;
    DWORD dwQOSServiceLevel;
} LINEQOSSERVICELEVEL, *LPLINEQOSSERVICELEVEL;

typedef struct LINECALLQOSINFO_tag {
    DWORD dwKey;
    DWORD dwTotalSize;
    DWORD dwQOSRequestType;
    union {
        struct {
            DWORD dwNumServiceLevelEntries;
            LINEQOSSERVICELEVEL LineQOSServiceLevel[1];
        } SetQOSServiceLevel;
    };
} LINECALLQOSINFO, *LPLINECALLQOSINFO;

EXTERN_C const CLSID TAPIPROTOCOL_PSTN;
EXTERN_C const CLSID TAPIPROTOCOL_H323;
EXTERN_C const CLSID TAPIPROTOCOL_Multicast;

#endif /* TAPI_CURRENT_VERSION >= 0x00030000 */

#define TSPI_MESSAGE_BASE 500

#define LINE_NEWCALL  ((long)TSPI_MESSAGE_BASE+0)
#define LINE_CALLDEVSPECIFIC  ((long)TSPI_MESSAGE_BASE+1)
#define LINE_CALLDEVSPECIFICFEATURE  ((long)TSPI_MESSAGE_BASE+2)
#if (TAPI_CURRENT_VERSION >= 0x00020000)
#define LINE_CREATEDIALOGINSTANCE  ((long)TSPI_MESSAGE_BASE+3)
#define LINE_SENDDIALOGINSTANCEDATA  ((long)TSPI_MESSAGE_BASE+4)
#endif
#if (TAPI_CURRENT_VERSION >= 0x00030000)
#define LINE_SENDMSPDATA  ((long)TSPI_MESSAGE_BASE+5)
#define LINE_QOSINFO  ((long)TSPI_MESSAGE_BASE+6)
#endif

#if (TAPI_CURRENT_VERSION >= 0x00020000)
#define LINETSPIOPTION_NONREENTRANT  0x00000001
#endif

#if (TAPI_CURRENT_VERSION >= 0x00020000)
#define TUISPIDLL_OBJECT_LINEID  1L
#define TUISPIDLL_OBJECT_PHONEID  2L
#define TUISPIDLL_OBJECT_PROVIDERID  3L
#define TUISPIDLL_OBJECT_DIALOGINSTANCE  4L
#endif

#if (TAPI_CURRENT_VERSION >= 0x00030000)
#define PRIVATEOBJECT_NONE  0x00000001
#define PRIVATEOBJECT_CALLID  0x00000002
#define PRIVATEOBJECT_LINE  0x00000003
#define PRIVATEOBJECT_CALL  0x00000004
#define PRIVATEOBJECT_PHONE  0x00000005
#define PRIVATEOBJECT_ADDRESS  0x00000006

#define LINEQOSREQUESTTYPE_SERVICELEVEL  0x00000001

#define LINEQOSSERVICELEVEL_NEEDED  0x00000001
#define LINEQOSSERVICELEVEL_IFAVAILABLE  0x00000002
#define LINEQOSSERVICELEVEL_BESTEFFORT  0x00000003

#define LINEEQOSINFO_NOQOS  0x00000001
#define LINEEQOSINFO_ADMISSIONFAILURE  0x00000002
#define LINEEQOSINFO_POLICYFAILURE  0x00000003
#define LINEEQOSINFO_GENERICERROR  0x00000004
#endif /* TAPI_CURRENT_VERSION >= 0x00030000 */

LONG TSPIAPI TSPI_lineAccept(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineAddToConference(DRV_REQUESTID,HDRVCALL,HDRVCALL);
LONG TSPIAPI TSPI_lineAnswer(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineClose(HDRVLINE);
LONG TSPIAPI TSPI_lineCloseCall(HDRVCALL);
LONG TSPIAPI TSPI_lineCompleteCall(DRV_REQUESTID,HDRVCALL,LPDWORD,DWORD,DWORD);
LONG TSPIAPI TSPI_lineCompleteTransfer(DRV_REQUESTID,HDRVCALL,HDRVCALL,HTAPICALL,LPHDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineConditionalMediaDetection(HDRVLINE,DWORD,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_lineDevSpecific(DRV_REQUESTID,HDRVLINE,DWORD,HDRVCALL,LPVOID,DWORD);
LONG TSPIAPI TSPI_lineDevSpecificFeature(DRV_REQUESTID,HDRVLINE,DWORD,LPVOID,DWORD);
LONG TSPIAPI TSPI_lineDrop(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineDropOnClose(HDRVCALL);
LONG TSPIAPI TSPI_lineDropNoOwner(HDRVCALL);
LONG TSPIAPI TSPI_lineForward(DRV_REQUESTID,HDRVLINE,DWORD,DWORD,LPLINEFORWARDLIST const,DWORD,HTAPICALL,LPHDRVCALL,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_lineGenerateTone(HDRVCALL,DWORD,DWORD,DWORD,DWORD,LPLINEGENERATETONE const);
LONG TSPIAPI TSPI_lineGetAddressCaps(DWORD,DWORD,DWORD,DWORD,LPLINEADDRESSCAPS);
LONG TSPIAPI TSPI_lineGetAddressStatus(HDRVLINE,DWORD,LPLINEADDRESSSTATUS);
LONG TSPIAPI TSPI_lineGetCallAddressID(HDRVCALL,LPDWORD);
LONG TSPIAPI TSPI_lineGetCallInfo(HDRVCALL,LPLINECALLINFO);
LONG TSPIAPI TSPI_lineGetCallStatus(HDRVCALL,LPLINECALLSTATUS);
LONG TSPIAPI TSPI_lineGetDevCaps(DWORD,DWORD,DWORD,LPLINEDEVCAPS);
LONG TSPIAPI TSPI_lineGetExtensionID(DWORD,DWORD,LPLINEEXTENSIONID);
LONG TSPIAPI TSPI_lineGetLineDevStatus(HDRVLINE,LPLINEDEVSTATUS);
LONG TSPIAPI TSPI_lineGetNumAddressIDs(HDRVLINE,LPDWORD);
LONG TSPIAPI TSPI_lineHold(DRV_REQUESTID,HDRVCALL);
LONG TSPIAPI TSPI_lineMonitorDigits(HDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineMonitorMedia(HDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineMonitorTones(HDRVCALL,DWORD,LPLINEMONITORTONE const,DWORD);
LONG TSPIAPI TSPI_lineNegotiateExtVersion(DWORD,DWORD,DWORD,DWORD,LPDWORD);
LONG TSPIAPI TSPI_lineNegotiateTSPIVersion(DWORD,DWORD,DWORD,LPDWORD);
LONG TSPIAPI TSPI_lineOpen(DWORD,HTAPILINE,LPHDRVLINE,DWORD,LINEEVENT);
LONG TSPIAPI TSPI_linePrepareAddToConference(DRV_REQUESTID,HDRVCALL,HTAPICALL,LPHDRVCALL,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_lineReleaseUserUserInfo(DRV_REQUESTID,HDRVCALL);
LONG TSPIAPI TSPI_lineRemoveFromConference(DRV_REQUESTID,HDRVCALL);
LONG TSPIAPI TSPI_lineSecureCall(DRV_REQUESTID,HDRVCALL);
LONG TSPIAPI TSPI_lineSelectExtVersion(HDRVLINE,DWORD);
LONG TSPIAPI TSPI_lineSendUserUserInfo(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineSetAppSpecific(HDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineSetCallParams(DRV_REQUESTID,HDRVCALL,DWORD,DWORD,DWORD,LPLINEDIALPARAMS const);
LONG TSPIAPI TSPI_lineSetCurrentLocation(DWORD);
LONG TSPIAPI TSPI_lineSetDefaultMediaDetection(HDRVLINE,DWORD);
LONG TSPIAPI TSPI_lineSetMediaControl(HDRVLINE,DWORD,HDRVCALL,DWORD,LPLINEMEDIACONTROLDIGIT const,DWORD,LPLINEMEDIACONTROLMEDIA const,DWORD,LPLINEMEDIACONTROLTONE const,DWORD,LPLINEMEDIACONTROLCALLSTATE const,DWORD);
LONG TSPIAPI TSPI_lineSetMediaMode(HDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineSetStatusMessages(HDRVLINE,DWORD,DWORD);
LONG TSPIAPI TSPI_lineSetTerminal(DRV_REQUESTID,HDRVLINE,DWORD,HDRVCALL,DWORD,DWORD,DWORD,DWORD);
LONG TSPIAPI TSPI_lineSetupConference(DRV_REQUESTID,HDRVCALL,HDRVLINE,HTAPICALL,LPHDRVCALL,HTAPICALL,LPHDRVCALL,DWORD,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_lineSetupTransfer(DRV_REQUESTID,HDRVCALL,HTAPICALL,LPHDRVCALL,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_lineSwapHold(DRV_REQUESTID,HDRVCALL,HDRVCALL);
LONG TSPIAPI TSPI_lineUncompleteCall(DRV_REQUESTID,HDRVLINE,DWORD);
LONG TSPIAPI TSPI_lineUnhold(DRV_REQUESTID,HDRVCALL);
LONG TSPIAPI TSPI_phoneClose(HDRVPHONE);
LONG TSPIAPI TSPI_phoneDevSpecific(DRV_REQUESTID,HDRVPHONE,LPVOID,DWORD);
LONG TSPIAPI TSPI_phoneGetButtonInfo(HDRVPHONE,DWORD,LPPHONEBUTTONINFO);
LONG TSPIAPI TSPI_phoneGetData(HDRVPHONE,DWORD,LPVOID,DWORD);
LONG TSPIAPI TSPI_phoneGetDevCaps(DWORD,DWORD,DWORD,LPPHONECAPS);
LONG TSPIAPI TSPI_phoneGetDisplay(HDRVPHONE,LPVARSTRING);
LONG TSPIAPI TSPI_phoneGetExtensionID(DWORD,DWORD,LPPHONEEXTENSIONID);
LONG TSPIAPI TSPI_phoneGetGain(HDRVPHONE,DWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneGetHookSwitch(HDRVPHONE,LPDWORD);
LONG TSPIAPI TSPI_phoneGetLamp(HDRVPHONE,DWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneGetRing(HDRVPHONE,LPDWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneGetStatus(HDRVPHONE,LPPHONESTATUS);
LONG TSPIAPI TSPI_phoneGetVolume(HDRVPHONE,DWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneNegotiateExtVersion(DWORD,DWORD,DWORD,DWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneNegotiateTSPIVersion(DWORD,DWORD,DWORD,LPDWORD);
LONG TSPIAPI TSPI_phoneOpen(DWORD,HTAPIPHONE,LPHDRVPHONE,DWORD,PHONEEVENT);
LONG TSPIAPI TSPI_phoneSelectExtVersion(HDRVPHONE,DWORD);
LONG TSPIAPI TSPI_phoneSetButtonInfo(DRV_REQUESTID,HDRVPHONE,DWORD,LPPHONEBUTTONINFO const);
LONG TSPIAPI TSPI_phoneSetData(DRV_REQUESTID,HDRVPHONE,DWORD,LPVOID const,DWORD);
LONG TSPIAPI TSPI_phoneSetGain(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD);
LONG TSPIAPI TSPI_phoneSetHookSwitch(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD);
LONG TSPIAPI TSPI_phoneSetLamp(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD);
LONG TSPIAPI TSPI_phoneSetRing(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD);
LONG TSPIAPI TSPI_phoneSetStatusMessages(HDRVPHONE,DWORD,DWORD,DWORD);
LONG TSPIAPI TSPI_phoneSetVolume(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD);
LONG TSPIAPI TSPI_providerConfig(HWND,DWORD);
LONG TSPIAPI TSPI_providerCreateLineDevice(DWORD_PTR,DWORD);
LONG TSPIAPI TSPI_providerCreatePhoneDevice(DWORD_PTR,DWORD);
LONG TSPIAPI TSPI_providerEnumDevices(DWORD,LPDWORD,LPDWORD,HPROVIDER,LINEEVENT,PHONEEVENT);
LONG TSPIAPI TSPI_providerInstall(HWND,DWORD);
LONG TSPIAPI TSPI_providerRemove(HWND,DWORD);

#if (TAPI_CURRENT_VERSION >= 0x00020000)
LONG TSPIAPI TSPI_lineBlindTransfer(DRV_REQUESTID,HDRVCALL,LPCWSTR,DWORD);
LONG TSPIAPI TSPI_lineDial(DRV_REQUESTID,HDRVCALL,LPCWSTR,DWORD);
LONG TSPIAPI TSPI_lineGatherDigits(HDRVCALL,DWORD,DWORD,LPWSTR,DWORD,LPCWSTR,DWORD,DWORD);
LONG TSPIAPI TSPI_lineGenerateDigits(HDRVCALL,DWORD,DWORD,LPCWSTR,DWORD);
LONG TSPIAPI TSPI_lineGetAddressID(HDRVLINE,LPDWORD,DWORD,LPCWSTR,DWORD);
LONG TSPIAPI TSPI_lineGetDevConfig(DWORD,LPVARSTRING,LPCWSTR);
LONG TSPIAPI TSPI_lineGetIcon(DWORD,LPCWSTR,LPHICON);
LONG TSPIAPI TSPI_lineGetID(HDRVLINE,DWORD,HDRVCALL,DWORD,LPVARSTRING,LPCWSTR,HANDLE);
LONG TSPIAPI TSPI_lineMakeCall(DRV_REQUESTID,HDRVLINE,HTAPICALL,LPHDRVCALL,LPCWSTR,DWORD,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_linePark(DRV_REQUESTID,HDRVCALL,DWORD,LPCWSTR,LPVARSTRING);
LONG TSPIAPI TSPI_linePickup(DRV_REQUESTID,HDRVLINE,DWORD,HTAPICALL,LPHDRVCALL,LPCWSTR,LPCWSTR);
LONG TSPIAPI TSPI_lineRedirect(DRV_REQUESTID,HDRVCALL,LPCWSTR,DWORD);
LONG TSPIAPI TSPI_lineSetDevConfig(DWORD,LPVOID const,DWORD,LPCWSTR);
LONG TSPIAPI TSPI_lineUnpark(DRV_REQUESTID,HDRVLINE,DWORD,HTAPICALL,LPHDRVCALL,LPCWSTR);
LONG TSPIAPI TSPI_phoneGetIcon(DWORD,LPCWSTR,LPHICON);
LONG TSPIAPI TSPI_phoneGetID(HDRVPHONE,LPVARSTRING,LPCWSTR,HANDLE);
LONG TSPIAPI TSPI_phoneSetDisplay(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD,LPCWSTR,DWORD);
LONG TSPIAPI TUISPI_lineConfigDialog(TUISPIDLLCALLBACK,DWORD,HWND,LPCWSTR);
LONG TSPIAPI TUISPI_lineConfigDialogEdit(TUISPIDLLCALLBACK,DWORD,HWND,LPCWSTR,LPVOID const,DWORD,LPVARSTRING);
LONG TSPIAPI TUISPI_phoneConfigDialog(TUISPIDLLCALLBACK,DWORD,HWND,LPCWSTR);
LONG TSPIAPI TUISPI_providerConfig(TUISPIDLLCALLBACK,HWND,DWORD);
LONG TSPIAPI TUISPI_providerGenericDialog(TUISPIDLLCALLBACK,HTAPIDIALOGINSTANCE,LPVOID,DWORD,HANDLE);
LONG TSPIAPI TUISPI_providerGenericDialogData(HTAPIDIALOGINSTANCE,LPVOID,DWORD);
LONG TSPIAPI TUISPI_providerInstall(TUISPIDLLCALLBACK,HWND,DWORD);
LONG TSPIAPI TUISPI_providerRemove(TUISPIDLLCALLBACK,HWND,DWORD);
LONG TSPIAPI TSPI_providerInit(DWORD,DWORD,DWORD,DWORD,DWORD_PTR,DWORD_PTR,ASYNC_COMPLETION,LPDWORD);
LONG TSPIAPI TSPI_providerShutdown(DWORD,DWORD);
#else /* TAPI_CURRENT_VERSION >= 0x00020000 */
LONG TSPIAPI TSPI_lineBlindTransfer(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineDial(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineGatherDigits(HDRVCALL,DWORD,DWORD,LPSTR,DWORD,LPCSTR,DWORD,DWORD);
LONG TSPIAPI TSPI_lineGenerateDigits(HDRVCALL,DWORD,DWORD,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineGetAddressID(HDRVLINE,LPDWORD,DWORD,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineGetDevConfig(DWORD,LPVARSTRING,LPCSTR);
LONG TSPIAPI TSPI_lineGetIcon(DWORD,LPCSTR,LPHICON);
LONG TSPIAPI TSPI_lineGetID(HDRVLINE,DWORD,HDRVCALL,DWORD,LPVARSTRING,LPCSTR);
LONG TSPIAPI TSPI_lineMakeCall(DRV_REQUESTID,HDRVLINE,HTAPICALL,LPHDRVCALL,LPCSTR,DWORD,LPLINECALLPARAMS const);
LONG TSPIAPI TSPI_linePark(DRV_REQUESTID,HDRVCALL,DWORD,LPCSTR,LPVARSTRING);
LONG TSPIAPI TSPI_linePickup(DRV_REQUESTID,HDRVLINE,DWORD,HTAPICALL,LPHDRVCALL,LPCSTR,LPCSTR);
LONG TSPIAPI TSPI_lineRedirect(DRV_REQUESTID,HDRVCALL,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineSetDevConfig(DWORD,LPVOID const,DWORD,LPCSTR);
LONG TSPIAPI TSPI_lineUnpark(DRV_REQUESTID,HDRVLINE,DWORD,HTAPICALL,LPHDRVCALL,LPCSTR);
LONG TSPIAPI TSPI_phoneGetIcon(DWORD,LPCSTR,LPHICON);
LONG TSPIAPI TSPI_phoneGetID(HDRVPHONE,LPVARSTRING,LPCSTR);
LONG TSPIAPI TSPI_phoneSetDisplay(DRV_REQUESTID,HDRVPHONE,DWORD,DWORD,LPCSTR,DWORD);
LONG TSPIAPI TSPI_lineConfigDialog(DWORD,HWND,LPCSTR);
LONG TSPIAPI TSPI_lineConfigDialogEdit(DWORD,HWND,LPCSTR,LPVOID const,DWORD,LPVARSTRING);
LONG TSPIAPI TSPI_phoneConfigDialog(DWORD,HWND,LPCSTR);
LONG TSPIAPI TSPI_providerInit(DWORD,DWORD,DWORD,DWORD,DWORD_PTR,DWORD_PTR,ASYNC_COMPLETION);
LONG TSPIAPI TSPI_providerShutdown(DWORD);
#endif /* TAPI_CURRENT_VERSION >= 0x00020000 */

#if (TAPI_CURRENT_VERSION >= 0x00020000)
LONG TSPIAPI TSPI_lineSetCallData(DRV_REQUESTID,HDRVCALL,LPVOID,DWORD);
LONG TSPIAPI TSPI_lineSetCallQualityOfService(DRV_REQUESTID,HDRVCALL,LPVOID,DWORD,LPVOID,DWORD);
LONG TSPIAPI TSPI_lineSetCallTreatment(DRV_REQUESTID,HDRVCALL,DWORD);
LONG TSPIAPI TSPI_lineSetLineDevStatus(DRV_REQUESTID,HDRVLINE,DWORD,DWORD);
LONG TSPIAPI TSPI_providerFreeDialogInstance(HDRVDIALOGINSTANCE);
LONG TSPIAPI TSPI_providerGenericDialogData(DWORD_PTR,DWORD,LPVOID,DWORD);
LONG TSPIAPI TSPI_providerUIIdentify(LPWSTR);
#endif

#if (TAPI_CURRENT_VERSION >= 0x00030000)
LONG TSPIAPI TSPI_lineGetCallHubTracking(HDRVLINE,LPLINECALLHUBTRACKINGINFO);
LONG TSPIAPI TSPI_lineGetCallIDs(HDRVCALL,LPDWORD,LPDWORD,LPDWORD);
LONG TSPIAPI TSPI_lineSetCallHubTracking(HDRVLINE,LPLINECALLHUBTRACKINGINFO);
LONG TSPIAPI TSPI_lineMSPIdentify(DWORD,GUID*);
LONG TSPIAPI TSPI_lineCreateMSPInstance(HDRVLINE,DWORD,HTAPIMSPLINE,LPHDRVMSPLINE);
LONG TSPIAPI TSPI_lineCloseMSPInstance(HDRVMSPLINE);
LONG TSPIAPI TSPI_lineReceiveMSPData(HDRVLINE,HDRVCALL,HDRVMSPLINE,LPVOID,DWORD);
#endif

#if (TAPI_CURRENT_VERSION < 0x00020000)

#define TSPI_PROC_BASE  500

#define TSPI_LINEACCEPT  (TSPI_PROC_BASE+0)
#define TSPI_LINEADDTOCONFERENCE  (TSPI_PROC_BASE+1)
#define TSPI_LINEANSWER  (TSPI_PROC_BASE+2)
#define TSPI_LINEBLINDTRANSFER  (TSPI_PROC_BASE+3)
#define TSPI_LINECLOSE  (TSPI_PROC_BASE+4)
#define TSPI_LINECLOSECALL  (TSPI_PROC_BASE+5)
#define TSPI_LINECOMPLETECALL  (TSPI_PROC_BASE+6)
#define TSPI_LINECOMPLETETRANSFER  (TSPI_PROC_BASE+7)
#define TSPI_LINECONDITIONALMEDIADETECTION  (TSPI_PROC_BASE+8)
#define TSPI_LINECONFIGDIALOG  (TSPI_PROC_BASE+9)
#define TSPI_LINEDEVSPECIFIC  (TSPI_PROC_BASE+10)
#define TSPI_LINEDEVSPECIFICFEATURE  (TSPI_PROC_BASE+11)
#define TSPI_LINEDIAL  (TSPI_PROC_BASE+12)
#define TSPI_LINEDROP  (TSPI_PROC_BASE+13)
#define TSPI_LINEFORWARD  (TSPI_PROC_BASE+14)
#define TSPI_LINEGATHERDIGITS  (TSPI_PROC_BASE+15)
#define TSPI_LINEGENERATEDIGITS  (TSPI_PROC_BASE+16)
#define TSPI_LINEGENERATETONE  (TSPI_PROC_BASE+17)
#define TSPI_LINEGETADDRESSCAPS  (TSPI_PROC_BASE+18)
#define TSPI_LINEGETADDRESSID  (TSPI_PROC_BASE+19)
#define TSPI_LINEGETADDRESSSTATUS  (TSPI_PROC_BASE+20)
#define TSPI_LINEGETCALLADDRESSID  (TSPI_PROC_BASE+21)
#define TSPI_LINEGETCALLINFO  (TSPI_PROC_BASE+22)
#define TSPI_LINEGETCALLSTATUS  (TSPI_PROC_BASE+23)
#define TSPI_LINEGETDEVCAPS  (TSPI_PROC_BASE+24)
#define TSPI_LINEGETDEVCONFIG  (TSPI_PROC_BASE+25)
#define TSPI_LINEGETEXTENSIONID  (TSPI_PROC_BASE+26)
#define TSPI_LINEGETICON  (TSPI_PROC_BASE+27)
#define TSPI_LINEGETID  (TSPI_PROC_BASE+28)
#define TSPI_LINEGETLINEDEVSTATUS  (TSPI_PROC_BASE+29)
#define TSPI_LINEGETNUMADDRESSIDS  (TSPI_PROC_BASE+30)
#define TSPI_LINEHOLD  (TSPI_PROC_BASE+31)
#define TSPI_LINEMAKECALL  (TSPI_PROC_BASE+32)
#define TSPI_LINEMONITORDIGITS  (TSPI_PROC_BASE+33)
#define TSPI_LINEMONITORMEDIA  (TSPI_PROC_BASE+34)
#define TSPI_LINEMONITORTONES  (TSPI_PROC_BASE+35)
#define TSPI_LINENEGOTIATEEXTVERSION  (TSPI_PROC_BASE+36)
#define TSPI_LINENEGOTIATETSPIVERSION  (TSPI_PROC_BASE+37)
#define TSPI_LINEOPEN  (TSPI_PROC_BASE+38)
#define TSPI_LINEPARK  (TSPI_PROC_BASE+39)
#define TSPI_LINEPICKUP  (TSPI_PROC_BASE+40)
#define TSPI_LINEPREPAREADDTOCONFERENCE  (TSPI_PROC_BASE+41)
#define TSPI_LINEREDIRECT  (TSPI_PROC_BASE+42)
#define TSPI_LINEREMOVEFROMCONFERENCE  (TSPI_PROC_BASE+43)
#define TSPI_LINESECURECALL  (TSPI_PROC_BASE+44)
#define TSPI_LINESELECTEXTVERSION  (TSPI_PROC_BASE+45)
#define TSPI_LINESENDUSERUSERINFO  (TSPI_PROC_BASE+46)
#define TSPI_LINESETAPPSPECIFIC  (TSPI_PROC_BASE+47)
#define TSPI_LINESETCALLPARAMS  (TSPI_PROC_BASE+48)
#define TSPI_LINESETDEFAULTMEDIADETECTION  (TSPI_PROC_BASE+49)
#define TSPI_LINESETDEVCONFIG  (TSPI_PROC_BASE+50)
#define TSPI_LINESETMEDIACONTROL  (TSPI_PROC_BASE+51)
#define TSPI_LINESETMEDIAMODE  (TSPI_PROC_BASE+52)
#define TSPI_LINESETSTATUSMESSAGES  (TSPI_PROC_BASE+53)
#define TSPI_LINESETTERMINAL  (TSPI_PROC_BASE+54)
#define TSPI_LINESETUPCONFERENCE  (TSPI_PROC_BASE+55)
#define TSPI_LINESETUPTRANSFER  (TSPI_PROC_BASE+56)
#define TSPI_LINESWAPHOLD  (TSPI_PROC_BASE+57)
#define TSPI_LINEUNCOMPLETECALL  (TSPI_PROC_BASE+58)
#define TSPI_LINEUNHOLD  (TSPI_PROC_BASE+59)
#define TSPI_LINEUNPARK  (TSPI_PROC_BASE+60)
#define TSPI_PHONECLOSE  (TSPI_PROC_BASE+61)
#define TSPI_PHONECONFIGDIALOG  (TSPI_PROC_BASE+62)
#define TSPI_PHONEDEVSPECIFIC  (TSPI_PROC_BASE+63)
#define TSPI_PHONEGETBUTTONINFO  (TSPI_PROC_BASE+64)
#define TSPI_PHONEGETDATA  (TSPI_PROC_BASE+65)
#define TSPI_PHONEGETDEVCAPS  (TSPI_PROC_BASE+66)
#define TSPI_PHONEGETDISPLAY  (TSPI_PROC_BASE+67)
#define TSPI_PHONEGETEXTENSIONID  (TSPI_PROC_BASE+68)
#define TSPI_PHONEGETGAIN  (TSPI_PROC_BASE+69)
#define TSPI_PHONEGETHOOKSWITCH  (TSPI_PROC_BASE+70)
#define TSPI_PHONEGETICON  (TSPI_PROC_BASE+71)
#define TSPI_PHONEGETID  (TSPI_PROC_BASE+72)
#define TSPI_PHONEGETLAMP  (TSPI_PROC_BASE+73)
#define TSPI_PHONEGETRING  (TSPI_PROC_BASE+74)
#define TSPI_PHONEGETSTATUS  (TSPI_PROC_BASE+75)
#define TSPI_PHONEGETVOLUME  (TSPI_PROC_BASE+76)
#define TSPI_PHONENEGOTIATEEXTVERSION  (TSPI_PROC_BASE+77)
#define TSPI_PHONENEGOTIATETSPIVERSION  (TSPI_PROC_BASE+78)
#define TSPI_PHONEOPEN  (TSPI_PROC_BASE+79)
#define TSPI_PHONESELECTEXTVERSION  (TSPI_PROC_BASE+80)
#define TSPI_PHONESETBUTTONINFO  (TSPI_PROC_BASE+81)
#define TSPI_PHONESETDATA  (TSPI_PROC_BASE+82)
#define TSPI_PHONESETDISPLAY  (TSPI_PROC_BASE+83)
#define TSPI_PHONESETGAIN  (TSPI_PROC_BASE+84)
#define TSPI_PHONESETHOOKSWITCH  (TSPI_PROC_BASE+85)
#define TSPI_PHONESETLAMP  (TSPI_PROC_BASE+86)
#define TSPI_PHONESETRING  (TSPI_PROC_BASE+87)
#define TSPI_PHONESETSTATUSMESSAGES  (TSPI_PROC_BASE+88)
#define TSPI_PHONESETVOLUME  (TSPI_PROC_BASE+89)
#define TSPI_PROVIDERCONFIG  (TSPI_PROC_BASE+90)
#define TSPI_PROVIDERINIT  (TSPI_PROC_BASE+91)
#define TSPI_PROVIDERINSTALL  (TSPI_PROC_BASE+92)
#define TSPI_PROVIDERREMOVE  (TSPI_PROC_BASE+93)
#define TSPI_PROVIDERSHUTDOWN  (TSPI_PROC_BASE+94)

#define TSPI_PROVIDERENUMDEVICES  (TSPI_PROC_BASE+95)
#define TSPI_LINEDROPONCLOSE  (TSPI_PROC_BASE+96)
#define TSPI_LINEDROPNOOWNER  (TSPI_PROC_BASE+97)
#define TSPI_PROVIDERCREATELINEDEVICE  (TSPI_PROC_BASE+98)
#define TSPI_PROVIDERCREATEPHONEDEVICE  (TSPI_PROC_BASE+99)
#define TSPI_LINESETCURRENTLOCATION  (TSPI_PROC_BASE+100)
#define TSPI_LINECONFIGDIALOGEDIT  (TSPI_PROC_BASE+101)
#define TSPI_LINERELEASEUSERUSERINFO  (TSPI_PROC_BASE+102)

#define TSPI_LINEGETCALLID  (TSPI_PROC_BASE+103)
#define TSPI_LINEGETCALLHUBTRACKING  (TSPI_PROC_BASE+104)
#define TSPI_LINESETCALLHUBTRACKING  (TSPI_PROC_BASE+105)
#define TSPI_LINERECEIVEMSPDATA  (TSPI_PROC_BASE+106)
#define TSPI_LINEMSPIDENTIFY  (TSPI_PROC_BASE+107)
#define TSPI_LINECREATEMSPINSTANCE  (TSPI_PROC_BASE+108)
#define TSPI_LINECLOSEMSPINSTANCE  (TSPI_PROC_BASE+109)

#endif /* TAPI_CURRENT_VERSION < 0x00020000 */

#ifdef __cplusplus
}
#endif

#endif /* _TSPI_H */
