' ########################################################################################
' Microsoft Windows
' File: Tapi.inc
' Contents: Telephony API
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' 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.
' ########################################################################################
#IF NOT %DEF(PBX_Tapi_PBI)
#DEFINE PBX_Tapi_PBI
%EQUATE `TAPI_INC = 1
'The Telephony API is jointly copyrighted by Intel and Microsoft. You are
'granted a royalty free worldwide, unlimited license to make copies, and use
'the API/SPI for making applications/drivers that interface with the
'specification provided that this paragraph and the Intel/Microsoft copyright
'statement is maintained as is in the text and source code files.
'Copyright (c) Microsoft Corporation, All rights reserved.
'Portions copyright 1992, 1993 Intel/Microsoft, all rights reserved.
'Module Name:
' tapi.h
'Notes:
' Additions to the Telephony Application Programming Interface (TAPI) since
' version 1.0 are noted by version number (e.g. "TAPI v1.4").
'--*/
'' //
'' // -- TAPI VERSION INFO -- TAPI VERSION INFO -- TAPI VERSION INFO --
'' //
'' // To build a TAPI 1.4 application put a define as below in your source
'' // file before you include TAPI.H:
'' //
'' // #define TAPI_CURRENT_VERSION &H00010004
'' //
'' //
#IF NOT %DEF(%TAPI_CURRENT_VERSION)
%EQUATE `TAPI_CURRENT_VERSION = &H00020002
#ENDIF
#INCLUDE ONCE "Core/Windows.inc"
#INCLUDE ONCE "Legacy/System/BaseTsd.inc"
#IF %TAPI_CURRENT_VERSION >= &H00020002
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#ENDIF
'#pragma pack(1)
'' // Type definitions of the data types used in tapi
'' //
'' // TAPI type definitions
'' //
'#define DECLARE_OPAQUE32(name) typedef DWORD name
'DECLARE_OPAQUE32(HCALL) AS DWORD
'typedef HCALL FAR * LPHCALL AS DWORD
'#IF %TAPI_CURRENT_VERSION >= &H00030000)
'DECLARE_OPAQUE32(HCALLHUB) AS DWORD ' // TAPI v3.0
'typedef HCALLHUB FAR * LPHCALLHUB AS DWORD ' // TAPI v3.0
'#ENDIF
'DECLARE_OPAQUE32(HLINE) AS DWORD
'typedef HLINE FAR * LPHLINE AS DWORD
'DECLARE_OPAQUE32(HPHONE) AS DWORD
'typedef HPHONE FAR * LPHPHONE AS DWORD
'DECLARE_OPAQUE32(HLINEAPP) AS DWORD
'typedef HLINEAPP FAR * LPHLINEAPP AS DWORD
'DECLARE_OPAQUE32(HPHONEAPP) AS DWORD
'typedef HPHONEAPP FAR * LPHPHONEAPP AS DWORD
'#IF %TAPI_CURRENT_VERSION >= &H00020002)
'DECLARE_OPAQUE32(HAGENTSESSION) AS DWORD ' // TAPI v2.2
'typedef HAGENTSESSION FAR * LPHAGENTSESSION AS DWORD ' // TAPI v2.2
'DECLARE_OPAQUE32(HAGENT) AS DWORD ' // TAPI v2.2
'typedef HAGENT FAR * LPHAGENT AS DWORD ' // TAPI v2.2
'#ENDIF
'#IF %TAPI_CURRENT_VERSION >= &H00030000)
'DECLARE_OPAQUE32(HPRIVATECHANNEL) AS DWORD ' // TAPI v3.0
'typedef HPRIVATECHANNEL FAR * LPHPRIVATECHANNEL AS DWORD ' // TAPI v3.0
'#ENDIF
'typedef HICON FAR * LPHICON AS DWORD
'SUB LINECALLBACK ( ' BYVAL hDevice AS DWORD
' , BYVAL dwMessage AS DWORD
' , BYVAL dwInstance AS DWORD ' DWORD_PTR
' , BYVAL dwParam1 AS DWORD ' DWORD_PTR
' , BYVAL dwParam2 AS DWORD ' DWORD_PTR
' , BYVAL dwParam3 AS DWORD ' DWORD_PTR
' ) ' void
'END SUB
'SUB PHONECALLBACK ( ' BYVAL hDevice AS DWORD
' , BYVAL dwMessage AS DWORD
' , BYVAL dwInstance AS DWORD ' DWORD_PTR
' , BYVAL dwParam1 AS DWORD ' DWORD_PTR
' , BYVAL dwParam2 AS DWORD ' DWORD_PTR
' , BYVAL dwParam3 AS DWORD ' DWORD_PTR
' ) ' void
'END SUB
'' // Messages for Phones and Lines
%EQUATE `LINE_ADDRESSSTATE = 0&
%EQUATE `LINE_CALLINFO = 1&
%EQUATE `LINE_CALLSTATE = 2&
%EQUATE `LINE_CLOSE = 3&
%EQUATE `LINE_DEVSPECIFIC = 4&
%EQUATE `LINE_DEVSPECIFICFEATURE = 5&
%EQUATE `LINE_GATHERDIGITS = 6&
%EQUATE `LINE_GENERATE = 7&
%EQUATE `LINE_LINEDEVSTATE = 8&
%EQUATE `LINE_MONITORDIGITS = 9&
%EQUATE `LINE_MONITORMEDIA = 10&
%EQUATE `LINE_MONITORTONE = 11&
%EQUATE `LINE_REPLY = 12&
%EQUATE `LINE_REQUEST = 13&
%EQUATE `PHONE_BUTTON = 14&
%EQUATE `PHONE_CLOSE = 15&
%EQUATE `PHONE_DEVSPECIFIC = 16&
%EQUATE `PHONE_REPLY = 17&
%EQUATE `PHONE_STATE = 18&
%EQUATE `LINE_CREATE = 19& ' // TAPI v1.4
%EQUATE `PHONE_CREATE = 20& ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINE_AGENTSPECIFIC = 21& ' // TAPI v2.0
%EQUATE `LINE_AGENTSTATUS = 22& ' // TAPI v2.0
%EQUATE `LINE_APPNEWCALL = 23& ' // TAPI v2.0
%EQUATE `LINE_PROXYREQUEST = 24& ' // TAPI v2.0
%EQUATE `LINE_REMOVE = 25& ' // TAPI v2.0
%EQUATE `PHONE_REMOVE = 26& ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINE_AGENTSESSIONSTATUS = 27& ' // TAPI v2.2
%EQUATE `LINE_QUEUESTATUS = 28& ' // TAPI v2.2
%EQUATE `LINE_AGENTSTATUSEX = 29& ' // TAPI v2.2
%EQUATE `LINE_GROUPSTATUS = 30& ' // TAPI v2.2
%EQUATE `LINE_PROXYSTATUS = 31& ' // TAPI v2.2
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINE_APPNEWCALLHUB = 32& ' // TAPI v3.0
%EQUATE `LINE_CALLHUBCLOSE = 33& ' // TAPI v3.0
%EQUATE `LINE_DEVSPECIFICEX = 34& ' // TAPI v3.0
#ENDIF
%EQUATE `INITIALIZE_NEGOTIATION = &HFFFFFFFF
%EQUATE `LINEADDRCAPFLAGS_FWDNUMRINGS = &H00000001
%EQUATE `LINEADDRCAPFLAGS_PICKUPGROUPID = &H00000002
%EQUATE `LINEADDRCAPFLAGS_SECURE = &H00000004
%EQUATE `LINEADDRCAPFLAGS_BLOCKIDDEFAULT = &H00000008
%EQUATE `LINEADDRCAPFLAGS_BLOCKIDOVERRIDE = &H00000010
%EQUATE `LINEADDRCAPFLAGS_DIALED = &H00000020
%EQUATE `LINEADDRCAPFLAGS_ORIGOFFHOOK = &H00000040
%EQUATE `LINEADDRCAPFLAGS_DESTOFFHOOK = &H00000080
%EQUATE `LINEADDRCAPFLAGS_FWDCONSULT = &H00000100
%EQUATE `LINEADDRCAPFLAGS_SETUPCONFNULL = &H00000200
%EQUATE `LINEADDRCAPFLAGS_AUTORECONNECT = &H00000400
%EQUATE `LINEADDRCAPFLAGS_COMPLETIONID = &H00000800
%EQUATE `LINEADDRCAPFLAGS_TRANSFERHELD = &H00001000
%EQUATE `LINEADDRCAPFLAGS_TRANSFERMAKE = &H00002000
%EQUATE `LINEADDRCAPFLAGS_CONFERENCEHELD = &H00004000
%EQUATE `LINEADDRCAPFLAGS_CONFERENCEMAKE = &H00008000
%EQUATE `LINEADDRCAPFLAGS_PARTIALDIAL = &H00010000
%EQUATE `LINEADDRCAPFLAGS_FWDSTATUSVALID = &H00020000
%EQUATE `LINEADDRCAPFLAGS_FWDINTEXTADDR = &H00040000
%EQUATE `LINEADDRCAPFLAGS_FWDBUSYNAADDR = &H00080000
%EQUATE `LINEADDRCAPFLAGS_ACCEPTTOALERT = &H00100000
%EQUATE `LINEADDRCAPFLAGS_CONFDROP = &H00200000
%EQUATE `LINEADDRCAPFLAGS_PICKUPCALLWAIT = &H00400000
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEADDRCAPFLAGS_PREDICTIVEDIALER = &H00800000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_QUEUE = &H01000000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_ROUTEPOINT = &H02000000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_HOLDMAKESNEW = &H04000000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_NOINTERNALCALLS = &H08000000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_NOEXTERNALCALLS = &H10000000 ' // TAPI v2.0
%EQUATE `LINEADDRCAPFLAGS_SETCALLINGID = &H20000000 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINEADDRCAPFLAGS_ACDGROUP = &H40000000 ' // TAPI v2.2
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINEADDRCAPFLAGS_NOPSTNADDRESSTRANSLATION = &H80000000 ' // TAPI v3.0
#ENDIF
%EQUATE `LINEADDRESSMODE_ADDRESSID = &H00000001
%EQUATE `LINEADDRESSMODE_DIALABLEADDR = &H00000002
%EQUATE `LINEADDRESSSHARING_PRIVATE = &H00000001
%EQUATE `LINEADDRESSSHARING_BRIDGEDEXCL = &H00000002
%EQUATE `LINEADDRESSSHARING_BRIDGEDNEW = &H00000004
%EQUATE `LINEADDRESSSHARING_BRIDGEDSHARED = &H00000008
%EQUATE `LINEADDRESSSHARING_MONITORED = &H00000010
%EQUATE `LINEADDRESSSTATE_OTHER = &H00000001
%EQUATE `LINEADDRESSSTATE_DEVSPECIFIC = &H00000002
%EQUATE `LINEADDRESSSTATE_INUSEZERO = &H00000004
%EQUATE `LINEADDRESSSTATE_INUSEONE = &H00000008
%EQUATE `LINEADDRESSSTATE_INUSEMANY = &H00000010
%EQUATE `LINEADDRESSSTATE_NUMCALLS = &H00000020
%EQUATE `LINEADDRESSSTATE_FORWARD = &H00000040
%EQUATE `LINEADDRESSSTATE_TERMINALS = &H00000080
%EQUATE `LINEADDRESSSTATE_CAPSCHANGE = &H00000100 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINEADDRESSTYPE_PHONENUMBER = &H00000001
%EQUATE `LINEADDRESSTYPE_SDP = &H00000002
%EQUATE `LINEADDRESSTYPE_EMAILNAME = &H00000004
%EQUATE `LINEADDRESSTYPE_DOMAINNAME = &H00000008
%EQUATE `LINEADDRESSTYPE_IPADDRESS = &H00000010
#ENDIF
%EQUATE `LINEADDRFEATURE_FORWARD = &H00000001
%EQUATE `LINEADDRFEATURE_MAKECALL = &H00000002
%EQUATE `LINEADDRFEATURE_PICKUP = &H00000004
%EQUATE `LINEADDRFEATURE_SETMEDIACONTROL = &H00000008
%EQUATE `LINEADDRFEATURE_SETTERMINAL = &H00000010
%EQUATE `LINEADDRFEATURE_SETUPCONF = &H00000020
%EQUATE `LINEADDRFEATURE_UNCOMPLETECALL = &H00000040
%EQUATE `LINEADDRFEATURE_UNPARK = &H00000080
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEADDRFEATURE_PICKUPHELD = &H00000100 ' // TAPI v2.0
%EQUATE `LINEADDRFEATURE_PICKUPGROUP = &H00000200 ' // TAPI v2.0
%EQUATE `LINEADDRFEATURE_PICKUPDIRECT = &H00000400 ' // TAPI v2.0
%EQUATE `LINEADDRFEATURE_PICKUPWAITING = &H00000800 ' // TAPI v2.0
%EQUATE `LINEADDRFEATURE_FORWARDFWD = &H00001000 ' // TAPI v2.0
%EQUATE `LINEADDRFEATURE_FORWARDDND = &H00002000 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEAGENTFEATURE_SETAGENTGROUP = &H00000001 ' // TAPI v2.0
%EQUATE `LINEAGENTFEATURE_SETAGENTSTATE = &H00000002 ' // TAPI v2.0
%EQUATE `LINEAGENTFEATURE_SETAGENTACTIVITY = &H00000004 ' // TAPI v2.0
%EQUATE `LINEAGENTFEATURE_AGENTSPECIFIC = &H00000008 ' // TAPI v2.0
%EQUATE `LINEAGENTFEATURE_GETAGENTACTIVITYLIST = &H00000010 ' // TAPI v2.0
%EQUATE `LINEAGENTFEATURE_GETAGENTGROUP = &H00000020 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_LOGGEDOFF = &H00000001 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_NOTREADY = &H00000002 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_READY = &H00000004 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_BUSYACD = &H00000008 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_BUSYINCOMING = &H00000010 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_BUSYOUTBOUND = &H00000020 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_BUSYOTHER = &H00000040 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_WORKINGAFTERCALL = &H00000080 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_UNKNOWN = &H00000100 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATE_UNAVAIL = &H00000200 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_GROUP = &H00000001 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_STATE = &H00000002 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_NEXTSTATE = &H00000004 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_ACTIVITY = &H00000008 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_ACTIVITYLIST = &H00000010 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_GROUPLIST = &H00000020 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_CAPSCHANGE = &H00000040 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_VALIDSTATES = &H00000080 ' // TAPI v2.0
%EQUATE `LINEAGENTSTATUS_VALIDNEXTSTATES = &H00000100 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINEAGENTSTATEEX_NOTREADY = &H00000001 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_READY = &H00000002 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_BUSYACD = &H00000004 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_BUSYINCOMING = &H00000008 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_BUSYOUTGOING = &H00000010 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_UNKNOWN = &H00000020 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATEEX_RELEASED = &H00000040 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATUSEX_NEWAGENT = &H00000001 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATUSEX_STATE = &H00000002 ' // TAPI v2.2
%EQUATE `LINEAGENTSTATUSEX_UPDATEINFO = &H00000004 ' // TAPI v2.2
' ' //%LINEAGENTSTATUSEX_DESTROYED = &H00000004 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_NOTREADY = &H00000001 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_READY = &H00000002 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_BUSYONCALL = &H00000004 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_BUSYWRAPUP = &H00000008 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_ENDED = &H00000010 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATE_RELEASED = &H00000020 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATUS_NEWSESSION = &H00000001 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATUS_STATE = &H00000002 ' // TAPI v2.2
%EQUATE `LINEAGENTSESSIONSTATUS_UPDATEINFO = &H00000004 ' // TAPI v2.2
' //%LINEAGENTSESSIONSTATUS_DESTROYED = &H00000008 ' // TAPI v2.2
%EQUATE `LINEQUEUESTATUS_UPDATEINFO = &H00000001 ' // TAPI v2.2
%EQUATE `LINEQUEUESTATUS_NEWQUEUE = &H00000002 ' // TAPI v2.2
%EQUATE `LINEQUEUESTATUS_QUEUEREMOVED = &H00000004 ' // TAPI v2.2
%EQUATE `LINEGROUPSTATUS_NEWGROUP = &H00000001 ' // TAPI v2.2
%EQUATE `LINEGROUPSTATUS_GROUPREMOVED = &H00000002 ' // TAPI v2.2
%EQUATE `LINEPROXYSTATUS_OPEN = &H00000001 ' // TAPI v2.2
%EQUATE `LINEPROXYSTATUS_CLOSE = &H00000002 ' // TAPI v2.2
%EQUATE `LINEPROXYSTATUS_ALLOPENFORACD = &H00000004 ' // TAPI v2.2
#ENDIF
%EQUATE `LINEANSWERMODE_NONE = &H00000001
%EQUATE `LINEANSWERMODE_DROP = &H00000002
%EQUATE `LINEANSWERMODE_HOLD = &H00000004
%EQUATE `LINEBEARERMODE_VOICE = &H00000001
%EQUATE `LINEBEARERMODE_SPEECH = &H00000002
%EQUATE `LINEBEARERMODE_MULTIUSE = &H00000004
%EQUATE `LINEBEARERMODE_DATA = &H00000008
%EQUATE `LINEBEARERMODE_ALTSPEECHDATA = &H00000010
%EQUATE `LINEBEARERMODE_NONCALLSIGNALING = &H00000020
%EQUATE `LINEBEARERMODE_PASSTHROUGH = &H00000040 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEBEARERMODE_RESTRICTEDDATA = &H00000080 ' // TAPI v2.0
#ENDIF
%EQUATE `LINEBUSYMODE_STATION = &H00000001
%EQUATE `LINEBUSYMODE_TRUNK = &H00000002
%EQUATE `LINEBUSYMODE_UNKNOWN = &H00000004
%EQUATE `LINEBUSYMODE_UNAVAIL = &H00000008
%EQUATE `LINECALLCOMPLCOND_BUSY = &H00000001
%EQUATE `LINECALLCOMPLCOND_NOANSWER = &H00000002
%EQUATE `LINECALLCOMPLMODE_CAMPON = &H00000001
%EQUATE `LINECALLCOMPLMODE_CALLBACK = &H00000002
%EQUATE `LINECALLCOMPLMODE_INTRUDE = &H00000004
%EQUATE `LINECALLCOMPLMODE_MESSAGE = &H00000008
%EQUATE `LINECALLFEATURE_ACCEPT = &H00000001
%EQUATE `LINECALLFEATURE_ADDTOCONF = &H00000002
%EQUATE `LINECALLFEATURE_ANSWER = &H00000004
%EQUATE `LINECALLFEATURE_BLINDTRANSFER = &H00000008
%EQUATE `LINECALLFEATURE_COMPLETECALL = &H00000010
%EQUATE `LINECALLFEATURE_COMPLETETRANSF = &H00000020
%EQUATE `LINECALLFEATURE_DIAL = &H00000040
%EQUATE `LINECALLFEATURE_DROP = &H00000080
%EQUATE `LINECALLFEATURE_GATHERDIGITS = &H00000100
%EQUATE `LINECALLFEATURE_GENERATEDIGITS = &H00000200
%EQUATE `LINECALLFEATURE_GENERATETONE = &H00000400
%EQUATE `LINECALLFEATURE_HOLD = &H00000800
%EQUATE `LINECALLFEATURE_MONITORDIGITS = &H00001000
%EQUATE `LINECALLFEATURE_MONITORMEDIA = &H00002000
%EQUATE `LINECALLFEATURE_MONITORTONES = &H00004000
%EQUATE `LINECALLFEATURE_PARK = &H00008000
%EQUATE `LINECALLFEATURE_PREPAREADDCONF = &H00010000
%EQUATE `LINECALLFEATURE_REDIRECT = &H00020000
%EQUATE `LINECALLFEATURE_REMOVEFROMCONF = &H00040000
%EQUATE `LINECALLFEATURE_SECURECALL = &H00080000
%EQUATE `LINECALLFEATURE_SENDUSERUSER = &H00100000
%EQUATE `LINECALLFEATURE_SETCALLPARAMS = &H00200000
%EQUATE `LINECALLFEATURE_SETMEDIACONTROL = &H00400000
%EQUATE `LINECALLFEATURE_SETTERMINAL = &H00800000
%EQUATE `LINECALLFEATURE_SETUPCONF = &H01000000
%EQUATE `LINECALLFEATURE_SETUPTRANSFER = &H02000000
%EQUATE `LINECALLFEATURE_SWAPHOLD = &H04000000
%EQUATE `LINECALLFEATURE_UNHOLD = &H08000000
%EQUATE `LINECALLFEATURE_RELEASEUSERUSERINFO = &H10000000 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLFEATURE_SETTREATMENT = &H20000000 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE_SETQOS = &H40000000 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE_SETCALLDATA = &H80000000 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLFEATURE2_NOHOLDCONFERENCE = &H00000001 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_ONESTEPTRANSFER = &H00000002 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_COMPLCAMPON = &H00000004 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_COMPLCALLBACK = &H00000008 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_COMPLINTRUDE = &H00000010 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_COMPLMESSAGE = &H00000020 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_TRANSFERNORM = &H00000040 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_TRANSFERCONF = &H00000080 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_PARKDIRECT = &H00000100 ' // TAPI v2.0
%EQUATE `LINECALLFEATURE2_PARKNONDIRECT = &H00000200 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINECALLHUBTRACKING_NONE = &H00000000 ' // TAPI v3.0
%EQUATE `LINECALLHUBTRACKING_PROVIDERLEVEL = &H00000001 ' // TAPI v3.0
%EQUATE `LINECALLHUBTRACKING_ALLCALLS = &H00000002 ' // TAPI v3.0
#ENDIF
%EQUATE `LINECALLINFOSTATE_OTHER = &H00000001
%EQUATE `LINECALLINFOSTATE_DEVSPECIFIC = &H00000002
%EQUATE `LINECALLINFOSTATE_BEARERMODE = &H00000004
%EQUATE `LINECALLINFOSTATE_RATE = &H00000008
%EQUATE `LINECALLINFOSTATE_MEDIAMODE = &H00000010
%EQUATE `LINECALLINFOSTATE_APPSPECIFIC = &H00000020
%EQUATE `LINECALLINFOSTATE_CALLID = &H00000040
%EQUATE `LINECALLINFOSTATE_RELATEDCALLID = &H00000080
%EQUATE `LINECALLINFOSTATE_ORIGIN = &H00000100
%EQUATE `LINECALLINFOSTATE_REASON = &H00000200
%EQUATE `LINECALLINFOSTATE_COMPLETIONID = &H00000400
%EQUATE `LINECALLINFOSTATE_NUMOWNERINCR = &H00000800
%EQUATE `LINECALLINFOSTATE_NUMOWNERDECR = &H00001000
%EQUATE `LINECALLINFOSTATE_NUMMONITORS = &H00002000
%EQUATE `LINECALLINFOSTATE_TRUNK = &H00004000
%EQUATE `LINECALLINFOSTATE_CALLERID = &H00008000
%EQUATE `LINECALLINFOSTATE_CALLEDID = &H00010000
%EQUATE `LINECALLINFOSTATE_CONNECTEDID = &H00020000
%EQUATE `LINECALLINFOSTATE_REDIRECTIONID = &H00040000
%EQUATE `LINECALLINFOSTATE_REDIRECTINGID = &H00080000
%EQUATE `LINECALLINFOSTATE_DISPLAY = &H00100000
%EQUATE `LINECALLINFOSTATE_USERUSERINFO = &H00200000
%EQUATE `LINECALLINFOSTATE_HIGHLEVELCOMP = &H00400000
%EQUATE `LINECALLINFOSTATE_LOWLEVELCOMP = &H00800000
%EQUATE `LINECALLINFOSTATE_CHARGINGINFO = &H01000000
%EQUATE `LINECALLINFOSTATE_TERMINAL = &H02000000
%EQUATE `LINECALLINFOSTATE_DIALPARAMS = &H04000000
%EQUATE `LINECALLINFOSTATE_MONITORMODES = &H08000000
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLINFOSTATE_TREATMENT = &H10000000 ' // TAPI v2.0
%EQUATE `LINECALLINFOSTATE_QOS = &H20000000 ' // TAPI v2.0
%EQUATE `LINECALLINFOSTATE_CALLDATA = &H40000000 ' // TAPI v2.0
#ENDIF
%EQUATE `LINECALLORIGIN_OUTBOUND = &H00000001
%EQUATE `LINECALLORIGIN_INTERNAL = &H00000002
%EQUATE `LINECALLORIGIN_EXTERNAL = &H00000004
%EQUATE `LINECALLORIGIN_UNKNOWN = &H00000010
%EQUATE `LINECALLORIGIN_UNAVAIL = &H00000020
%EQUATE `LINECALLORIGIN_CONFERENCE = &H00000040
%EQUATE `LINECALLORIGIN_INBOUND = &H00000080 ' // TAPI v1.4
%EQUATE `LINECALLPARAMFLAGS_SECURE = &H00000001
%EQUATE `LINECALLPARAMFLAGS_IDLE = &H00000002
%EQUATE `LINECALLPARAMFLAGS_BLOCKID = &H00000004
%EQUATE `LINECALLPARAMFLAGS_ORIGOFFHOOK = &H00000008
%EQUATE `LINECALLPARAMFLAGS_DESTOFFHOOK = &H00000010
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLPARAMFLAGS_NOHOLDCONFERENCE = &H00000020 ' // TAPI v2.0
%EQUATE `LINECALLPARAMFLAGS_PREDICTIVEDIAL = &H00000040 ' // TAPI v2.0
%EQUATE `LINECALLPARAMFLAGS_ONESTEPTRANSFER = &H00000080 ' // TAPI v2.0
#ENDIF
%EQUATE `LINECALLPARTYID_BLOCKED = &H00000001
%EQUATE `LINECALLPARTYID_OUTOFAREA = &H00000002
%EQUATE `LINECALLPARTYID_NAME = &H00000004
%EQUATE `LINECALLPARTYID_ADDRESS = &H00000008
%EQUATE `LINECALLPARTYID_PARTIAL = &H00000010
%EQUATE `LINECALLPARTYID_UNKNOWN = &H00000020
%EQUATE `LINECALLPARTYID_UNAVAIL = &H00000040
%EQUATE `LINECALLPRIVILEGE_NONE = &H00000001
%EQUATE `LINECALLPRIVILEGE_MONITOR = &H00000002
%EQUATE `LINECALLPRIVILEGE_OWNER = &H00000004
%EQUATE `LINECALLREASON_DIRECT = &H00000001
%EQUATE `LINECALLREASON_FWDBUSY = &H00000002
%EQUATE `LINECALLREASON_FWDNOANSWER = &H00000004
%EQUATE `LINECALLREASON_FWDUNCOND = &H00000008
%EQUATE `LINECALLREASON_PICKUP = &H00000010
%EQUATE `LINECALLREASON_UNPARK = &H00000020
%EQUATE `LINECALLREASON_REDIRECT = &H00000040
%EQUATE `LINECALLREASON_CALLCOMPLETION = &H00000080
%EQUATE `LINECALLREASON_TRANSFER = &H00000100
%EQUATE `LINECALLREASON_REMINDER = &H00000200
%EQUATE `LINECALLREASON_UNKNOWN = &H00000400
%EQUATE `LINECALLREASON_UNAVAIL = &H00000800
%EQUATE `LINECALLREASON_INTRUDE = &H00001000 ' // TAPI v1.4
%EQUATE `LINECALLREASON_PARKED = &H00002000 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLREASON_CAMPEDON = &H00004000 ' // TAPI v2.0
%EQUATE `LINECALLREASON_ROUTEREQUEST = &H00008000 ' // TAPI v2.0
#ENDIF
%EQUATE `LINECALLSELECT_LINE = &H00000001
%EQUATE `LINECALLSELECT_ADDRESS = &H00000002
%EQUATE `LINECALLSELECT_CALL = &H00000004
#IF %TAPI_CURRENT_VERSION >= &H00020001
%EQUATE `LINECALLSELECT_DEVICEID = &H00000008 ' // TAPI v2.1
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINECALLSELECT_CALLID = &H00000010 ' // TAPI v3.0
#ENDIF
%EQUATE `LINECALLSTATE_IDLE = &H00000001
%EQUATE `LINECALLSTATE_OFFERING = &H00000002
%EQUATE `LINECALLSTATE_ACCEPTED = &H00000004
%EQUATE `LINECALLSTATE_DIALTONE = &H00000008
%EQUATE `LINECALLSTATE_DIALING = &H00000010
%EQUATE `LINECALLSTATE_RINGBACK = &H00000020
%EQUATE `LINECALLSTATE_BUSY = &H00000040
%EQUATE `LINECALLSTATE_SPECIALINFO = &H00000080
%EQUATE `LINECALLSTATE_CONNECTED = &H00000100
%EQUATE `LINECALLSTATE_PROCEEDING = &H00000200
%EQUATE `LINECALLSTATE_ONHOLD = &H00000400
%EQUATE `LINECALLSTATE_CONFERENCED = &H00000800
%EQUATE `LINECALLSTATE_ONHOLDPENDCONF = &H00001000
%EQUATE `LINECALLSTATE_ONHOLDPENDTRANSFER = &H00002000
%EQUATE `LINECALLSTATE_DISCONNECTED = &H00004000
%EQUATE `LINECALLSTATE_UNKNOWN = &H00008000
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECALLTREATMENT_SILENCE = &H00000001 ' // TAPI v2.0
%EQUATE `LINECALLTREATMENT_RINGBACK = &H00000002 ' // TAPI v2.0
%EQUATE `LINECALLTREATMENT_BUSY = &H00000003 ' // TAPI v2.0
%EQUATE `LINECALLTREATMENT_MUSIC = &H00000004 ' // TAPI v2.0
#ENDIF
%EQUATE `LINECARDOPTION_PREDEFINED = &H00000001 ' // TAPI v1.4
%EQUATE `LINECARDOPTION_HIDDEN = &H00000002 ' // TAPI v1.4
%EQUATE `LINECONNECTEDMODE_ACTIVE = &H00000001 ' // TAPI v1.4
%EQUATE `LINECONNECTEDMODE_INACTIVE = &H00000002 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINECONNECTEDMODE_ACTIVEHELD = &H00000004 ' // TAPI v2.0
%EQUATE `LINECONNECTEDMODE_INACTIVEHELD = &H00000008 ' // TAPI v2.0
%EQUATE `LINECONNECTEDMODE_CONFIRMED = &H00000010 ' // TAPI v2.0
#ENDIF
%EQUATE `LINEDEVCAPFLAGS_CROSSADDRCONF = &H00000001
%EQUATE `LINEDEVCAPFLAGS_HIGHLEVCOMP = &H00000002
%EQUATE `LINEDEVCAPFLAGS_LOWLEVCOMP = &H00000004
%EQUATE `LINEDEVCAPFLAGS_MEDIACONTROL = &H00000008
%EQUATE `LINEDEVCAPFLAGS_MULTIPLEADDR = &H00000010
%EQUATE `LINEDEVCAPFLAGS_CLOSEDROP = &H00000020
%EQUATE `LINEDEVCAPFLAGS_DIALBILLING = &H00000040
%EQUATE `LINEDEVCAPFLAGS_DIALQUIET = &H00000080
%EQUATE `LINEDEVCAPFLAGS_DIALDIALTONE = &H00000100
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINEDEVCAPFLAGS_MSP = &H00000200 ' // TAPI v3.0
%EQUATE `LINEDEVCAPFLAGS_CALLHUB = &H00000400 ' // TAPI v3.0
%EQUATE `LINEDEVCAPFLAGS_CALLHUBTRACKING = &H00000800 ' // TAPI v3.0
%EQUATE `LINEDEVCAPFLAGS_PRIVATEOBJECTS = &H00001000 ' // TAPI v3.0
#ENDIF
%EQUATE `LINEDEVCAPFLAGS_LOCAL = &H00002000
%EQUATE `LINEDEVSTATE_OTHER = &H00000001
%EQUATE `LINEDEVSTATE_RINGING = &H00000002
%EQUATE `LINEDEVSTATE_CONNECTED = &H00000004
%EQUATE `LINEDEVSTATE_DISCONNECTED = &H00000008
%EQUATE `LINEDEVSTATE_MSGWAITON = &H00000010
%EQUATE `LINEDEVSTATE_MSGWAITOFF = &H00000020
%EQUATE `LINEDEVSTATE_INSERVICE = &H00000040
%EQUATE `LINEDEVSTATE_OUTOFSERVICE = &H00000080
%EQUATE `LINEDEVSTATE_MAINTENANCE = &H00000100
%EQUATE `LINEDEVSTATE_OPEN = &H00000200
%EQUATE `LINEDEVSTATE_CLOSE = &H00000400
%EQUATE `LINEDEVSTATE_NUMCALLS = &H00000800
%EQUATE `LINEDEVSTATE_NUMCOMPLETIONS = &H00001000
%EQUATE `LINEDEVSTATE_TERMINALS = &H00002000
%EQUATE `LINEDEVSTATE_ROAMMODE = &H00004000
%EQUATE `LINEDEVSTATE_BATTERY = &H00008000
%EQUATE `LINEDEVSTATE_SIGNAL = &H00010000
%EQUATE `LINEDEVSTATE_DEVSPECIFIC = &H00020000
%EQUATE `LINEDEVSTATE_REINIT = &H00040000
%EQUATE `LINEDEVSTATE_LOCK = &H00080000
%EQUATE `LINEDEVSTATE_CAPSCHANGE = &H00100000 ' // TAPI v1.4
%EQUATE `LINEDEVSTATE_CONFIGCHANGE = &H00200000 ' // TAPI v1.4
%EQUATE `LINEDEVSTATE_TRANSLATECHANGE = &H00400000 ' // TAPI v1.4
%EQUATE `LINEDEVSTATE_COMPLCANCEL = &H00800000 ' // TAPI v1.4
%EQUATE `LINEDEVSTATE_REMOVED = &H01000000 ' // TAPI v1.4
%EQUATE `LINEDEVSTATUSFLAGS_CONNECTED = &H00000001
%EQUATE `LINEDEVSTATUSFLAGS_MSGWAIT = &H00000002
%EQUATE `LINEDEVSTATUSFLAGS_INSERVICE = &H00000004
%EQUATE `LINEDEVSTATUSFLAGS_LOCKED = &H00000008
%EQUATE `LINEDIALTONEMODE_NORMAL = &H00000001
%EQUATE `LINEDIALTONEMODE_SPECIAL = &H00000002
%EQUATE `LINEDIALTONEMODE_INTERNAL = &H00000004
%EQUATE `LINEDIALTONEMODE_EXTERNAL = &H00000008
%EQUATE `LINEDIALTONEMODE_UNKNOWN = &H00000010
%EQUATE `LINEDIALTONEMODE_UNAVAIL = &H00000020
%EQUATE `LINEDIGITMODE_PULSE = &H00000001
%EQUATE `LINEDIGITMODE_DTMF = &H00000002
%EQUATE `LINEDIGITMODE_DTMFEND = &H00000004
%EQUATE `LINEDISCONNECTMODE_NORMAL = &H00000001
%EQUATE `LINEDISCONNECTMODE_UNKNOWN = &H00000002
%EQUATE `LINEDISCONNECTMODE_REJECT = &H00000004
%EQUATE `LINEDISCONNECTMODE_PICKUP = &H00000008
%EQUATE `LINEDISCONNECTMODE_FORWARDED = &H00000010
%EQUATE `LINEDISCONNECTMODE_BUSY = &H00000020
%EQUATE `LINEDISCONNECTMODE_NOANSWER = &H00000040
%EQUATE `LINEDISCONNECTMODE_BADADDRESS = &H00000080
%EQUATE `LINEDISCONNECTMODE_UNREACHABLE = &H00000100
%EQUATE `LINEDISCONNECTMODE_CONGESTION = &H00000200
%EQUATE `LINEDISCONNECTMODE_INCOMPATIBLE = &H00000400
%EQUATE `LINEDISCONNECTMODE_UNAVAIL = &H00000800
%EQUATE `LINEDISCONNECTMODE_NODIALTONE = &H00001000 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEDISCONNECTMODE_NUMBERCHANGED = &H00002000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_OUTOFORDER = &H00004000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_TEMPFAILURE = &H00008000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_QOSUNAVAIL = &H00010000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_BLOCKED = &H00020000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_DONOTDISTURB = &H00040000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_CANCELLED = &H00080000 ' // TAPI v2.0
%EQUATE `LINEDISCONNECTMODE_DESTINATIONBARRED = &H00100000 ' // TAPI v2.0, WINCE 5.1 AKU 3.X
%EQUATE `LINEDISCONNECTMODE_FDNRESTRICT = &H00200000 ' // TAPI v2.0, WINCE 5.1 AKU 3.X
#ENDIF
%EQUATE `LINEERR_ALLOCATED = &H80000001
%EQUATE `LINEERR_BADDEVICEID = &H80000002
%EQUATE `LINEERR_BEARERMODEUNAVAIL = &H80000003
%EQUATE `LINEERR_CALLUNAVAIL = &H80000005
%EQUATE `LINEERR_COMPLETIONOVERRUN = &H80000006
%EQUATE `LINEERR_CONFERENCEFULL = &H80000007
%EQUATE `LINEERR_DIALBILLING = &H80000008
%EQUATE `LINEERR_DIALDIALTONE = &H80000009
%EQUATE `LINEERR_DIALPROMPT = &H8000000A
%EQUATE `LINEERR_DIALQUIET = &H8000000B
%EQUATE `LINEERR_INCOMPATIBLEAPIVERSION = &H8000000C
%EQUATE `LINEERR_INCOMPATIBLEEXTVERSION = &H8000000D
%EQUATE `LINEERR_INIFILECORRUPT = &H8000000E
%EQUATE `LINEERR_INUSE = &H8000000F
%EQUATE `LINEERR_INVALADDRESS = &H80000010
%EQUATE `LINEERR_INVALADDRESSID = &H80000011
%EQUATE `LINEERR_INVALADDRESSMODE = &H80000012
%EQUATE `LINEERR_INVALADDRESSSTATE = &H80000013
%EQUATE `LINEERR_INVALAPPHANDLE = &H80000014
%EQUATE `LINEERR_INVALAPPNAME = &H80000015
%EQUATE `LINEERR_INVALBEARERMODE = &H80000016
%EQUATE `LINEERR_INVALCALLCOMPLMODE = &H80000017
%EQUATE `LINEERR_INVALCALLHANDLE = &H80000018
%EQUATE `LINEERR_INVALCALLPARAMS = &H80000019
%EQUATE `LINEERR_INVALCALLPRIVILEGE = &H8000001A
%EQUATE `LINEERR_INVALCALLSELECT = &H8000001B
%EQUATE `LINEERR_INVALCALLSTATE = &H8000001C
%EQUATE `LINEERR_INVALCALLSTATELIST = &H8000001D
%EQUATE `LINEERR_INVALCARD = &H8000001E
%EQUATE `LINEERR_INVALCOMPLETIONID = &H8000001F
%EQUATE `LINEERR_INVALCONFCALLHANDLE = &H80000020
%EQUATE `LINEERR_INVALCONSULTCALLHANDLE = &H80000021
%EQUATE `LINEERR_INVALCOUNTRYCODE = &H80000022
%EQUATE `LINEERR_INVALDEVICECLASS = &H80000023
%EQUATE `LINEERR_INVALDEVICEHANDLE = &H80000024
%EQUATE `LINEERR_INVALDIALPARAMS = &H80000025
%EQUATE `LINEERR_INVALDIGITLIST = &H80000026
%EQUATE `LINEERR_INVALDIGITMODE = &H80000027
%EQUATE `LINEERR_INVALDIGITS = &H80000028
%EQUATE `LINEERR_INVALEXTVERSION = &H80000029
%EQUATE `LINEERR_INVALGROUPID = &H8000002A
%EQUATE `LINEERR_INVALLINEHANDLE = &H8000002B
%EQUATE `LINEERR_INVALLINESTATE = &H8000002C
%EQUATE `LINEERR_INVALLOCATION = &H8000002D
%EQUATE `LINEERR_INVALMEDIALIST = &H8000002E
%EQUATE `LINEERR_INVALMEDIAMODE = &H8000002F
%EQUATE `LINEERR_INVALMESSAGEID = &H80000030
%EQUATE `LINEERR_INVALPARAM = &H80000032
%EQUATE `LINEERR_INVALPARKID = &H80000033
%EQUATE `LINEERR_INVALPARKMODE = &H80000034
%EQUATE `LINEERR_INVALPOINTER = &H80000035
%EQUATE `LINEERR_INVALPRIVSELECT = &H80000036
%EQUATE `LINEERR_INVALRATE = &H80000037
%EQUATE `LINEERR_INVALREQUESTMODE = &H80000038
%EQUATE `LINEERR_INVALTERMINALID = &H80000039
%EQUATE `LINEERR_INVALTERMINALMODE = &H8000003A
%EQUATE `LINEERR_INVALTIMEOUT = &H8000003B
%EQUATE `LINEERR_INVALTONE = &H8000003C
%EQUATE `LINEERR_INVALTONELIST = &H8000003D
%EQUATE `LINEERR_INVALTONEMODE = &H8000003E
%EQUATE `LINEERR_INVALTRANSFERMODE = &H8000003F
%EQUATE `LINEERR_LINEMAPPERFAILED = &H80000040
%EQUATE `LINEERR_NOCONFERENCE = &H80000041
%EQUATE `LINEERR_NODEVICE = &H80000042
%EQUATE `LINEERR_NODRIVER = &H80000043
%EQUATE `LINEERR_NOMEM = &H80000044
%EQUATE `LINEERR_NOREQUEST = &H80000045
%EQUATE `LINEERR_NOTOWNER = &H80000046
%EQUATE `LINEERR_NOTREGISTERED = &H80000047
%EQUATE `LINEERR_OPERATIONFAILED = &H80000048
%EQUATE `LINEERR_OPERATIONUNAVAIL = &H80000049
%EQUATE `LINEERR_RATEUNAVAIL = &H8000004A
%EQUATE `LINEERR_RESOURCEUNAVAIL = &H8000004B
%EQUATE `LINEERR_REQUESTOVERRUN = &H8000004C
%EQUATE `LINEERR_STRUCTURETOOSMALL = &H8000004D
%EQUATE `LINEERR_TARGETNOTFOUND = &H8000004E
%EQUATE `LINEERR_TARGETSELF = &H8000004F
%EQUATE `LINEERR_UNINITIALIZED = &H80000050
%EQUATE `LINEERR_USERUSERINFOTOOBIG = &H80000051
%EQUATE `LINEERR_REINIT = &H80000052
%EQUATE `LINEERR_ADDRESSBLOCKED = &H80000053
%EQUATE `LINEERR_BILLINGREJECTED = &H80000054
%EQUATE `LINEERR_INVALFEATURE = &H80000055
%EQUATE `LINEERR_NOMULTIPLEINSTANCE = &H80000056
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEERR_INVALAGENTID = &H80000057 ' // TAPI v2.0
%EQUATE `LINEERR_INVALAGENTGROUP = &H80000058 ' // TAPI v2.0
%EQUATE `LINEERR_INVALPASSWORD = &H80000059 ' // TAPI v2.0
%EQUATE `LINEERR_INVALAGENTSTATE = &H8000005A ' // TAPI v2.0
%EQUATE `LINEERR_INVALAGENTACTIVITY = &H8000005B ' // TAPI v2.0
%EQUATE `LINEERR_DIALVOICEDETECT = &H8000005C ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINEERR_USERCANCELLED = &H8000005D ' // TAPI v2.2
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINEERR_INVALADDRESSTYPE = &H8000005E ' // TAPI v3.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINEERR_INVALAGENTSESSIONSTATE = &H8000005F ' // TAPI v2.2
%EQUATE `LINEERR_DISCONNECTED = &H80000060
%EQUATE `LINEERR_SERVICE_NOT_RUNNING = &H80000061
#ENDIF
%EQUATE `LINEFEATURE_DEVSPECIFIC = &H00000001
%EQUATE `LINEFEATURE_DEVSPECIFICFEAT = &H00000002
%EQUATE `LINEFEATURE_FORWARD = &H00000004
%EQUATE `LINEFEATURE_MAKECALL = &H00000008
%EQUATE `LINEFEATURE_SETMEDIACONTROL = &H00000010
%EQUATE `LINEFEATURE_SETTERMINAL = &H00000020
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEFEATURE_SETDEVSTATUS = &H00000040 ' // TAPI v2.0
%EQUATE `LINEFEATURE_FORWARDFWD = &H00000080 ' // TAPI v2.0
%EQUATE `LINEFEATURE_FORWARDDND = &H00000100 ' // TAPI v2.0
#ENDIF
%EQUATE `LINEFORWARDMODE_UNCOND = &H00000001
%EQUATE `LINEFORWARDMODE_UNCONDINTERNAL = &H00000002
%EQUATE `LINEFORWARDMODE_UNCONDEXTERNAL = &H00000004
%EQUATE `LINEFORWARDMODE_UNCONDSPECIFIC = &H00000008
%EQUATE `LINEFORWARDMODE_BUSY = &H00000010
%EQUATE `LINEFORWARDMODE_BUSYINTERNAL = &H00000020
%EQUATE `LINEFORWARDMODE_BUSYEXTERNAL = &H00000040
%EQUATE `LINEFORWARDMODE_BUSYSPECIFIC = &H00000080
%EQUATE `LINEFORWARDMODE_NOANSW = &H00000100
%EQUATE `LINEFORWARDMODE_NOANSWINTERNAL = &H00000200
%EQUATE `LINEFORWARDMODE_NOANSWEXTERNAL = &H00000400
%EQUATE `LINEFORWARDMODE_NOANSWSPECIFIC = &H00000800
%EQUATE `LINEFORWARDMODE_BUSYNA = &H00001000
%EQUATE `LINEFORWARDMODE_BUSYNAINTERNAL = &H00002000
%EQUATE `LINEFORWARDMODE_BUSYNAEXTERNAL = &H00004000
%EQUATE `LINEFORWARDMODE_BUSYNASPECIFIC = &H00008000
%EQUATE `LINEFORWARDMODE_UNKNOWN = &H00010000 ' // TAPI v1.4
%EQUATE `LINEFORWARDMODE_UNAVAIL = &H00020000 ' // TAPI v1.4
%EQUATE `LINEGATHERTERM_BUFFERFULL = &H00000001
%EQUATE `LINEGATHERTERM_TERMDIGIT = &H00000002
%EQUATE `LINEGATHERTERM_FIRSTTIMEOUT = &H00000004
%EQUATE `LINEGATHERTERM_INTERTIMEOUT = &H00000008
%EQUATE `LINEGATHERTERM_CANCEL = &H00000010
%EQUATE `LINEGENERATETERM_DONE = &H00000001
%EQUATE `LINEGENERATETERM_CANCEL = &H00000002
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ' //
' ' // These constants are mutually exclusive - there's no way to specify more
' ' // than one at a time (and it doesn't make sense, either) so they're
' ' // ordinal rather than bits.
' ' //
%EQUATE `LINEINITIALIZEEXOPTION_USEHIDDENWINDOW = &H00000001 ' // TAPI v2.0
%EQUATE `LINEINITIALIZEEXOPTION_USEEVENT = &H00000002 ' // TAPI v2.0
%EQUATE `LINEINITIALIZEEXOPTION_USECOMPLETIONPORT = &H00000003 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINEINITIALIZEEXOPTION_CALLHUBTRACKING = &H80000000 ' // TAPI v3.0
#ENDIF
%EQUATE `LINELOCATIONOPTION_PULSEDIAL = &H00000001 ' // TAPI v1.4
%EQUATE `LINEMAPPER = &HFFFFFFFF
%EQUATE `LINEMEDIACONTROL_NONE = &H00000001
%EQUATE `LINEMEDIACONTROL_START = &H00000002
%EQUATE `LINEMEDIACONTROL_RESET = &H00000004
%EQUATE `LINEMEDIACONTROL_PAUSE = &H00000008
%EQUATE `LINEMEDIACONTROL_RESUME = &H00000010
%EQUATE `LINEMEDIACONTROL_RATEUP = &H00000020
%EQUATE `LINEMEDIACONTROL_RATEDOWN = &H00000040
%EQUATE `LINEMEDIACONTROL_RATENORMAL = &H00000080
%EQUATE `LINEMEDIACONTROL_VOLUMEUP = &H00000100
%EQUATE `LINEMEDIACONTROL_VOLUMEDOWN = &H00000200
%EQUATE `LINEMEDIACONTROL_VOLUMENORMAL = &H00000400
%EQUATE `LINEMEDIAMODE_UNKNOWN = &H00000002
%EQUATE `LINEMEDIAMODE_INTERACTIVEVOICE = &H00000004
%EQUATE `LINEMEDIAMODE_AUTOMATEDVOICE = &H00000008
%EQUATE `LINEMEDIAMODE_DATAMODEM = &H00000010
%EQUATE `LINEMEDIAMODE_G3FAX = &H00000020
%EQUATE `LINEMEDIAMODE_TDD = &H00000040
%EQUATE `LINEMEDIAMODE_G4FAX = &H00000080
%EQUATE `LINEMEDIAMODE_DIGITALDATA = &H00000100
%EQUATE `LINEMEDIAMODE_TELETEX = &H00000200
%EQUATE `LINEMEDIAMODE_VIDEOTEX = &H00000400
%EQUATE `LINEMEDIAMODE_TELEX = &H00000800
%EQUATE `LINEMEDIAMODE_MIXED = &H00001000
%EQUATE `LINEMEDIAMODE_ADSI = &H00002000
%EQUATE `LINEMEDIAMODE_VOICEVIEW = &H00004000 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020001
%EQUATE `LINEMEDIAMODE_VIDEO = &H00008000 ' // TAPI v2.1
#ENDIF
%EQUATE `LAST_LINEMEDIAMODE = &H00008000
%EQUATE `LINEOFFERINGMODE_ACTIVE = &H00000001 ' // TAPI v1.4
%EQUATE `LINEOFFERINGMODE_INACTIVE = &H00000002 ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEOPENOPTION_SINGLEADDRESS = &H80000000 ' // TAPI v2.0
%EQUATE `LINEOPENOPTION_PROXY = &H40000000 ' // TAPI v2.0
#ENDIF
%EQUATE `LINEPARKMODE_DIRECTED = &H00000001
%EQUATE `LINEPARKMODE_NONDIRECTED = &H00000002
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINEPROXYREQUEST_SETAGENTGROUP = &H00000001 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_SETAGENTSTATE = &H00000002 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_SETAGENTACTIVITY = &H00000003 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_GETAGENTCAPS = &H00000004 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_GETAGENTSTATUS = &H00000005 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_AGENTSPECIFIC = &H00000006 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_GETAGENTACTIVITYLIST = &H00000007 ' // TAPI v2.0
%EQUATE `LINEPROXYREQUEST_GETAGENTGROUPLIST = &H00000008 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
%EQUATE `LINEPROXYREQUEST_CREATEAGENT = &H00000009 ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_SETAGENTMEASUREMENTPERIOD = &H0000000A ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETAGENTINFO = &H0000000B ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_CREATEAGENTSESSION = &H0000000C ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETAGENTSESSIONLIST = &H0000000D ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_SETAGENTSESSIONSTATE = &H0000000E ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETAGENTSESSIONINFO = &H0000000F ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETQUEUELIST = &H00000010 ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_SETQUEUEMEASUREMENTPERIOD = &H00000011 ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETQUEUEINFO = &H00000012 ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_GETGROUPLIST = &H00000013 ' // TAPI v2.2
%EQUATE `LINEPROXYREQUEST_SETAGENTSTATEEX = &H00000014 ' // TAPI v2.2
#ENDIF
%EQUATE `LINEREMOVEFROMCONF_NONE = &H00000001
%EQUATE `LINEREMOVEFROMCONF_LAST = &H00000002
%EQUATE `LINEREMOVEFROMCONF_ANY = &H00000003
%EQUATE `LINEREQUESTMODE_MAKECALL = &H00000001
%EQUATE `LINEREQUESTMODE_MEDIACALL = &H00000002
%EQUATE `LINEREQUESTMODE_DROP = &H00000004
%EQUATE `LAST_LINEREQUESTMODE = %LINEREQUESTMODE_MEDIACALL
%EQUATE `LINEROAMMODE_UNKNOWN = &H00000001
%EQUATE `LINEROAMMODE_UNAVAIL = &H00000002
%EQUATE `LINEROAMMODE_HOME = &H00000004
%EQUATE `LINEROAMMODE_ROAMA = &H00000008
%EQUATE `LINEROAMMODE_ROAMB = &H00000010
%EQUATE `LINESPECIALINFO_NOCIRCUIT = &H00000001
%EQUATE `LINESPECIALINFO_CUSTIRREG = &H00000002
%EQUATE `LINESPECIALINFO_REORDER = &H00000004
%EQUATE `LINESPECIALINFO_UNKNOWN = &H00000008
%EQUATE `LINESPECIALINFO_UNAVAIL = &H00000010
%EQUATE `LINETERMDEV_PHONE = &H00000001
%EQUATE `LINETERMDEV_HEADSET = &H00000002
%EQUATE `LINETERMDEV_SPEAKER = &H00000004
%EQUATE `LINETERMMODE_BUTTONS = &H00000001
%EQUATE `LINETERMMODE_LAMPS = &H00000002
%EQUATE `LINETERMMODE_DISPLAY = &H00000004
%EQUATE `LINETERMMODE_RINGER = &H00000008
%EQUATE `LINETERMMODE_HOOKSWITCH = &H00000010
%EQUATE `LINETERMMODE_MEDIATOLINE = &H00000020
%EQUATE `LINETERMMODE_MEDIAFROMLINE = &H00000040
%EQUATE `LINETERMMODE_MEDIABIDIRECT = &H00000080
%EQUATE `LINETERMSHARING_PRIVATE = &H00000001
%EQUATE `LINETERMSHARING_SHAREDEXCL = &H00000002
%EQUATE `LINETERMSHARING_SHAREDCONF = &H00000004
%EQUATE `LINETOLLLISTOPTION_ADD = &H00000001
%EQUATE `LINETOLLLISTOPTION_REMOVE = &H00000002
%EQUATE `LINETONEMODE_CUSTOM = &H00000001
%EQUATE `LINETONEMODE_RINGBACK = &H00000002
%EQUATE `LINETONEMODE_BUSY = &H00000004
%EQUATE `LINETONEMODE_BEEP = &H00000008
%EQUATE `LINETONEMODE_BILLING = &H00000010
%EQUATE `LINETRANSFERMODE_TRANSFER = &H00000001
%EQUATE `LINETRANSFERMODE_CONFERENCE = &H00000002
%EQUATE `LINETRANSLATEOPTION_CARDOVERRIDE = &H00000001
%EQUATE `LINETRANSLATEOPTION_CANCELCALLWAITING = &H00000002 ' // TAPI v1.4
%EQUATE `LINETRANSLATEOPTION_FORCELOCAL = &H00000004 ' // TAPI v1.4
%EQUATE `LINETRANSLATEOPTION_FORCELD = &H00000008 ' // TAPI v1.4
%EQUATE `LINETRANSLATERESULT_CANONICAL = &H00000001
%EQUATE `LINETRANSLATERESULT_INTERNATIONAL = &H00000002
%EQUATE `LINETRANSLATERESULT_LONGDISTANCE = &H00000004
%EQUATE `LINETRANSLATERESULT_LOCAL = &H00000008
%EQUATE `LINETRANSLATERESULT_INTOLLLIST = &H00000010
%EQUATE `LINETRANSLATERESULT_NOTINTOLLLIST = &H00000020
%EQUATE `LINETRANSLATERESULT_DIALBILLING = &H00000040
%EQUATE `LINETRANSLATERESULT_DIALQUIET = &H00000080
%EQUATE `LINETRANSLATERESULT_DIALDIALTONE = &H00000100
%EQUATE `LINETRANSLATERESULT_DIALPROMPT = &H00000200
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `LINETRANSLATERESULT_VOICEDETECT = &H00000400 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
%EQUATE `LINETRANSLATERESULT_NOTRANSLATION = &H00000800 ' // TAPI v3.0
#ENDIF
%EQUATE `PHONEBUTTONFUNCTION_UNKNOWN = &H00000000
%EQUATE `PHONEBUTTONFUNCTION_CONFERENCE = &H00000001
%EQUATE `PHONEBUTTONFUNCTION_TRANSFER = &H00000002
%EQUATE `PHONEBUTTONFUNCTION_DROP = &H00000003
%EQUATE `PHONEBUTTONFUNCTION_HOLD = &H00000004
%EQUATE `PHONEBUTTONFUNCTION_RECALL = &H00000005
%EQUATE `PHONEBUTTONFUNCTION_DISCONNECT = &H00000006
%EQUATE `PHONEBUTTONFUNCTION_CONNECT = &H00000007
%EQUATE `PHONEBUTTONFUNCTION_MSGWAITON = &H00000008
%EQUATE `PHONEBUTTONFUNCTION_MSGWAITOFF = &H00000009
%EQUATE `PHONEBUTTONFUNCTION_SELECTRING = &H0000000A
%EQUATE `PHONEBUTTONFUNCTION_ABBREVDIAL = &H0000000B
%EQUATE `PHONEBUTTONFUNCTION_FORWARD = &H0000000C
%EQUATE `PHONEBUTTONFUNCTION_PICKUP = &H0000000D
%EQUATE `PHONEBUTTONFUNCTION_RINGAGAIN = &H0000000E
%EQUATE `PHONEBUTTONFUNCTION_PARK = &H0000000F
%EQUATE `PHONEBUTTONFUNCTION_REJECT = &H00000010
%EQUATE `PHONEBUTTONFUNCTION_REDIRECT = &H00000011
%EQUATE `PHONEBUTTONFUNCTION_MUTE = &H00000012
%EQUATE `PHONEBUTTONFUNCTION_VOLUMEUP = &H00000013
%EQUATE `PHONEBUTTONFUNCTION_VOLUMEDOWN = &H00000014
%EQUATE `PHONEBUTTONFUNCTION_SPEAKERON = &H00000015
%EQUATE `PHONEBUTTONFUNCTION_SPEAKEROFF = &H00000016
%EQUATE `PHONEBUTTONFUNCTION_FLASH = &H00000017
%EQUATE `PHONEBUTTONFUNCTION_DATAON = &H00000018
%EQUATE `PHONEBUTTONFUNCTION_DATAOFF = &H00000019
%EQUATE `PHONEBUTTONFUNCTION_DONOTDISTURB = &H0000001A
%EQUATE `PHONEBUTTONFUNCTION_INTERCOM = &H0000001B
%EQUATE `PHONEBUTTONFUNCTION_BRIDGEDAPP = &H0000001C
%EQUATE `PHONEBUTTONFUNCTION_BUSY = &H0000001D
%EQUATE `PHONEBUTTONFUNCTION_CALLAPP = &H0000001E
%EQUATE `PHONEBUTTONFUNCTION_DATETIME = &H0000001F
%EQUATE `PHONEBUTTONFUNCTION_DIRECTORY = &H00000020
%EQUATE `PHONEBUTTONFUNCTION_COVER = &H00000021
%EQUATE `PHONEBUTTONFUNCTION_CALLID = &H00000022
%EQUATE `PHONEBUTTONFUNCTION_LASTNUM = &H00000023
%EQUATE `PHONEBUTTONFUNCTION_NIGHTSRV = &H00000024
%EQUATE `PHONEBUTTONFUNCTION_SENDCALLS = &H00000025
%EQUATE `PHONEBUTTONFUNCTION_MSGINDICATOR = &H00000026
%EQUATE `PHONEBUTTONFUNCTION_REPDIAL = &H00000027
%EQUATE `PHONEBUTTONFUNCTION_SETREPDIAL = &H00000028
%EQUATE `PHONEBUTTONFUNCTION_SYSTEMSPEED = &H00000029
%EQUATE `PHONEBUTTONFUNCTION_STATIONSPEED = &H0000002A
%EQUATE `PHONEBUTTONFUNCTION_CAMPON = &H0000002B
%EQUATE `PHONEBUTTONFUNCTION_SAVEREPEAT = &H0000002C
%EQUATE `PHONEBUTTONFUNCTION_QUEUECALL = &H0000002D
%EQUATE `PHONEBUTTONFUNCTION_NONE = &H0000002E
#IF %TAPI_CURRENT_VERSION >= &H00030001
%EQUATE `PHONEBUTTONFUNCTION_SEND = &H0000002F ' // TAPI v3.1
#ENDIF
%EQUATE `PHONEBUTTONMODE_DUMMY = &H00000001
%EQUATE `PHONEBUTTONMODE_CALL = &H00000002
%EQUATE `PHONEBUTTONMODE_FEATURE = &H00000004
%EQUATE `PHONEBUTTONMODE_KEYPAD = &H00000008
%EQUATE `PHONEBUTTONMODE_LOCAL = &H00000010
%EQUATE `PHONEBUTTONMODE_DISPLAY = &H00000020
%EQUATE `PHONEBUTTONSTATE_UP = &H00000001
%EQUATE `PHONEBUTTONSTATE_DOWN = &H00000002
%EQUATE `PHONEBUTTONSTATE_UNKNOWN = &H00000004 ' // TAPI v1.4
%EQUATE `PHONEBUTTONSTATE_UNAVAIL = &H00000008 ' // TAPI v1.4
%EQUATE `PHONEERR_ALLOCATED = &H90000001
%EQUATE `PHONEERR_BADDEVICEID = &H90000002
%EQUATE `PHONEERR_INCOMPATIBLEAPIVERSION = &H90000003
%EQUATE `PHONEERR_INCOMPATIBLEEXTVERSION = &H90000004
%EQUATE `PHONEERR_INIFILECORRUPT = &H90000005
%EQUATE `PHONEERR_INUSE = &H90000006
%EQUATE `PHONEERR_INVALAPPHANDLE = &H90000007
%EQUATE `PHONEERR_INVALAPPNAME = &H90000008
%EQUATE `PHONEERR_INVALBUTTONLAMPID = &H90000009
%EQUATE `PHONEERR_INVALBUTTONMODE = &H9000000A
%EQUATE `PHONEERR_INVALBUTTONSTATE = &H9000000B
%EQUATE `PHONEERR_INVALDATAID = &H9000000C
%EQUATE `PHONEERR_INVALDEVICECLASS = &H9000000D
%EQUATE `PHONEERR_INVALEXTVERSION = &H9000000E
%EQUATE `PHONEERR_INVALHOOKSWITCHDEV = &H9000000F
%EQUATE `PHONEERR_INVALHOOKSWITCHMODE = &H90000010
%EQUATE `PHONEERR_INVALLAMPMODE = &H90000011
%EQUATE `PHONEERR_INVALPARAM = &H90000012
%EQUATE `PHONEERR_INVALPHONEHANDLE = &H90000013
%EQUATE `PHONEERR_INVALPHONESTATE = &H90000014
%EQUATE `PHONEERR_INVALPOINTER = &H90000015
%EQUATE `PHONEERR_INVALPRIVILEGE = &H90000016
%EQUATE `PHONEERR_INVALRINGMODE = &H90000017
%EQUATE `PHONEERR_NODEVICE = &H90000018
%EQUATE `PHONEERR_NODRIVER = &H90000019
%EQUATE `PHONEERR_NOMEM = &H9000001A
%EQUATE `PHONEERR_NOTOWNER = &H9000001B
%EQUATE `PHONEERR_OPERATIONFAILED = &H9000001C
%EQUATE `PHONEERR_OPERATIONUNAVAIL = &H9000001D
%EQUATE `PHONEERR_RESOURCEUNAVAIL = &H9000001F
%EQUATE `PHONEERR_REQUESTOVERRUN = &H90000020
%EQUATE `PHONEERR_STRUCTURETOOSMALL = &H90000021
%EQUATE `PHONEERR_UNINITIALIZED = &H90000022
%EQUATE `PHONEERR_REINIT = &H90000023
%EQUATE `PHONEERR_DISCONNECTED = &H90000024
%EQUATE `PHONEERR_SERVICE_NOT_RUNNING = &H90000025
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `PHONEFEATURE_GETBUTTONINFO = &H00000001 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETDATA = &H00000002 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETDISPLAY = &H00000004 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETGAINHANDSET = &H00000008 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETGAINSPEAKER = &H00000010 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETGAINHEADSET = &H00000020 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETHOOKSWITCHHANDSET = &H00000040 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETHOOKSWITCHSPEAKER = &H00000080 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETHOOKSWITCHHEADSET = &H00000100 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETLAMP = &H00000200 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETRING = &H00000400 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETVOLUMEHANDSET = &H00000800 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETVOLUMESPEAKER = &H00001000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_GETVOLUMEHEADSET = &H00002000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETBUTTONINFO = &H00004000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETDATA = &H00008000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETDISPLAY = &H00010000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETGAINHANDSET = &H00020000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETGAINSPEAKER = &H00040000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETGAINHEADSET = &H00080000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETHOOKSWITCHHANDSET = &H00100000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETHOOKSWITCHSPEAKER = &H00200000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETHOOKSWITCHHEADSET = &H00400000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETLAMP = &H00800000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETRING = &H01000000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETVOLUMEHANDSET = &H02000000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETVOLUMESPEAKER = &H04000000 ' // TAPI v2.0
%EQUATE `PHONEFEATURE_SETVOLUMEHEADSET = &H08000000 ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030001
%EQUATE `PHONEFEATURE_GENERICPHONE = &H10000000 ' // TAPI v3.1
#ENDIF
%EQUATE `PHONEHOOKSWITCHDEV_HANDSET = &H00000001
%EQUATE `PHONEHOOKSWITCHDEV_SPEAKER = &H00000002
%EQUATE `PHONEHOOKSWITCHDEV_HEADSET = &H00000004
%EQUATE `PHONEHOOKSWITCHMODE_ONHOOK = &H00000001
%EQUATE `PHONEHOOKSWITCHMODE_MIC = &H00000002
%EQUATE `PHONEHOOKSWITCHMODE_SPEAKER = &H00000004
%EQUATE `PHONEHOOKSWITCHMODE_MICSPEAKER = &H00000008
%EQUATE `PHONEHOOKSWITCHMODE_UNKNOWN = &H00000010
#IF %TAPI_CURRENT_VERSION >= &H00020000
%EQUATE `PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW = &H00000001 ' // TAPI v2.0
%EQUATE `PHONEINITIALIZEEXOPTION_USEEVENT = &H00000002 ' // TAPI v2.0
%EQUATE `PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT = &H00000003 ' // TAPI v2.0
#ENDIF
%EQUATE `PHONELAMPMODE_DUMMY = &H00000001
%EQUATE `PHONELAMPMODE_OFF = &H00000002
%EQUATE `PHONELAMPMODE_STEADY = &H00000004
%EQUATE `PHONELAMPMODE_WINK = &H00000008
%EQUATE `PHONELAMPMODE_FLASH = &H00000010
%EQUATE `PHONELAMPMODE_FLUTTER = &H00000020
%EQUATE `PHONELAMPMODE_BROKENFLUTTER = &H00000040
%EQUATE `PHONELAMPMODE_UNKNOWN = &H00000080
%EQUATE `PHONEPRIVILEGE_MONITOR = &H00000001
%EQUATE `PHONEPRIVILEGE_OWNER = &H00000002
%EQUATE `PHONESTATE_OTHER = &H00000001
%EQUATE `PHONESTATE_CONNECTED = &H00000002
%EQUATE `PHONESTATE_DISCONNECTED = &H00000004
%EQUATE `PHONESTATE_OWNER = &H00000008
%EQUATE `PHONESTATE_MONITORS = &H00000010
%EQUATE `PHONESTATE_DISPLAY = &H00000020
%EQUATE `PHONESTATE_LAMP = &H00000040
%EQUATE `PHONESTATE_RINGMODE = &H00000080
%EQUATE `PHONESTATE_RINGVOLUME = &H00000100
%EQUATE `PHONESTATE_HANDSETHOOKSWITCH = &H00000200
%EQUATE `PHONESTATE_HANDSETVOLUME = &H00000400
%EQUATE `PHONESTATE_HANDSETGAIN = &H00000800
%EQUATE `PHONESTATE_SPEAKERHOOKSWITCH = &H00001000
%EQUATE `PHONESTATE_SPEAKERVOLUME = &H00002000
%EQUATE `PHONESTATE_SPEAKERGAIN = &H00004000
%EQUATE `PHONESTATE_HEADSETHOOKSWITCH = &H00008000
%EQUATE `PHONESTATE_HEADSETVOLUME = &H00010000
%EQUATE `PHONESTATE_HEADSETGAIN = &H00020000
%EQUATE `PHONESTATE_SUSPEND = &H00040000
%EQUATE `PHONESTATE_RESUME = &H00080000
%EQUATE `PHONESTATE_DEVSPECIFIC = &H00100000
%EQUATE `PHONESTATE_REINIT = &H00200000
%EQUATE `PHONESTATE_CAPSCHANGE = &H00400000 ' // TAPI v1.4
%EQUATE `PHONESTATE_REMOVED = &H00800000 ' // TAPI v1.4
%EQUATE `PHONESTATUSFLAGS_CONNECTED = &H00000001
%EQUATE `PHONESTATUSFLAGS_SUSPENDED = &H00000002
%EQUATE `STRINGFORMAT_ASCII = &H00000001
%EQUATE `STRINGFORMAT_DBCS = &H00000002
%EQUATE `STRINGFORMAT_UNICODE = &H00000003
%EQUATE `STRINGFORMAT_BINARY = &H00000004
%EQUATE `TAPI_REPLY = %WM_USER + 99
%EQUATE `TAPIERR_CONNECTED = 0&
%EQUATE `TAPIERR_DROPPED = -1&
%EQUATE `TAPIERR_NOREQUESTRECIPIENT = -2&
%EQUATE `TAPIERR_REQUESTQUEUEFULL = -3&
%EQUATE `TAPIERR_INVALDESTADDRESS = -4&
%EQUATE `TAPIERR_INVALWINDOWHANDLE = -5&
%EQUATE `TAPIERR_INVALDEVICECLASS = -6&
%EQUATE `TAPIERR_INVALDEVICEID = -7&
%EQUATE `TAPIERR_DEVICECLASSUNAVAIL = -8&
%EQUATE `TAPIERR_DEVICEIDUNAVAIL = -9&
%EQUATE `TAPIERR_DEVICEINUSE = -10&
%EQUATE `TAPIERR_DESTBUSY = -11&
%EQUATE `TAPIERR_DESTNOANSWER = -12&
%EQUATE `TAPIERR_DESTUNAVAIL = -13&
%EQUATE `TAPIERR_UNKNOWNWINHANDLE = -14&
%EQUATE `TAPIERR_UNKNOWNREQUESTID = -15&
%EQUATE `TAPIERR_REQUESTFAILED = -16&
%EQUATE `TAPIERR_REQUESTCANCELLED = -17&
%EQUATE `TAPIERR_INVALPOINTER = -18&
%EQUATE `TAPIERR_NOTADMIN = -19&
%EQUATE `TAPIERR_MMCWRITELOCKED = -20&
%EQUATE `TAPIERR_PROVIDERALREADYINSTALLED = -21&
%EQUATE `TAPIERR_SCP_ALREADY_EXISTS = -22&
%EQUATE `TAPIERR_SCP_DOES_NOT_EXIST = -23&
%EQUATE `TAPIMAXDESTADDRESSSIZE = 80&
%EQUATE `TAPIMAXAPPNAMESIZE = 40&
%EQUATE `TAPIMAXCALLEDPARTYSIZE = 40&
%EQUATE `TAPIMAXCOMMENTSIZE = 80&
%EQUATE `TAPIMAXDEVICECLASSSIZE = 40&
%EQUATE `TAPIMAXDEVICEIDSIZE = 40&
' ========================================================================================
' The LINEADDRESSCAPS structure describes the capabilities of a specified address. The
' lineGetAddressCaps function and the TSPI_lineGetAddressCaps function return the
' LINEADDRESSCAPS structure.
' ========================================================================================
' // Size = 228 bytes
TYPE LINEADDRESSCAPS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwLineDeviceID AS DWORD
 dwAddressSize AS DWORD
 dwAddressOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
 dwAddressSharing AS DWORD
 dwAddressStates AS DWORD
 dwCallInfoStates AS DWORD
 dwCallerIDFlags AS DWORD
 dwCalledIDFlags AS DWORD
 dwConnectedIDFlags AS DWORD
 dwRedirectionIDFlags AS DWORD
 dwRedirectingIDFlags AS DWORD
 dwCallStates AS DWORD
 dwDialToneModes AS DWORD
 dwBusyModes AS DWORD
 dwSpecialInfo AS DWORD
 dwDisconnectModes AS DWORD
 dwMaxNumActiveCalls AS DWORD
 dwMaxNumOnHoldCalls AS DWORD
 dwMaxNumOnHoldPendingCalls AS DWORD
 dwMaxNumConference AS DWORD
 dwMaxNumTransConf AS DWORD
 dwAddrCapFlags AS DWORD
 dwCallFeatures AS DWORD
 dwRemoveFromConfCaps AS DWORD
 dwRemoveFromConfState AS DWORD
 dwTransferModes AS DWORD
 dwParkModes AS DWORD
 dwForwardModes AS DWORD
 dwMaxForwardEntries AS DWORD
 dwMaxSpecificEntries AS DWORD
 dwMinFwdNumRings AS DWORD
 dwMaxFwdNumRings AS DWORD
 dwMaxCallCompletions AS DWORD
 dwCallCompletionConds AS DWORD
 dwCallCompletionModes AS DWORD
 dwNumCompletionMessages AS DWORD
 dwCompletionMsgTextEntrySize AS DWORD
 dwCompletionMsgTextSize AS DWORD
 dwCompletionMsgTextOffset AS DWORD
 dwAddressFeatures AS DWORD ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwPredictiveAutoTransferStates AS DWORD ' // TAPI v2.0
 dwNumCallTreatments AS DWORD ' // TAPI v2.0
 dwCallTreatmentListSize AS DWORD ' // TAPI v2.0
 dwCallTreatmentListOffset AS DWORD ' // TAPI v2.0
 dwDeviceClassesSize AS DWORD ' // TAPI v2.0
 dwDeviceClassesOffset AS DWORD ' // TAPI v2.0
 dwMaxCallDataSize AS DWORD ' // TAPI v2.0
 dwCallFeatures2 AS DWORD ' // TAPI v2.0
 dwMaxNoAnswerTimeout AS DWORD ' // TAPI v2.0
 dwConnectedModes AS DWORD ' // TAPI v2.0
 dwOfferingModes AS DWORD ' // TAPI v2.0
 dwAvailableMediaModes AS DWORD ' // TAPI v2.0
#ENDIF
END TYPE
' ========================================================================================
' The LINEADDRESSSTATUS structure describes the current status of an address. The
' lineGetAddressStatus function and the TSPI_lineGetAddressStatus function return the
' LINEADDRESSSTATUS structure.
' ========================================================================================
' // Size = 64 bytes
TYPE LINEADDRESSSTATUS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwNumInUse AS DWORD
 dwNumActiveCalls AS DWORD
 dwNumOnHoldCalls AS DWORD
 dwNumOnHoldPendCalls AS DWORD
 dwAddressFeatures AS DWORD
 dwNumRingsNoAnswer AS DWORD
 dwForwardNumEntries AS DWORD
 dwForwardSize AS DWORD
 dwForwardOffset AS DWORD
 dwTerminalModesSize AS DWORD
 dwTerminalModesOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The LINEAGENTACTIVITYENTRY structure describes a single ACD agent activity. The
' LINEAGENTACTIVITYLIST structure can contain an array of LINEAGENTACTIVITYENTRY
' structures.
' ========================================================================================
' // Size = 12 bytes
TYPE LINEAGENTACTIVITYENTRY DWORD
 dwID AS DWORD ' // TAPI v2.0
 dwNameSize AS DWORD ' // TAPI v2.0
 dwNameOffset AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAGENTACTIVITYLIST structure describes a list of ACD agent activities. This
' structure can contain an array of LINEAGENTACTIVITYENTRY structures. The
' lineGetAgentActivityList function returns the LINEAGENTACTIVITYLIST structure.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEAGENTACTIVITYLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwNumEntries AS DWORD ' // TAPI v2.0
 dwListSize AS DWORD ' // TAPI v2.0
 dwListOffset AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAGENTCAPS structure describes the capabilities of an ACD agent. The
' lineGetAgentCaps function returns the LINEAGENTCAPS structure.
' ========================================================================================
' // Size = 72 bytes
TYPE LINEAGENTCAPS DWORD
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwAgentHandlerInfoSize AS DWORD ' // TAPI v2.0
 dwAgentHandlerInfoOffset AS DWORD ' // TAPI v2.0
 dwCapsVersion AS DWORD ' // TAPI v2.0
 dwFeatures AS DWORD ' // TAPI v2.0
 dwStates AS DWORD ' // TAPI v2.0
 dwNextStates AS DWORD ' // TAPI v2.0
 dwMaxNumGroupEntries AS DWORD ' // TAPI v2.0
 dwAgentStatusMessages AS DWORD ' // TAPI v2.0
 dwNumAgentExtensionIDs AS DWORD ' // TAPI v2.0
 dwAgentExtensionIDListSize AS DWORD ' // TAPI v2.0
 dwAgentExtensionIDListOffset AS DWORD ' // TAPI v2.0
#IF %TAPI_CURRENT_VERSION >= &H00020002
 ProxyGUID AS GUID ' // TAPI v2.2
#ENDIF
END TYPE
'typedef struct lineagentgroupentry_tag
'{
' struct
' {
' dwGroupID1 AS DWORD ' // TAPI v2.0
' dwGroupID2 AS DWORD ' // TAPI v2.0
' dwGroupID3 AS DWORD ' // TAPI v2.0
' dwGroupID4 AS DWORD ' // TAPI v2.0
' } GroupID AS DWORD
' dwNameSize AS DWORD ' // TAPI v2.0
' dwNameOffset AS DWORD ' // TAPI v2.0
'} LINEAGENTGROUPENTRY, *LPLINEAGENTGROUPENTRY AS DWORD
' // Size = 16 bytes
TYPE GroupID DWORD
 dwGroupID1 AS DWORD ' // TAPI v2.0
 dwGroupID2 AS DWORD ' // TAPI v2.0
 dwGroupID3 AS DWORD ' // TAPI v2.0
 dwGroupID4 AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAGENTGROUPENTRY structure provides information on ACD agent groups. The
' LINEAGENTGROUPLIST structure can contain an array of LINEAGENTGROUPENTRY structures.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEAGENTGROUPENTRY DWORD
 GroupID
 dwNameSize AS DWORD ' // TAPI v2.0
 dwNameOffset AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAGENTGROUPLIST structure describes a list of ACD agent groups. This structure
' can contain an array of LINEAGENTGROUPENTRY structures.
' Multiple functions use the LINEAGENTGROUPLIST structure; these include the
' lineGetAgentGroupList, lineGetGroupList and lineSetAgentGroup functions.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEAGENTGROUPLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwNumEntries AS DWORD ' // TAPI v2.0
 dwListSize AS DWORD ' // TAPI v2.0
 dwListOffset AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAGENTSTATUS structure describes the current status of an ACD agent. The
' lineGetAgentStatus function returns the LINEAGENTSTATUS structure.
' ========================================================================================
' // Size = 56 bytes
TYPE LINEAGENTSTATUS DWORD
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwNumEntries AS DWORD ' // TAPI v2.0
 dwGroupListSize AS DWORD ' // TAPI v2.0
 dwGroupListOffset AS DWORD ' // TAPI v2.0
 dwState AS DWORD ' // TAPI v2.0
 dwNextState AS DWORD ' // TAPI v2.0
 dwActivityID AS DWORD ' // TAPI v2.0
 dwActivitySize AS DWORD ' // TAPI v2.0
 dwActivityOffset AS DWORD ' // TAPI v2.0
 dwAgentFeatures AS DWORD ' // TAPI v2.0
 dwValidStates AS DWORD ' // TAPI v2.0
 dwValidNextStates AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The LINEAPPINFO structure contains information about the application that is currently
' running. The LINEDEVSTATUS structure can contain an array of LINEAPPINFO structures.
' ========================================================================================
' // Size = 40 bytes
TYPE LINEAPPINFO DWORD
 dwMachineNameSize AS DWORD ' // TAPI v2.0
 dwMachineNameOffset AS DWORD ' // TAPI v2.0
 dwUserNameSize AS DWORD ' // TAPI v2.0
 dwUserNameOffset AS DWORD ' // TAPI v2.0
 dwModuleFilenameSize AS DWORD ' // TAPI v2.0
 dwModuleFilenameOffset AS DWORD ' // TAPI v2.0
 dwFriendlyNameSize AS DWORD ' // TAPI v2.0
 dwFriendlyNameOffset AS DWORD ' // TAPI v2.0
 dwMediaModes AS DWORD ' // TAPI v2.0
 dwAddressID AS DWORD ' // TAPI v2.0
END TYPE
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The LINEAGENTENTRY structure describes an individual ACD agent. The LINEAGENTLIST
' structure can contain an array of LINEAGENTENTRY structures.
' ========================================================================================
' // Size = 28 bytes
TYPE LINEAGENTENTRY DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 dwNameSize AS DWORD ' // TAPI v2.2
 dwNameOffset AS DWORD ' // TAPI v2.2
 dwIDSize AS DWORD ' // TAPI v2.2
 dwIDOffset AS DWORD ' // TAPI v2.2
 dwPINSize AS DWORD ' // TAPI v2.2
 dwPINOffset AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEAGENTLIST structure describes a list of ACD agents. This structure can contain
' an array of LINEAGENTENTRY structures.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEAGENTLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwNumEntries AS DWORD ' // TAPI v2.2
 dwListSize AS DWORD ' // TAPI v2.2
 dwListOffset AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEAGENTINFO structure contains information about an ACD agent. The
' lineGetAgentInfo function returns the LINEAGENTINFO structure.
' ========================================================================================
' // Size = 56 bytes
TYPE LINEAGENTINFO DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwAgentState AS DWORD ' // TAPI v2.2
 dwNextAgentState AS DWORD ' // TAPI v2.2
 dwMeasurementPeriod AS DWORD ' // TAPI v2.2
 cyOverallCallRate AS CUR ' CURRENCY ' // TAPI v2.2
 dwNumberOfACDCalls AS DWORD ' // TAPI v2.2
 dwNumberOfIncomingCalls AS DWORD ' // TAPI v2.2
 dwNumberOfOutgoingCalls AS DWORD ' // TAPI v2.2
 dwTotalACDTalkTime AS DWORD ' // TAPI v2.2
 dwTotalACDCallTime AS DWORD ' // TAPI v2.2
 dwTotalACDWrapUpTime AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEAGENTSESSIONENTRY structure describes an ACD agent session.
' The LINEAGENTSESSIONLIST structure can contain an array of LINEAGENTSESSIONENTRY structures.
' ========================================================================================
' // Size = 28 bytes
TYPE LINEAGENTSESSIONENTRY DWORD
 hAgentSession AS DWORD ' HAGENTSESSION ' // TAPI v2.2
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 GroupID AS GUID ' // TAPI v2.2
 dwWorkingAddressID AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEAGENTSESSIONLIST structure describes a list of ACD agent sessions. This
' structure can contain an array of LINEAGENTSESSIONENTRY structures. The
' lineGetAgentSessionList function returns the LINEAGENTSESSIONLIST structure.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEAGENTSESSIONLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwNumEntries AS DWORD ' // TAPI v2.2
 dwListSize AS DWORD ' // TAPI v2.2
 dwListOffset AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEAGENTSESSIONINFO structure contains information about the ACD agent session.
' The lineGetAgentSessionInfo function returns the LINEAGENTSESSIONINFO structure.
' ========================================================================================
' // Size = 76 bytes
TYPE LINEAGENTSESSIONINFO DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwAgentSessionState AS DWORD ' // TAPI v2.2
 dwNextAgentSessionState AS DWORD ' // TAPI v2.2
 dateSessionStartTime AS DOUBLE ' DATE ' // TAPI v2.2
 dwSessionDuration AS DWORD ' // TAPI v2.2
 dwNumberOfCalls AS DWORD ' // TAPI v2.2
 dwTotalTalkTime AS DWORD ' // TAPI v2.2
 dwAverageTalkTime AS DWORD ' // TAPI v2.2
 dwTotalCallTime AS DWORD ' // TAPI v2.2
 dwAverageCallTime AS DWORD ' // TAPI v2.2
 dwTotalWrapUpTime AS DWORD ' // TAPI v2.2
 dwAverageWrapUpTime AS DWORD ' // TAPI v2.2
 cyACDCallRate AS CUR ' CURRENCY ' // TAPI v2.2
 dwLongestTimeToAnswer AS DWORD ' // TAPI v2.2
 dwAverageTimeToAnswer AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEQUEUEENTRY structure provides the information for a single queue entry. The
' LINEQUEUELIST structure can contain an array of LINEQUEUEENTRY structures. This
' structure requires TAPI 3.0 version negotiation.
' ========================================================================================
' // Size = 12 bytes
TYPE LINEQUEUEENTRY DWORD
 dwQueueID AS DWORD ' // TAPI v2.2
 dwNameSize AS DWORD ' // TAPI v2.2
 dwNameOffset AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEQUEUELIST structure describes a list of queues. This structure can contain an
' array of LINEQUEUEENTRY structures. The lineGetQueueList function returns the
' LINEQUEUELIST structure. LINEQUEUELIST requires TAPI 3.0 version negotiation.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEQUEUELIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwNumEntries AS DWORD ' // TAPI v2.2
 dwListSize AS DWORD ' // TAPI v2.2
 dwListOffset AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEQUEUEINFO structure provides information about a queue on a line device. The
' lineGetQueueInfo function returns the LINEQUEUEINFO structure. This structure requires
' TAPI 3.0 version negotiation.
' ========================================================================================
' // Size = 52 bytes
TYPE LINEQUEUEINFO DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwMeasurementPeriod AS DWORD ' // TAPI v2.2
 dwTotalCallsQueued AS DWORD ' // TAPI v2.2
 dwCurrentCallsQueued AS DWORD ' // TAPI v2.2
 dwTotalCallsAbandoned AS DWORD ' // TAPI v2.2
 dwTotalCallsFlowedIn AS DWORD ' // TAPI v2.2
 dwTotalCallsFlowedOut AS DWORD ' // TAPI v2.2
 dwLongestEverWaitTime AS DWORD ' // TAPI v2.2
 dwCurrentLongestWaitTime AS DWORD ' // TAPI v2.2
 dwAverageWaitTime AS DWORD ' // TAPI v2.2
 dwFinalDisposition AS DWORD ' // TAPI v2.2
END TYPE
' ========================================================================================
' The LINEPROXYREQUESTLIST structure describes a list of proxy requests. The
' lineGetProxyStatus function returns the LINEPROXYREQUESTLIST structure.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEPROXYREQUESTLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v2.2
 dwNeededSize AS DWORD ' // TAPI v2.2
 dwUsedSize AS DWORD ' // TAPI v2.2
 dwNumEntries AS DWORD ' // TAPI v2.2
 dwListSize AS DWORD ' // TAPI v2.2
 dwListOffset AS DWORD ' // TAPI v2.2
END TYPE
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
' ========================================================================================
' The LINECALLHUBTRACKINGINFO structure contains information that reports the type of
' tracking available to a call hub. This structure is exposed only to applications that
' negotiate a TAPI version of 2.2 or higher.
' ========================================================================================
' // Size = 20 bytes
TYPE LINECALLHUBTRACKINGINFO DWORD
 dwTotalSize AS DWORD ' // TAPI v3.0
 dwNeededSize AS DWORD ' // TAPI v3.0
 dwUsedSize AS DWORD ' // TAPI v3.0
 dwAvailableTracking AS DWORD ' // TAPI v3.0
 dwCurrentTracking AS DWORD ' // TAPI v3.0
END TYPE
#ENDIF
' ========================================================================================
' The LINEDIALPARAMS structure specifies a collection of dialing-related fields. Call the
' lineSetCallParams function or the TSPI_lineSetCallParams function to set parameters for
' a call using the LINEDIALPARAMS structure.
' ========================================================================================
' // Size = 16 bytes
TYPE LINEDIALPARAMS DWORD
 dwDialPause AS DWORD
 dwDialSpeed AS DWORD
 dwDigitDuration AS DWORD
 dwWaitForDialtone AS DWORD
END TYPE
' ========================================================================================
' The LINECALLINFO structure contains information about a call. This information remains
' relatively fixed for the duration of the call. Multiple functions use LINECALLINFO. The
' structure is returned by the lineGetCallInfo function and the TSPI_lineGetCallInfo
' function. If a part of the structure does change, then a LINE_CALLINFO message is sent
' to the application indicating which information item has changed.
' Dynamically changing information about a call, such as call progress status, is available
' in the LINECALLSTATUS structure, returned by a call to the lineGetCallStatus function.
' ========================================================================================
' // Size = 324 bytes
TYPE LINECALLINFO DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 hLine AS DWORD ' HLINE
 dwLineDeviceID AS DWORD
 dwAddressID AS DWORD
 dwBearerMode AS DWORD
 dwRate AS DWORD
 dwMediaMode AS DWORD
 dwAppSpecific AS DWORD
 dwCallID AS DWORD
 dwRelatedCallID AS DWORD
 dwCallParamFlags AS DWORD
 dwCallStates AS DWORD
 dwMonitorDigitModes AS DWORD
 dwMonitorMediaModes AS DWORD
 DialParams AS LINEDIALPARAMS
 dwOrigin AS DWORD
 dwReason AS DWORD
 dwCompletionID AS DWORD
 dwNumOwners AS DWORD
 dwNumMonitors AS DWORD
 dwCountryCode AS DWORD
 dwTrunk AS DWORD
 dwCallerIDFlags AS DWORD
 dwCallerIDSize AS DWORD
 dwCallerIDOffset AS DWORD
 dwCallerIDNameSize AS DWORD
 dwCallerIDNameOffset AS DWORD
 dwCalledIDFlags AS DWORD
 dwCalledIDSize AS DWORD
 dwCalledIDOffset AS DWORD
 dwCalledIDNameSize AS DWORD
 dwCalledIDNameOffset AS DWORD
 dwConnectedIDFlags AS DWORD
 dwConnectedIDSize AS DWORD
 dwConnectedIDOffset AS DWORD
 dwConnectedIDNameSize AS DWORD
 dwConnectedIDNameOffset AS DWORD
 dwRedirectionIDFlags AS DWORD
 dwRedirectionIDSize AS DWORD
 dwRedirectionIDOffset AS DWORD
 dwRedirectionIDNameSize AS DWORD
 dwRedirectionIDNameOffset AS DWORD
 dwRedirectingIDFlags AS DWORD
 dwRedirectingIDSize AS DWORD
 dwRedirectingIDOffset AS DWORD
 dwRedirectingIDNameSize AS DWORD
 dwRedirectingIDNameOffset AS DWORD
 dwAppNameSize AS DWORD
 dwAppNameOffset AS DWORD
 dwDisplayableAddressSize AS DWORD
 dwDisplayableAddressOffset AS DWORD
 dwCalledPartySize AS DWORD
 dwCalledPartyOffset AS DWORD
 dwCommentSize AS DWORD
 dwCommentOffset AS DWORD
 dwDisplaySize AS DWORD
 dwDisplayOffset AS DWORD
 dwUserUserInfoSize AS DWORD
 dwUserUserInfoOffset AS DWORD
 dwHighLevelCompSize AS DWORD
 dwHighLevelCompOffset AS DWORD
 dwLowLevelCompSize AS DWORD
 dwLowLevelCompOffset AS DWORD
 dwChargingInfoSize AS DWORD
 dwChargingInfoOffset AS DWORD
 dwTerminalModesSize AS DWORD
 dwTerminalModesOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwCallTreatment AS DWORD ' // TAPI v2.0
 dwCallDataSize AS DWORD ' // TAPI v2.0
 dwCallDataOffset AS DWORD ' // TAPI v2.0
 dwSendingFlowspecSize AS DWORD ' // TAPI v2.0
 dwSendingFlowspecOffset AS DWORD ' // TAPI v2.0
 dwReceivingFlowspecSize AS DWORD ' // TAPI v2.0
 dwReceivingFlowspecOffset AS DWORD ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
 dwCallerIDAddressType AS DWORD ' // TAPI v3.0
 dwCalledIDAddressType AS DWORD ' // TAPI v3.0
 dwConnectedIDAddressType AS DWORD ' // TAPI v3.0
 dwRedirectionIDAddressType AS DWORD ' // TAPI v3.0
 dwRedirectingIDAddressType AS DWORD ' // TAPI v3.0
#ENDIF
END TYPE
' ========================================================================================
' The LINECALLLIST structure describes a list of call handles. A structure of this type is
' returned by the lineGetNewCalls and lineGetConfRelatedCalls functions.
' ========================================================================================
' // Size = 24 bytes
TYPE LINECALLLIST DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwCallsNumEntries AS DWORD
 dwCallsSize AS DWORD
 dwCallsOffset AS DWORD
END TYPE
' ========================================================================================
' The LINECALLPARAMS structure describes parameters supplied when making calls using the
' lineMakeCall and TSPI_lineMakeCall functions. The LINECALLPARAMS structure is also used
' as a parameter in other operations, such as the lineOpen function.
' The comments to the right of the syntax block indicate the default values used when this
' structure is not provided to lineMakeCall.
' ========================================================================================
' // Size = 176 bytes
TYPE LINECALLPARAMS DWORD
 dwTotalSize AS DWORD ' ' // ---------
 dwBearerMode AS DWORD ' ' // voice
 dwMinRate AS DWORD ' ' // (3.1kHz)
 dwMaxRate AS DWORD ' ' // (3.1kHz)
 dwMediaMode AS DWORD ' ' // interactiveVoice
 dwCallParamFlags AS DWORD ' ' // 0
 dwAddressMode AS DWORD ' ' // addressID
 dwAddressID AS DWORD ' ' // (any available)
 DialParams AS LINEDIALPARAMS ' ' // (0, 0, 0, 0)
 dwOrigAddressSize AS DWORD ' ' // 0
 dwOrigAddressOffset AS DWORD
 dwDisplayableAddressSize AS DWORD
 dwDisplayableAddressOffset AS DWORD
 dwCalledPartySize AS DWORD ' ' // 0
 dwCalledPartyOffset AS DWORD
 dwCommentSize AS DWORD ' ' // 0
 dwCommentOffset AS DWORD
 dwUserUserInfoSize AS DWORD ' ' // 0
 dwUserUserInfoOffset AS DWORD
 dwHighLevelCompSize AS DWORD ' ' // 0
 dwHighLevelCompOffset AS DWORD
 dwLowLevelCompSize AS DWORD ' ' // 0
 dwLowLevelCompOffset AS DWORD
 dwDevSpecificSize AS DWORD ' ' // 0
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwPredictiveAutoTransferStates AS DWORD ' // TAPI v2.0
 dwTargetAddressSize AS DWORD ' // TAPI v2.0
 dwTargetAddressOffset AS DWORD ' // TAPI v2.0
 dwSendingFlowspecSize AS DWORD ' // TAPI v2.0
 dwSendingFlowspecOffset AS DWORD ' // TAPI v2.0
 dwReceivingFlowspecSize AS DWORD ' // TAPI v2.0
 dwReceivingFlowspecOffset AS DWORD ' // TAPI v2.0
 dwDeviceClassSize AS DWORD ' // TAPI v2.0
 dwDeviceClassOffset AS DWORD ' // TAPI v2.0
 dwDeviceConfigSize AS DWORD ' // TAPI v2.0
 dwDeviceConfigOffset AS DWORD ' // TAPI v2.0
 dwCallDataSize AS DWORD ' // TAPI v2.0
 dwCallDataOffset AS DWORD ' // TAPI v2.0
 dwNoAnswerTimeout AS DWORD ' // TAPI v2.0
 dwCallingPartyIDSize AS DWORD ' // TAPI v2.0
 dwCallingPartyIDOffset AS DWORD ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
 dwAddressType AS DWORD ' // TAPI v3.0
#ENDIF
END TYPE
' ========================================================================================
' The LINECALLSTATUS structure describes the current status of a call. The information in
' this structure depends on the device capabilities of the address, the ownership of the
' call by the invoking application, and the current state of the call being queried. The
' lineGetCallStatus and TSPI_lineGetCallStatus functions return the LINECALLSTATUS
' structure.
' ========================================================================================
' // Size = 56 bytes
TYPE LINECALLSTATUS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwCallState AS DWORD
 dwCallStateMode AS DWORD
 dwCallPrivilege AS DWORD
 dwCallFeatures AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwCallFeatures2 AS DWORD ' // TAPI v2.0
 tStateEntryTime AS SYSTEMTIME ' SYSTEMTIME // TAPI v2.0
#ENDIF
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The LINECALLTREATMENTENTRY structure provides information on the type of call treatment,
' such as music, recorded announcement, or silence, on the current call. The LINEADDRESSCAPS
' structure can contain an array of LINECALLTREATMENTENTRY structures.
' ========================================================================================
' // Size = 12 bytes
TYPE LINECALLTREATMENTENTRY DWORD
 dwCallTreatmentID AS DWORD ' // TAPI v2.0
 dwCallTreatmentNameSize AS DWORD ' // TAPI v2.0
 dwCallTreatmentNameOffset AS DWORD ' // TAPI v2.0
END TYPE
#ENDIF
' ========================================================================================
' The LINECARDENTRY structure describes a calling card. The LINETRANSLATECAPS structure
' can contain an array of LINECARDENTRY structures.
' ========================================================================================
' // Size = 44 bytes
TYPE LINECARDENTRY DWORD
 dwPermanentCardID AS DWORD
 dwCardNameSize AS DWORD
 dwCardNameOffset AS DWORD
 dwCardNumberDigits AS DWORD ' // TAPI v1.4
 dwSameAreaRuleSize AS DWORD ' // TAPI v1.4
 dwSameAreaRuleOffset AS DWORD ' // TAPI v1.4
 dwLongDistanceRuleSize AS DWORD ' // TAPI v1.4
 dwLongDistanceRuleOffset AS DWORD ' // TAPI v1.4
 dwInternationalRuleSize AS DWORD ' // TAPI v1.4
 dwInternationalRuleOffset AS DWORD ' // TAPI v1.4
 dwOptions AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The LINECOUNTRYENTRY structure provides the data for a single country/region entry. An
' array of one or more of these structures is part of the LINECOUNTRYLIST structure
' returned by the lineGetCountry function.
' ========================================================================================
' // Size = 44 bytes
TYPE LINECOUNTRYENTRY DWORD
 dwCountryID AS DWORD ' // TAPI v1.4
 dwCountryCode AS DWORD ' // TAPI v1.4
 dwNextCountryID AS DWORD ' // TAPI v1.4
 dwCountryNameSize AS DWORD ' // TAPI v1.4
 dwCountryNameOffset AS DWORD ' // TAPI v1.4
 dwSameAreaRuleSize AS DWORD ' // TAPI v1.4
 dwSameAreaRuleOffset AS DWORD ' // TAPI v1.4
 dwLongDistanceRuleSize AS DWORD ' // TAPI v1.4
 dwLongDistanceRuleOffset AS DWORD ' // TAPI v1.4
 dwInternationalRuleSize AS DWORD ' // TAPI v1.4
 dwInternationalRuleOffset AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The LINECOUNTRYLIST structure describes a list of countries/regions. This structure can
' contain an array of LINECOUNTRYENTRY structures. LINECOUNTRYLIST is returned by the
' lineGetCountry function.
' ========================================================================================
' // Size = 24 bytes
TYPE LINECOUNTRYLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v1.4
 dwNeededSize AS DWORD ' // TAPI v1.4
 dwUsedSize AS DWORD ' // TAPI v1.4
 dwNumCountries AS DWORD ' // TAPI v1.4
 dwCountryListSize AS DWORD ' // TAPI v1.4
 dwCountryListOffset AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The LINEDEVCAPS structure describes the capabilities of a line device. The lineGetDevCaps
' function and the TSPI_lineGetDevCaps function return the LINEDEVCAPS structure.
' ========================================================================================
' // Size = 268 bytes
TYPE LINEDEVCAPS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwProviderInfoSize AS DWORD
 dwProviderInfoOffset AS DWORD
 dwSwitchInfoSize AS DWORD
 dwSwitchInfoOffset AS DWORD
 dwPermanentLineID AS DWORD
 dwLineNameSize AS DWORD
 dwLineNameOffset AS DWORD
 dwStringFormat AS DWORD
 dwAddressModes AS DWORD
 dwNumAddresses AS DWORD
 dwBearerModes AS DWORD
 dwMaxRate AS DWORD
 dwMediaModes AS DWORD
 dwGenerateToneModes AS DWORD
 dwGenerateToneMaxNumFreq AS DWORD
 dwGenerateDigitModes AS DWORD
 dwMonitorToneMaxNumFreq AS DWORD
 dwMonitorToneMaxNumEntries AS DWORD
 dwMonitorDigitModes AS DWORD
 dwGatherDigitsMinTimeout AS DWORD
 dwGatherDigitsMaxTimeout AS DWORD
 dwMedCtlDigitMaxListSize AS DWORD
 dwMedCtlMediaMaxListSize AS DWORD
 dwMedCtlToneMaxListSize AS DWORD
 dwMedCtlCallStateMaxListSize AS DWORD
 dwDevCapFlags AS DWORD
 dwMaxNumActiveCalls AS DWORD
 dwAnswerMode AS DWORD
 dwRingModes AS DWORD
 dwLineStates AS DWORD
 dwUUIAcceptSize AS DWORD
 dwUUIAnswerSize AS DWORD
 dwUUIMakeCallSize AS DWORD
 dwUUIDropSize AS DWORD
 dwUUISendUserUserInfoSize AS DWORD
 dwUUICallInfoSize AS DWORD
 MinDialParams AS LINEDIALPARAMS
 MaxDialParams AS LINEDIALPARAMS
 DefaultDialParams AS LINEDIALPARAMS
 dwNumTerminals AS DWORD
 dwTerminalCapsSize AS DWORD
 dwTerminalCapsOffset AS DWORD
 dwTerminalTextEntrySize AS DWORD
 dwTerminalTextSize AS DWORD
 dwTerminalTextOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
 dwLineFeatures AS DWORD ' // TAPI v1.4
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwSettableDevStatus AS DWORD ' // TAPI v2.0
 dwDeviceClassesSize AS DWORD ' // TAPI v2.0
 dwDeviceClassesOffset AS DWORD ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
 PermanentLineGuid AS GUID ' // TAPI v2.2
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00030000
 dwAddressTypes AS DWORD ' // TAPI v3.0
 ProtocolGuid AS GUID ' // TAPI v3.0
 dwAvailableTracking AS DWORD ' // TAPI v3.0
#ENDIF
END TYPE
' ========================================================================================
' The LINEDEVSTATUS structure describes the current status of a line device. The
' lineGetLineDevStatus function and the TSPI_lineGetLineDevStatus function return the
' LINEDEVSTATUS structure.
' ========================================================================================
' // Size = 88 bytes
TYPE LINEDEVSTATUS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwNumOpens AS DWORD
 dwOpenMediaModes AS DWORD
 dwNumActiveCalls AS DWORD
 dwNumOnHoldCalls AS DWORD
 dwNumOnHoldPendCalls AS DWORD
 dwLineFeatures AS DWORD
 dwNumCallCompletions AS DWORD
 dwRingMode AS DWORD
 dwSignalLevel AS DWORD
 dwBatteryLevel AS DWORD
 dwRoamMode AS DWORD
 dwDevStatusFlags AS DWORD
 dwTerminalModesSize AS DWORD
 dwTerminalModesOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwAvailableMediaModes AS DWORD ' // TAPI v2.0
 dwAppInfoSize AS DWORD ' // TAPI v2.0
 dwAppInfoOffset AS DWORD ' // TAPI v2.0
#ENDIF
END TYPE
' ========================================================================================
' The LINEEXTENSIONID structure describes an extension identifier. Extension identifiers
' are used to identify service provider-specific extensions for line devices. Multiple
' functions use this structure, including the lineNegotiateAPIVersion function and the
' TSPI_lineGetExtensionID function.
' ========================================================================================
' // Size = 16 bytes
TYPE LINEEXTENSIONID DWORD
 dwExtensionID0 AS DWORD
 dwExtensionID1 AS DWORD
 dwExtensionID2 AS DWORD
 dwExtensionID3 AS DWORD
END TYPE
' ========================================================================================
' The LINEFORWARD structure describes an entry of the forwarding instructions. The
' LINEFORWARDLIST and the LINEADDRESSSTATUS structures can contain an array of LINEFORWARD
' structures.
' ========================================================================================
' // Size = 24 bytes
TYPE tagLINEFORWARD DWORD
 dwForwardMode AS DWORD
 dwCallerAddressSize AS DWORD
 dwCallerAddressOffset AS DWORD
 dwDestCountryCode AS DWORD
 dwDestAddressSize AS DWORD
 dwDestAddressOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00030001
 dwCallerAddressType AS DWORD
 dwDestAddressType AS DWORD
#ENDIF
END TYPE
' ========================================================================================
' The LINEFORWARDLIST structure describes a list of forwarding instructions. This
' structure can contain an array of LINEFORWARD structures. The lineForward and
' TSPI_lineForward functions use the LINEFORWARDLIST structure.
' ========================================================================================
' // Size = 32 bytes
TYPE LINEFORWARDLIST DWORD
 dwTotalSize AS DWORD
 dwNumEntries AS DWORD
 ForwardList(0) AS tagLINEFORWARD
END TYPE
' ========================================================================================
' The LINEGENERATETONE structure contains information about a tone to be generated. This
' structure is used by the lineGenerateTone and TSPI_lineGenerateTone functions.
' ========================================================================================
' // Size = 16 bytes
TYPE tagLINEGENERATETONE DWORD
 dwFrequency AS DWORD
 dwCadenceOn AS DWORD
 dwCadenceOff AS DWORD
 dwVolume AS DWORD
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The LINEINITIZALIZEEXPARAMS structure describes parameters supplied when making calls
' using LINEINITIALIZEEX.
' ========================================================================================
' // Size = 4 bytes
UNION LINEINITIALIZEEXPARAMS_HANDLES_UNION DWORD
 hEvent AS DWORD ' HANDLE ' // TAPI v2.0
 hCompletionPort AS DWORD ' HANDLE ' // TAPI v2.0
END UNION
' // Size = 24 bytes
TYPE LINEINITIALIZEEXPARAMS
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwOptions AS DWORD ' // TAPI v2.0
 LINEINITIALIZEEXPARAMS_HANDLES_UNION
 dwCompletionKey AS DWORD ' // TAPI v2.0
END TYPE
#ENDIF
' ========================================================================================
' The LINELOCATIONENTRY structure describes a location used to provide an address
' translation context. The LINETRANSLATECAPS structure can contain an array of
' LINELOCATIONENTRY structures.
' ========================================================================================
' // Size = 68 bytes
TYPE LINELOCATIONENTRY DWORD
 dwPermanentLocationID AS DWORD
 dwLocationNameSize AS DWORD
 dwLocationNameOffset AS DWORD
 dwCountryCode AS DWORD
 dwCityCodeSize AS DWORD
 dwCityCodeOffset AS DWORD
 dwPreferredCardID AS DWORD
 dwLocalAccessCodeSize AS DWORD ' // TAPI v1.4
 dwLocalAccessCodeOffset AS DWORD ' // TAPI v1.4
 dwLongDistanceAccessCodeSize AS DWORD ' // TAPI v1.4
 dwLongDistanceAccessCodeOffset AS DWORD ' // TAPI v1.4
 dwTollPrefixListSize AS DWORD ' // TAPI v1.4
 dwTollPrefixListOffset AS DWORD ' // TAPI v1.4
 dwCountryID AS DWORD ' // TAPI v1.4
 dwOptions AS DWORD ' // TAPI v1.4
 dwCancelCallWaitingSize AS DWORD ' // TAPI v1.4
 dwCancelCallWaitingOffset AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The LINEMEDIACONTROLCALLSTATE structure describes a media action to be executed when
' detecting transitions into one or more call states. The lineSetMediaControl and
' TSPI_lineSetMediaControl functions use this structure.
' ========================================================================================
' // Size = 8 bytes
TYPE LINEMEDIACONTROLCALLSTATE DWORD
 dwCallStates AS DWORD
 dwMediaControl AS DWORD
END TYPE
' ========================================================================================
' The LINEMEDIACONTROLDIGIT structure describes a media action to be executed when
' detecting a digit. It is used as an entry in an array. The lineSetMediaControl and
' TSPI_lineSetMediaControl functions use this structure.
' ========================================================================================
' // Size = 12 bytes
TYPE LINEMEDIACONTROLDIGIT DWORD
 dwDigit AS DWORD
 dwDigitModes AS DWORD
 dwMediaControl AS DWORD
END TYPE
' ========================================================================================
' The LINEMEDIACONTROLMEDIA structure describes a media action to be executed when
' detecting a media type change. It is used as an entry in an array. The lineSetMediaControl
' and TSPI_lineSetMediaControl functions use this structure.
' ========================================================================================
' // Size = 12 bytes
TYPE LINEMEDIACONTROLMEDIA DWORD
 dwMediaModes AS DWORD
 dwDuration AS DWORD
 dwMediaControl AS DWORD
END TYPE
' ========================================================================================
' The LINEMEDIACONTROLTONE structure describes a media action to be executed when a tone
' has been detected. It is used as an entry in an array. The lineSetMediaControl and
' TSPI_lineSetMediaControl functions use this structure.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEMEDIACONTROLTONE DWORD
 dwAppSpecific AS DWORD
 dwDuration AS DWORD
 dwFrequency1 AS DWORD
 dwFrequency2 AS DWORD
 dwFrequency3 AS DWORD
 dwMediaControl AS DWORD
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The LINEMESSAGE structure contains parameter values specifying a change in status of the
' line the application currently has open. The lineGetMessage function returns the
' LINEMESSAGE structure.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEMESSAGE DWORD
 hDevice AS DWORD ' // TAPI v2.0
 dwMessageID AS DWORD ' // TAPI v2.0
 dwCallbackInstance AS DWORD ' DWORD_PTR ' // TAPI v2.0
 dwParam1 AS DWORD ' DWORD_PTR ' // TAPI v2.0
 dwParam2 AS DWORD ' DWORD_PTR ' // TAPI v2.0
 dwParam3 AS DWORD ' DWORD_PTR ' // TAPI v2.0
END TYPE
#ENDIF
' ========================================================================================
' The LINEMONITORTONE structure describes a tone to be monitored. This is used as an entry
' in an array. The lineMonitorTones and TSPI_lineMonitorTones functions use this structure.
' ========================================================================================
' // Size = 20 bytes
TYPE LINEMONITORTONE DWORD
 dwAppSpecific AS DWORD
 dwDuration AS DWORD
 dwFrequency1 AS DWORD
 dwFrequency2 AS DWORD
 dwFrequency3 AS DWORD
END TYPE
' ========================================================================================
' The LINEPROVIDERENTRY structure provides the information for a single service provider
' entry. An array of these structures is returned as part of the LINEPROVIDERLIST
' structure returned by the function lineGetProviderList.
' ========================================================================================
' // Size = 12 bytes
TYPE LINEPROVIDERENTRY DWORD
 dwPermanentProviderID AS DWORD ' // TAPI v1.4
 dwProviderFilenameSize AS DWORD ' // TAPI v1.4
 dwProviderFilenameOffset AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The LINEPROVIDERLIST structure describes a list of service providers. A structure of
' this type is returned by the lineGetProviderList function. The LINEPROVIDERLIST
' structure can contain an array of LINEPROVIDERENTRY structures.
' ========================================================================================
' // Size = 24 bytes
TYPE LINEPROVIDERLIST DWORD
 dwTotalSize AS DWORD ' // TAPI v1.4
 dwNeededSize AS DWORD ' // TAPI v1.4
 dwUsedSize AS DWORD ' // TAPI v1.4
 dwNumProviders AS DWORD ' // TAPI v1.4
 dwProviderListSize AS DWORD ' // TAPI v1.4
 dwProviderListOffset AS DWORD ' // TAPI v1.4
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' // Size = 28 bytes
TYPE SetAgentGroup DWORD
 dwAddressID AS DWORD
 GroupList AS LINEAGENTGROUPLIST
END TYPE
' // Size = 12 bytes
TYPE SetAgentState DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 dwAgentState AS DWORD ' // TAPI v2.0
 dwNextAgentState AS DWORD ' // TAPI v2.0
END TYPE
' // Size = 8 bytes
TYPE SetAgentActivity DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 dwActivityID AS DWORD ' // TAPI v2.0
END TYPE
' // Size = 76 bytes
TYPE GetAgentCaps DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 AgentCaps AS LINEAGENTCAPS ' // TAPI v2.0
END TYPE
' // Size = 60 bytes
TYPE GetAgentStatus DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 AgentStatus AS LINEAGENTSTATUS ' // TAPI v2.0
END TYPE
' // Size = 16 bytes
TYPE AgentSpecific DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 dwAgentExtensionIDIndex AS DWORD ' // TAPI v2.0
 dwSize AS DWORD ' // TAPI v2.0
 Params AS BYTE ' // TAPI v2.0
END TYPE
' // Size = 28 bytes
TYPE GetAgentActivityList DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 ActivityList AS LINEAGENTACTIVITYLIST ' // TAPI v2.0
END TYPE
' // Size = 28 bytes
TYPE GetAgentGroupList DWORD
 dwAddressID AS DWORD ' // TAPI v2.0
 GroupList AS LINEAGENTGROUPLIST ' // TAPI v2.0
END TYPE
' // Size = 20 bytes
TYPE CreateAgent DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 dwAgentIDSize AS DWORD ' // TAPI v2.2
 dwAgentIDOffset AS DWORD ' // TAPI v2.2
 dwAgentPINSize AS DWORD ' // TAPI v2.2
 dwAgentPINOffset AS DWORD
END TYPE
' // Size = 12 bytes
TYPE SetAgentStateEx DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 dwAgentState AS DWORD ' // TAPI v2.2
 dwNextAgentState AS DWORD ' // TAPI v2.2
END TYPE
' // Size = 8 bytes
TYPE SetAgentMeasurementPeriod DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 dwMeasurementPeriod AS DWORD ' // TAPI v2.2
END TYPE
' // Size = 60 bytes
TYPE GetAgentInfo DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 AgentInfo AS LINEAGENTINFO ' // TAPI v2.2
END TYPE
' // Size = 36 bytes
TYPE CreateAgentSession DWORD
 hAgentSession AS DWORD ' HAGENTSESSION ' // TAPI v2.2
 dwAgentPINSize AS DWORD
 dwAgentPINOffset AS DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 GroupID AS GUID ' // TAPI v2.2
 dwWorkingAddressID AS DWORD ' // TAPI v2.2
END TYPE
' // Size = 28 bytes
TYPE GetAgentSessionList DWORD
 hAgent AS DWORD ' HAGENT ' // TAPI v2.2
 SessionList AS LINEAGENTSESSIONLIST ' // TAPI v2.2
END TYPE
' // Size = 28 bytes
TYPE GetAgentSessionInfo DWORD
 hAgentSession AS DWORD ' HAGENTSESSION ' // TAPI v2.2
 SessionInfo AS LINEAGENTSESSIONINFO ' // TAPI v2.2
END TYPE
' // Size = 12 bytes
TYPE SetAgentSessionState DWORD
 hAgentSession AS DWORD ' HAGENTSESSION ' // TAPI v2.2
 dwAgentSessionState AS DWORD ' // TAPI v2.2
 dwNextAgentSessionState AS DWORD ' // TAPI v2.2
END TYPE
' // Size = 40 bytes
TYPE GetQueueList DWORD
 GroupID AS GUID ' // TAPI v2.2
 QueueList AS LINEQUEUELIST ' LINEQUEUELIST ' // TAPI v2.2
END TYPE
' // Size = 8 bytes
TYPE SetQueueMeasurementPeriod DWORD
 dwQueueID AS DWORD ' // TAPI v2.2
 dwMeasurementPeriod AS DWORD ' // TAPI v2.2
END TYPE
' // Size = 56 bytes
TYPE GetQueueInfo DWORD
 dwQueueID AS DWORD ' // TAPI v2.2
 QueueInfo AS LINEQUEUEINFO ' // TAPI v2.2
END TYPE
' // Size = 24 bytes
TYPE GetGroupList DWORD
 GroupList AS LINEAGENTGROUPLIST ' // TAPI v2.2
END TYPE
' // Size = 80 bytes
UNION ProxyRequestType DWORD
 SetAgentGroup AS SetAgentGroup
 SetAgentState AS SetAgentState
 SetAgentActivity AS SetAgentActivity
 GetAgentCaps AS GetAgentCaps
 GetAgentStatus AS GetAgentStatus
 AgentSpecific AS AgentSpecific
 GetAgentActivityList AS GetAgentActivityList
 GetAgentGroupList AS GetAgentGroupList
#IF %TAPI_CURRENT_VERSION >= &H00020002
 CreateAgent AS CreateAgent
 SetAgentStateEx AS SetAgentStateEx
 SetAgentMeasurementPeriod AS SetAgentMeasurementPeriod
 GetAgentInfo AS GetAgentInfo
 CreateAgentSession AS CreateAgentSession
 GetAgentSessionList AS GetAgentSessionList
 GetAgentSessionInfo AS GetAgentSessionInfo
 SetAgentSessionState AS SetAgentSessionState
 GetQueueList AS GetQueueList
 SetQueueMeasurementPeriod AS SetQueueMeasurementPeriod
 GetQueueInfo AS GetQueueInfo
 GetGroupList AS GetGroupList
#ENDIF
END UNION
' ========================================================================================
' The LINEPROXYREQUEST structure contains parameter values of the application making the
' proxy request. Multiple TAPI call center functions generate a LINE_PROXYREQUEST message
' that references a LINEPROXYREQUEST structure.
' ========================================================================================
' // Size = 108 bytes
TYPE LINEPROXYREQUEST DWORD
 dwSize AS DWORD ' // TAPI v2.0
 dwClientMachineNameSize AS DWORD ' // TAPI v2.0
 dwClientMachineNameOffset AS DWORD ' // TAPI v2.0
 dwClientUserNameSize AS DWORD ' // TAPI v2.0
 dwClientUserNameOffset AS DWORD ' // TAPI v2.0
 dwClientAppAPIVersion AS DWORD ' // TAPI v2.0
 dwRequestType AS DWORD ' // TAPI v2.0
 ProxyRequestType
END TYPE
#ENDIF
' ========================================================================================
' The LINEREQMAKECALL structure describes a request initiated by a call to the
' lineGetRequest function.
' ========================================================================================
' // Size = 240 bytes
TYPE LINEREQMAKECALL DWORD
 szDestAddress AS ASCIIZ * %TAPIMAXDESTADDRESSSIZE ' char
 szAppName AS ASCIIZ * %TAPIMAXAPPNAMESIZE ' char
 szCalledParty AS ASCIIZ * %TAPIMAXCALLEDPARTYSIZE ' char
 szComment AS ASCIIZ * %TAPIMAXCOMMENTSIZE ' char
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' // Size = 480 bytes
TYPE LINEREQMAKECALLW DWORD
 szDestAddress AS WSTRINGZ * %TAPIMAXDESTADDRESSSIZE ' WCHAR
 szAppName AS WSTRINGZ * %TAPIMAXAPPNAMESIZE ' WCHAR
 szCalledParty AS WSTRINGZ * %TAPIMAXCALLEDPARTYSIZE ' WCHAR
 szComment AS WSTRINGZ * %TAPIMAXCOMMENTSIZE ' WCHAR
END TYPE
#ENDIF
' ========================================================================================
' The LINEREQMEDIACALL structure describes a request initiated by a call to the
' lineGetRequest function. This data structure is obsolete and should not be used.
' ========================================================================================
'TYPE LINEREQMEDIACALL
' hWnd AS DWORD
' wRequestID AS DWORD ' WPARAM
' szDeviceClass AS ASCIIZ * %TAPIMAXDEVICECLASSSIZE ' char
' ucDeviceID AS ASCIIZ * %TAPIMAXDEVICECLASSSIZE ' unsigned char
' dwSize AS DWORD
' dwSecure AS DWORD
' szDestAddress AS ASCIIZ * %TAPIMAXDESTADDRESSSIZE ' char
' szAppName AS ASCIIZ * %TAPIMAXAPPNAMESIZE ' char
' szCalledParty AS ASCIIZ * %TAPIMAXCALLEDPARTYSIZE ' char
' szComment AS ASCIIZ * %TAPIMAXCOMMENTSIZE ' char
'END TYPE
'#IF %TAPI_CURRENT_VERSION >= &H00020000
'TYPE LINEREQMEDIACALLW
' hWnd AS DWORD
' wRequestID AS DWORD ' WPARAM
' szDeviceClass AS WSTRINGZ * %TAPIMAXDEVICECLASSSIZE ' WCHAR
' ucDeviceID AS WSTRINGZ * %TAPIMAXDEVICECLASSSIZE ' unsigned char
' dwSize AS DWORD
' dwSecure AS DWORD
' szDestAddress AS WSTRINGZ * %TAPIMAXDESTADDRESSSIZE ' WCHAR
' szAppName AS WSTRINGZ * %TAPIMAXAPPNAMESIZE ' WCHAR
' szCalledParty AS WSTRINGZ * %TAPIMAXCALLEDPARTYSIZE ' WCHAR
' szComment AS WSTRINGZ * %TAPIMAXCOMMENTSIZE ' WCHAR
'END TYPE
'#ENDIF
' ========================================================================================
' The LINETERMCAPS structure describes the capabilities of a line's terminal device. The
' LINEDEVCAPS structure can contain an array of LINETERMCAPS structures.
' ========================================================================================
' // Size = 12 bytes
TYPE LINETERMCAPS DWORD
 dwTermDev AS DWORD
 dwTermModes AS DWORD
 dwTermSharing AS DWORD
END TYPE
' ========================================================================================
' The LINETRANSLATECAPS structure describes the address translation capabilities. This
' structure can contain an array of LINELOCATIONENTRY structures and an array of
' LINECARDENTRY structures. The LINETRANSLATECAPS structure is returned by the
' lineGetTranslateCaps function.
' ========================================================================================
' // Size = 44 bytes
TYPE LINETRANSLATECAPS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwNumLocations AS DWORD
 dwLocationListSize AS DWORD
 dwLocationListOffset AS DWORD
 dwCurrentLocationID AS DWORD
 dwNumCards AS DWORD
 dwCardListSize AS DWORD
 dwCardListOffset AS DWORD
 dwCurrentPreferredCardID AS DWORD
END TYPE
' ========================================================================================
' The LINETRANSLATEOUTPUT structure describes the result of an address translation. The
' lineTranslateAddress function uses this structure.
' ========================================================================================
' // Size = 40 bytes
TYPE LINETRANSLATEOUTPUT DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwDialableStringSize AS DWORD
 dwDialableStringOffset AS DWORD
 dwDisplayableStringSize AS DWORD
 dwDisplayableStringOffset AS DWORD
 dwCurrentCountry AS DWORD
 dwDestCountry AS DWORD
 dwTranslateResults AS DWORD
END TYPE
' ========================================================================================
' The PHONEBUTTONINFO structure contains information about a button on a phone device.
' This structure is used by multiple TAPI and TSPI functions.
' ========================================================================================
' // Size = 40 bytes
TYPE PHONEBUTTONINFO DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwButtonMode AS DWORD
 dwButtonFunction AS DWORD
 dwButtonTextSize AS DWORD
 dwButtonTextOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
 dwButtonState AS DWORD ' // TAPI v1.4
END TYPE
' ========================================================================================
' The PHONECAPS structure describes the capabilities of a phone device. The phoneGetDevCaps
' and TSPI_phoneGetDevCaps functions return this structure.
' ========================================================================================
' // Size = 196 bytes
TYPE PHONECAPS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwProviderInfoSize AS DWORD
 dwProviderInfoOffset AS DWORD
 dwPhoneInfoSize AS DWORD
 dwPhoneInfoOffset AS DWORD
 dwPermanentPhoneID AS DWORD
 dwPhoneNameSize AS DWORD
 dwPhoneNameOffset AS DWORD
 dwStringFormat AS DWORD
 dwPhoneStates AS DWORD
 dwHookSwitchDevs AS DWORD
 dwHandsetHookSwitchModes AS DWORD
 dwSpeakerHookSwitchModes AS DWORD
 dwHeadsetHookSwitchModes AS DWORD
 dwVolumeFlags AS DWORD
 dwGainFlags AS DWORD
 dwDisplayNumRows AS DWORD
 dwDisplayNumColumns AS DWORD
 dwNumRingModes AS DWORD
 dwNumButtonLamps AS DWORD
 dwButtonModesSize AS DWORD
 dwButtonModesOffset AS DWORD
 dwButtonFunctionsSize AS DWORD
 dwButtonFunctionsOffset AS DWORD
 dwLampModesSize AS DWORD
 dwLampModesOffset AS DWORD
 dwNumSetData AS DWORD
 dwSetDataSize AS DWORD
 dwSetDataOffset AS DWORD
 dwNumGetData AS DWORD
 dwGetDataSize AS DWORD
 dwGetDataOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwDeviceClassesSize AS DWORD ' // TAPI v2.0
 dwDeviceClassesOffset AS DWORD ' // TAPI v2.0
 dwPhoneFeatures AS DWORD ' // TAPI v2.0
 dwSettableHandsetHookSwitchModes AS DWORD ' // TAPI v2.0
 dwSettableSpeakerHookSwitchModes AS DWORD ' // TAPI v2.0
 dwSettableHeadsetHookSwitchModes AS DWORD ' // TAPI v2.0
 dwMonitoredHandsetHookSwitchModes AS DWORD ' // TAPI v2.0
 dwMonitoredSpeakerHookSwitchModes AS DWORD ' // TAPI v2.0
 dwMonitoredHeadsetHookSwitchModes AS DWORD ' // TAPI v2.0
#ENDIF
#IF %TAPI_CURRENT_VERSION >= &H00020002
 PermanentPhoneGuid AS GUID ' // TAPI v2.2
#ENDIF
END TYPE
' ========================================================================================
' The PHONEEXTENSIONID structure describes an extension identifier. Extension identifiers
' are used to identify service provider-specific extensions for phone device classes. The
' phoneNegotiateAPIVersion and TSPI_phoneGetExtensionID functions return this structure.
' ========================================================================================
' // Size = 16 bytes
TYPE PHONEEXTENSIONID DWORD
 dwExtensionID0 AS DWORD
 dwExtensionID1 AS DWORD
 dwExtensionID2 AS DWORD
 dwExtensionID3 AS DWORD
END TYPE
#IF %TAPI_CURRENT_VERSION >= &H00020000
' // Size = 4 bytes
UNION PHONEINITIALIZEEXPARAMS_HANDLES_UNION DWORD
 hEvent AS DWORD ' HANDLE ' // TAPI v2.0
 hCompletionPort AS DWORD ' HANDLE ' // TAPI v2.0
END UNION
' ========================================================================================
' The PHONEINITIALIZEEXPARAMS structure contains parameters used to establish the
' association between an application and TAPI; for example, the application's selected
' event notification mechanism. The phoneInitializeEx function uses this structure.
' ========================================================================================
' // Size = 24 bytes
TYPE PHONEINITIALIZEEXPARAMS DWORD
 dwTotalSize AS DWORD ' // TAPI v2.0
 dwNeededSize AS DWORD ' // TAPI v2.0
 dwUsedSize AS DWORD ' // TAPI v2.0
 dwOptions AS DWORD ' // TAPI v2.0
 PHONEINITIALIZEEXPARAMS_HANDLES_UNION
 dwCompletionKey AS DWORD ' // TAPI v2.0
END TYPE
' ========================================================================================
' The PHONEMESSAGE structure contains the next message queued for delivery to the
' application. The phoneGetMessage function returns this structure.
' ========================================================================================
' // Size = 24 bytes
TYPE PHONEMESSAGE DWORD
 hDevice AS DWORD ' // TAPI v2.0
 dwMessageID AS DWORD ' // TAPI v2.0
 dwCallbackInstance AS DWORD ' DWORD_PTR // TAPI v2.0
 dwParam1 AS DWORD ' DWORD_PTR // TAPI v2.0
 dwParam2 AS DWORD ' DWORD_PTR // TAPI v2.0
 dwParam3 AS DWORD ' DWORD_PTR // TAPI v2.0
END TYPE
#ENDIF
' ========================================================================================
' The PHONESTATUS structure describes the current status of a phone device. The
' phoneGetStatus and TSPI_phoneGetStatus functions return this structure.
' ========================================================================================
' // Size = 104 bytes
TYPE PHONESTATUS DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwStatusFlags AS DWORD
 dwNumOwners AS DWORD
 dwNumMonitors AS DWORD
 dwRingMode AS DWORD
 dwRingVolume AS DWORD
 dwHandsetHookSwitchMode AS DWORD
 dwHandsetVolume AS DWORD
 dwHandsetGain AS DWORD
 dwSpeakerHookSwitchMode AS DWORD
 dwSpeakerVolume AS DWORD
 dwSpeakerGain AS DWORD
 dwHeadsetHookSwitchMode AS DWORD
 dwHeadsetVolume AS DWORD
 dwHeadsetGain AS DWORD
 dwDisplaySize AS DWORD
 dwDisplayOffset AS DWORD
 dwLampModesSize AS DWORD
 dwLampModesOffset AS DWORD
 dwOwnerNameSize AS DWORD
 dwOwnerNameOffset AS DWORD
 dwDevSpecificSize AS DWORD
 dwDevSpecificOffset AS DWORD
#IF %TAPI_CURRENT_VERSION >= &H00020000
 dwPhoneFeatures AS DWORD ' // TAPI v2.0
#ENDIF
END TYPE
' ========================================================================================
' The VARSTRING structure is used for returning variably sized strings. It is used both by
' the line device class and the phone device class.
' ========================================================================================
' // Size = 24 bytes
TYPE VARSTRING DWORD
 dwTotalSize AS DWORD
 dwNeededSize AS DWORD
 dwUsedSize AS DWORD
 dwStringFormat AS DWORD
 dwStringSize AS DWORD
 dwStringOffset AS DWORD
END TYPE
' ========================================================================================
' The lineAccept function accepts the specified offered call. It can optionally send the
' specified user-user information to the calling party.
' ========================================================================================
DECLARE FUNCTION LineAccept LIB "tapi32.dll" ALIAS "lineAccept" ( BYVAL hCall AS QUAD , BYREF lpsUserUserInfo AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The lineAddProvider function installs a new telephony service provider into the
' telephony system.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION LineAddProvider LIB "tapi32.dll" ALIAS "lineAddProviderA"( BYREF lpszProviderFilename AS ASCIIZ , BYVAL hwndOwner AS QUAD , BYREF lpdwPermanentProviderID AS QUAD ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION LineAddProviderW LIB "tapi32.dll" ALIAS "lineAddProviderW"( BYREF lpszProviderFilename AS WSTRINGZ , BYVAL hwndOwner AS QUAD , BYREF lpdwPermanentProviderID AS QUAD ) AS LONG
' ========================================================================================
' The lineAddToConference function adds the call specified by hConsultCall to the
' conference call specified by hConfCall.
' ========================================================================================
DECLARE FUNCTION LineAddToConference LIB "tapi32.dll" ALIAS "lineAddToConference" ( BYVAL hConfCall AS QUAD , BYVAL hConsultCall AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineAgentSpecific function allows the application to access proprietary
' handler-specific functions of the agent handler associated with the address. The meaning
' of the extensions are specific to the agent handler. Each set of agent-related extensions
' is identified by a universally unique 128-bit extension ID that must be obtained, along
' with the specification for the extension, from the promulgator of that extension (usually
' the author of the agent handler software on the telephony server). The list of extensions
' supported by the agent handler is obtained from the LINEAGENTCAPS structure returned by
' lineGetAgentCaps.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION LineAgentSpecific LIB "tapi32.dll" ALIAS "lineAgentSpecific" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwAgentExtensionIDIndex AS QUAD , BYREF lpParams AS ANY , BYVAL dwSize AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineAnswer function answers the specified offering call.
' ========================================================================================
DECLARE FUNCTION lineAnswer LIB "tapi32.dll" ALIAS "lineAnswer" ( BYVAL hCall AS QUAD , BYREF lpsUserUserInfo AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The lineBlindTransfer function performs a blind or single-step transfer of the specified
' call to the specified destination address.
' ========================================================================================
DECLARE FUNCTION lineBlindTransfer LIB "tapi32.dll" ALIAS "lineBlindTransferA" ( BYVAL hCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ , BYVAL dwCountryCode AS QUAD ) AS LONG
DECLARE FUNCTION lineBlindTransferW LIB "tapi32.dll" ALIAS "lineBlindTransferW" ( BYVAL hCall AS QUAD
 , BYREF lpszDestAddress AS WSTRINGZ
 , BYVAL dwCountryCode AS DWORD
 ) AS LONG
' ========================================================================================
' The lineClose function closes the specified open line device.
' ========================================================================================
DECLARE FUNCTION lineClose LIB "tapi32.dll" ALIAS "lineClose" ( BYVAL hLine AS QUAD ) AS LONG
' ========================================================================================
' The lineCompleteCall function specifies how a call that could not be connected normally
' should be completed instead. The network or switch may not be able to complete a call
' because network resources are busy or the remote station is busy or doesn't answer. The
' application can request that the call be completed in one of a number of ways.
' ========================================================================================
DECLARE FUNCTION lineCompleteCall LIB "tapi32.dll" ALIAS "lineCompleteCall" ( BYVAL hCall AS QUAD , BYREF lpdwCompletionID AS QUAD , BYVAL dwCompletionMode AS QUAD , BYVAL dwMessageID AS QUAD ) AS LONG
' ========================================================================================
' The lineCompleteTransfer function completes the transfer of the specified call to the
' party connected in the consultation call.
' ========================================================================================
DECLARE FUNCTION lineCompleteTransfer LIB "tapi32.dll" ALIAS "lineCompleteTransfer" ( BYVAL hCall AS QUAD , BYVAL hConsultCall AS QUAD , BYREF lphConfCall AS QUAD , BYVAL dwTransferMode AS QUAD ) AS LONG
' ========================================================================================
' The lineConfigDialog function causes the provider of the specified line device to
' display a dialog box (attached to hwndOwner of the application) to allow the user to
' configure parameters related to the line device.
' ========================================================================================
DECLARE FUNCTION lineConfigDialog LIB "tapi32.dll" ALIAS "lineConfigDialogA" ( BYVAL dwDeviceID AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION lineConfigDialogW LIB "tapi32.dll" ALIAS "lineConfigDialogW" ( BYVAL dwDeviceID AS QUAD
 , BYVAL hwndOwner AS DWORD
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The lineConfigDialogEdit function causes the provider of the specified line device to
' display a dialog box (attached to hwndOwner of the application) to allow the user to
' configure parameters related to the line device.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineConfigDialogEdit LIB "tapi32.dll" ALIAS "lineConfigDialogEditA" ( BYVAL dwDeviceID AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszDeviceClass AS ASCIIZ , BYVAL lpDeviceConfigIn AS QUAD , BYVAL dwSize AS QUAD , BYREF lpDeviceConfigOut AS VARSTRING ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineConfigDialogEditW LIB "tapi32.dll" ALIAS "lineConfigDialogEditW" ( BYVAL dwDeviceID AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszDeviceClass AS WSTRINGZ , BYVAL lpDeviceConfigIn AS QUAD , BYVAL dwSize AS QUAD , BYREF lpDeviceConfigOut AS VARSTRING ) AS LONG
' ========================================================================================
' The lineConfigProvider function causes a service provider to display its configuration
' dialog box.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineConfigProvider LIB "tapi32.dll" ALIAS "lineConfigProvider" ( BYVAL hwndOwner AS QUAD , BYVAL dwPermanentProviderID AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineCreateAgent function creates a new Agent object. It generates a
' LINE_PROXYREQUEST message to be sent to a registered proxy function handler, referencing
' a LINEPROXYREQUEST structure of type LINEPROXYREQUEST_CREATEAGENT.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineCreateAgent LIB "tapi32.dll" ALIAS "lineCreateAgentA" ( BYVAL hLine AS QUAD , BYREF lpszAgentID AS ASCIIZ , BYREF lpszAgentPIN AS ASCIIZ , BYREF lphAgent AS QUAD ) AS LONG
' // TAPI v2.2
DECLARE FUNCTION lineCreateAgentW LIB "tapi32.dll" ALIAS "lineCreateAgentW" ( BYVAL hLine AS QUAD , BYREF lpszAgentID AS WSTRINGZ , BYREF lpszAgentPIN AS WSTRINGZ , BYREF lphAgent AS QUAD ) AS LONG
' ========================================================================================
' The lineCreateAgentSession function creates a new AgentSession object. It generates a
' LINE_PROXYREQUEST message to be sent to a registered proxy function handler, referencing
' a LINEPROXYREQUEST structure of type LINEPROXYREQUEST_CREATEAGENTSESSION.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineCreateAgentSession LIB "tapi32.dll" ALIAS "lineCreateAgentSessionA" ( BYVAL hLine AS QUAD , BYVAL hAgent AS QUAD , BYREF lpszAgentPIN AS ASCIIZ , BYVAL dwWorkingAddressID AS QUAD , BYREF lpGroupID AS GUID , BYREF lphAgentSession AS QUAD ) AS LONG
' // TAPI v2.2
DECLARE FUNCTION lineCreateAgentSessionW LIB "tapi32.dll" ALIAS "lineCreateAgentSessionW" ( BYVAL hLine AS QUAD , BYVAL hAgent AS QUAD , BYREF lpszAgentPIN AS WSTRINGZ , BYVAL dwWorkingAddressID AS QUAD , BYREF lpGroupID AS GUID , BYREF lphAgentSession AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineDeallocateCall function deallocates the specified call handle.
' ========================================================================================
DECLARE FUNCTION lineDeallocateCall LIB "tapi32.dll" ALIAS "lineDeallocateCall" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineDevSpecific function enables service providers to provide access to features not
' offered by other TAPI functions. The meaning of the extensions are device specific, and
' taking advantage of these extensions requires the application to be fully aware of them.
' ========================================================================================
DECLARE FUNCTION lineDevSpecific LIB "tapi32.dll" ALIAS "lineDevSpecific"( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL hCall AS QUAD , BYREF lpParams AS ANY , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The lineDevSpecificFeature function enables service providers to provide access to
' features not offered by other TAPI functions. The meaning of these extensions are device
' specific, and taking advantage of these extensions requires the application to be fully
' aware of them.
' ========================================================================================
DECLARE FUNCTION lineDevSpecificFeature LIB "tapi32.dll" ALIAS "lineDevSpecificFeature" ( BYVAL hLine AS QUAD , BYVAL dwFeature AS QUAD , BYREF lpParams AS ANY , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The lineDial function dials the specified dialable number on the specified call.
' ========================================================================================
DECLARE FUNCTION lineDial LIB "tapi32.dll" ALIAS "lineDialA" ( BYVAL hCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ , BYVAL dwCountryCode AS QUAD ) AS LONG
DECLARE FUNCTION lineDialW LIB "tapi32.dll" ALIAS "lineDialW" ( BYVAL hCall AS QUAD
 , BYREF lpszDestAddress AS WSTRINGZ
 , BYVAL dwCountryCode AS DWORD
 ) AS LONG
' ========================================================================================
' The lineDrop function drops or disconnects the specified call. The application has the
' option to specify user-user information to be transmitted as part of the call disconnect.
' ========================================================================================
DECLARE FUNCTION lineDrop LIB "tapi32.dll" ALIAS "lineDrop" ( BYVAL hCall AS QUAD , BYREF lpsUserUserInfo AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The lineForward function forwards calls destined for the specified address on the
' specified line, according to the specified forwarding instructions. When an originating
' address (dwAddressID) is forwarded, the specified incoming calls for that address are
' deflected to the other number by the switch. This function provides a combination of
' forward and do-not-disturb features. This function can also cancel forwarding currently
' in effect.
' ========================================================================================
DECLARE FUNCTION lineForward LIB "tapi32.dll" ALIAS "lineForwardA"( BYVAL hLine AS QUAD , BYVAL bAllAddresses AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpForwardList AS LINEFORWARDLIST , BYVAL dwNumRingsNoAnswer AS QUAD , BYREF lphConsultCall AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION lineForwardW LIB "tapi32.dll" ALIAS "lineForwardW"( BYVAL hLine AS QUAD
 , BYVAL bAllAddresses AS DWORD
 , BYVAL dwAddressID AS DWORD
 , BYREF lpForwardList AS LINEFORWARDLIST
 , BYVAL dwNumRingsNoAnswer AS DWORD
 , BYREF lphConsultCall AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
' ========================================================================================
' The lineGatherDigits function initiates the buffered gathering of digits on the
' specified call. The application specifies a buffer in which to place the digits and the
' maximum number of digits to be collected.
' ========================================================================================
DECLARE FUNCTION lineGatherDigits LIB "tapi32.dll" ALIAS "lineGatherDigitsA" ( BYVAL hCall AS QUAD , BYVAL dwDigitModes AS QUAD , BYREF lpsDigits AS ASCIIZ , BYVAL dwNumDigits AS QUAD , BYREF lpszTerminationDigits AS ASCIIZ , BYVAL dwFirstDigitTimeout AS QUAD , BYVAL dwInterDigitTimeout AS QUAD ) AS LONG
DECLARE FUNCTION lineGatherDigitsW LIB "tapi32.dll" ALIAS "lineGatherDigitsW" ( BYVAL hCall AS QUAD
 , BYVAL dwDigitModes AS DWORD
 , BYREF lpsDigits AS WSTRINGZ
 , BYVAL dwNumDigits AS DWORD
 , BYREF lpszTerminationDigits AS WSTRINGZ
 , BYVAL dwFirstDigitTimeout AS DWORD
 , BYVAL dwInterDigitTimeout AS DWORD
 ) AS LONG
' ========================================================================================
' The lineGenerateDigits function initiates the generation of the specified digits on the
' specified call as inband tones using the specified signaling mode. Calling this function
' with a NULL value for lpszDigits aborts any digit generation currently in progress.
' Invoking lineGenerateDigits or lineGenerateTone while digit generation is in progress
' aborts the current digit generation or tone generation and initiates the generation of
' the most recently specified digits or tone.
' ========================================================================================
DECLARE FUNCTION lineGenerateDigits LIB "tapi32.dll" ALIAS "lineGenerateDigitsA" ( BYVAL hCall AS QUAD , BYVAL dwDigitMode AS QUAD , BYREF lpszDigits AS ASCIIZ , BYVAL dwDuration AS QUAD ) AS LONG
DECLARE FUNCTION lineGenerateDigitsW LIB "tapi32.dll" ALIAS "lineGenerateDigitsW" ( BYVAL hCall AS QUAD
 , BYVAL dwDigitMode AS DWORD
 , BYREF lpszDigits AS WSTRINGZ
 , BYVAL dwDuration AS DWORD
 ) AS LONG
' ========================================================================================
' The lineGenerateTone function generates the specified inband tone over the specified
' call. Invoking this function with a zero for dwToneMode aborts the tone generation
' currently in progress on the specified call. Invoking lineGenerateTone or
' lineGenerateDigits while tone generation is in progress aborts the current tone
' generation or digit generation and initiates the generation of the newly specified tone
' or digits.
' ========================================================================================
DECLARE FUNCTION lineGenerateTone LIB "tapi32.dll" ALIAS "lineGenerateTone" ( BYVAL hCall AS QUAD , BYVAL dwToneMode AS QUAD , BYVAL dwDuration AS QUAD , BYVAL dwNumTones AS QUAD , BYREF lpTones AS tagLINEGENERATETONE ) AS LONG
' ========================================================================================
' The lineGetAddressCaps function queries the specified address on the specified line
' device to determine its telephony capabilities.
' ========================================================================================
DECLARE FUNCTION lineGetAddressCaps LIB "tapi32.dll" ALIAS "lineGetAddressCapsA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYREF lpAddressCaps AS LINEADDRESSCAPS ) AS LONG
DECLARE FUNCTION lineGetAddressCapsW LIB "tapi32.dll" ALIAS "lineGetAddressCapsW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwDeviceID AS DWORD
 , BYVAL dwAddressID AS DWORD
 , BYVAL dwAPIVersion AS DWORD
 , BYVAL dwExtVersion AS DWORD
 , BYREF lpAddressCaps AS LINEADDRESSCAPS
 ) AS LONG
' ========================================================================================
' The lineGetAddressID function returns the address identifier associated with an address
' in a different format on the specified line.
' ========================================================================================
DECLARE FUNCTION lineGetAddressID LIB "tapi32.dll" ALIAS "lineGetAddressIDA" ( BYVAL hLine AS QUAD , BYREF lpdwAddressID AS QUAD , BYVAL dwAddressMode AS QUAD , BYREF lpsAddress AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
DECLARE FUNCTION lineGetAddressIDW LIB "tapi32.dll" ALIAS "lineGetAddressIDW" ( BYVAL hLine AS QUAD
 , BYREF lpdwAddressID AS DWORD
 , BYVAL dwAddressMode AS DWORD
 , BYREF lpsAddress AS WSTRINGZ
 , BYVAL dwSize AS DWORD
 ) AS LONG
' ========================================================================================
' The lineGetAddressStatus function allows an application to query the specified address
' for its current status.
' ========================================================================================
DECLARE FUNCTION lineGetAddressStatus LIB "tapi32.dll" ALIAS "lineGetAddressStatusA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAddressStatus AS LINEADDRESSSTATUS ) AS LONG
DECLARE FUNCTION lineGetAddressStatusW LIB "tapi32.dll" ALIAS "lineGetAddressStatusW" ( BYVAL hLine AS QUAD
 , BYVAL dwAddressID AS DWORD
 , BYREF lpAddressStatus AS LINEADDRESSSTATUS
 ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineGetAgentActivityList function obtains the identities of activities that the
' application can select using lineSetAgentActivity to indicate what function the agent is
' actually performing at the moment.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentActivityList LIB "tapi32.dll" ALIAS "lineGetAgentActivityListA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentActivityList AS LINEAGENTACTIVITYLIST ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentActivityListW LIB "tapi32.dll" ALIAS "lineGetAgentActivityListW" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentActivityList AS LINEAGENTACTIVITYLIST ) AS LONG
' ========================================================================================
' The lineGetAgentCaps function obtains the agent-related capabilities supported on the
' specified line device. If a specific agent is named, the capabilities include a listing
' of ACD groups into which the agent is permitted to log in.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentCaps LIB "tapi32.dll" ALIAS "lineGetAgentCapsA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwAppAPIVersion AS QUAD , BYREF lpAgentCaps AS LINEAGENTCAPS ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentCapsW LIB "tapi32.dll" ALIAS "lineGetAgentCapsW" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwAppAPIVersion AS QUAD , BYREF lpAgentCaps AS LINEAGENTCAPS ) AS LONG
' ========================================================================================
' The lineGetAgentGroupList function obtains the identities of agent groups (combination
' of queue, supervisor, skill level, and so on) into which the agent currently logged in
' on the workstation is permitted to log into on the automatic call distributor.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentGroupList LIB "tapi32.dll" ALIAS "lineGetAgentGroupListA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentGroupList AS LINEAGENTGROUPLIST ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentGroupListW LIB "tapi32.dll" ALIAS "lineGetAgentGroupListW" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentGroupList AS LINEAGENTGROUPLIST ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineGetAgentInfo function returns a structure holding the ACD information associated
' with a particular agent handle. It generates a LINE_PROXYREQUEST message to be sent to a
' registered proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_GETAGENTINFO.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetAgentInfo LIB "tapi32.dll" ALIAS "lineGetAgentInfo" ( BYVAL hLine AS QUAD , BYVAL hAgent AS QUAD , BYREF lpAgentInfo AS LINEAGENTINFO ) AS LONG
' ========================================================================================
' The lineGetAgentSessionInfo function returns a structure that holds the ACD information
' associated with a particular agent session handle. It generates a LINE_PROXYREQUEST
' message to be sent to a registered proxy function handler, referencing a LINEPROXYREQUEST
' structure of type LINEPROXYREQUEST_GETAGENTSESSIONINFO.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetAgentSessionInfo LIB "tapi32.dll" ALIAS "lineGetAgentSessionInfo" ( BYVAL hLine AS QUAD , BYVAL hAgentSession AS QUAD , BYREF lpAgentSessionInfo AS LINEAGENTSESSIONINFO ) AS LONG
' ========================================================================================
' The lineGetAgentSessionList function returns a list of agent sessions created for the
' specified agent. It generates a LINE_PROXYREQUEST message to be sent to a registered
' proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_GETAGENTSESSIONLIST.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetAgentSessionList LIB "tapi32.dll" ALIAS "lineGetAgentSessionList" ( BYVAL hLine AS QUAD , BYVAL hAgent AS QUAD , BYREF lpAgentSessionList AS LINEAGENTSESSIONLIST ) AS LONG
#ENDIF
' ========================================================================================
' The lineGetAgentStatus function obtains the agent-related status on the specified address.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentStatus LIB "tapi32.dll" ALIAS "lineGetAgentStatusA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentStatus AS LINEAGENTSTATUS ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION lineGetAgentStatusW LIB "tapi32.dll" ALIAS "lineGetAgentStatusW" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentStatus AS LINEAGENTSTATUS ) AS LONG
#ENDIF
' ========================================================================================
' The lineGetAppPriority function enables an application to determine whether or not it is
' in the handoff priority list for a particular media mode or Assisted Telephony request
' mode and, if so, its position in the priority list.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineGetAppPriority LIB "tapi32.dll" ALIAS "lineGetAppPriorityA" ( BYREF lpszAppFilename AS ASCIIZ , BYVAL dwMediaMode AS QUAD , BYREF lpExtensionID AS LINEEXTENSIONID , BYVAL dwRequestMode AS QUAD , BYREF lpExtensionName AS VARSTRING , BYREF lpdwPriority AS QUAD ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineGetAppPriorityW LIB "tapi32.dll" ALIAS "lineGetAppPriorityW" ( BYREF lpszAppFilename AS WSTRINGZ , BYVAL dwMediaMode AS QUAD , BYREF lpExtensionID AS LINEEXTENSIONID , BYVAL dwRequestMode AS QUAD , BYREF lpExtensionName AS VARSTRING , BYREF lpdwPriority AS QUAD ) AS LONG
' ========================================================================================
' The lineGetCallInfo function enables an application to obtain fixed information about
' the specified call.
' ========================================================================================
DECLARE FUNCTION lineGetCallInfo LIB "tapi32.dll" ALIAS "lineGetCallInfoA" ( BYVAL hCall AS QUAD , BYREF lpCallInfo AS LINECALLINFO ) AS LONG
DECLARE FUNCTION lineGetCallInfoW LIB "tapi32.dll" ALIAS "lineGetCallInfoW" ( BYVAL hCall AS QUAD
 , BYREF lpCallInfo AS LINECALLINFO
 ) AS LONG
' ========================================================================================
' The lineGetCallStatus function returns the current status of the specified call.
' ========================================================================================
DECLARE FUNCTION lineGetCallStatus LIB "tapi32.dll" ALIAS "lineGetCallStatus" ( BYVAL hCall AS QUAD , BYREF lpCallStatus AS LINECALLSTATUS ) AS LONG
' ========================================================================================
' The lineGetConfRelatedCalls function returns a list of call handles that are part of the
' same conference call as the specified call. The specified call is either a conference
' call or a participant call in a conference call. New handles are generated for those
' calls for which the application does not already have handles, and the application is
' granted monitor privilege to those calls.
' ========================================================================================
DECLARE FUNCTION lineGetConfRelatedCalls LIB "tapi32.dll" ALIAS "lineGetConfRelatedCalls" ( BYVAL hCall AS QUAD , BYREF lpCallList AS LINECALLLIST ) AS LONG
' ========================================================================================
' The lineGetCountry function fetches the stored dialing rules and other information
' related to a specified country/region, the first country/region in the country/region
' list, or all countries/regions.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineGetCountry LIB "tapi32.dll" ALIAS "lineGetCountryA" ( BYVAL dwCountryID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYREF lpLineCountryList AS LINECOUNTRYLIST ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineGetCountryW LIB "tapi32.dll" ALIAS "lineGetCountryW" ( BYVAL dwCountryID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYREF lpLineCountryList AS LINECOUNTRYLIST ) AS LONG
' ========================================================================================
' The lineGetDevCaps function queries a specified line device to determine its telephony
' capabilities. The returned information is valid for all addresses on the line device.
' ========================================================================================
DECLARE FUNCTION lineGetDevCaps LIB "tapi32.dll" ALIAS "lineGetDevCapsA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYREF lpLineDevCaps AS LINEDEVCAPS ) AS LONG
DECLARE FUNCTION lineGetDevCapsW LIB "tapi32.dll" ALIAS "lineGetDevCapsW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwDeviceID AS DWORD
 , BYVAL dwAPIVersion AS DWORD
 , BYVAL dwExtVersion AS DWORD
 , BYREF lpLineDevCaps AS LINEDEVCAPS
 ) AS LONG
' ========================================================================================
' The lineGetDevConfig function returns an "opaque" data structure object, the contents of
' which are specific to the line (service provider) and device class. The data structure
' object stores the current configuration of a media-stream device associated with the
' line device.
' ========================================================================================
DECLARE FUNCTION lineGetDevConfig LIB "tapi32.dll" ALIAS "lineGetDevConfigA" ( BYVAL dwDeviceID AS QUAD , BYREF lpDeviceConfig AS VARSTRING , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION lineGetDevConfigW LIB "tapi32.dll" ALIAS "lineGetDevConfigW" ( BYVAL dwDeviceID AS QUAD
 , BYREF lpDeviceConfig AS VARSTRING
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineGetGroupList function returns a list of ACD groups available on the ACD system.
' It generates a LINE_PROXYREQUEST message to be sent to a registered proxy function
' handler, referencing a LINEPROXYREQUEST structure of type LINEPROXYREQUEST_GETGROUPLIST.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetGroupList LIB "tapi32.dll" ALIAS "lineGetGroupListA" ( BYVAL hLine AS QUAD , BYREF lpGroupList AS LINEAGENTGROUPLIST ) AS LONG
' // TAPI v2.2
DECLARE FUNCTION lineGetGroupListW LIB "tapi32.dll" ALIAS "lineGetGroupListW" ( BYVAL hLine AS QUAD , BYREF lpGroupList AS LINEAGENTGROUPLIST ) AS LONG
#ENDIF
' ========================================================================================
' The lineGetIcon function allows an application to retrieve a service line device-specific
' (or provider-specific) icon for display to the user.
' ========================================================================================
DECLARE FUNCTION lineGetIcon LIB "tapi32.dll" ALIAS "lineGetIconA" ( BYVAL dwDeviceID AS QUAD , BYREF lpszDeviceClass AS ASCIIZ , BYREF lphIcon AS QUAD ) AS LONG
DECLARE FUNCTION lineGetIconW LIB "tapi32.dll" ALIAS "lineGetIconW" ( BYVAL dwDeviceID AS QUAD
 , BYREF lpszDeviceClass AS WSTRINGZ
 , BYREF lphIcon AS DWORD
 ) AS LONG
' ========================================================================================
' The lineGetID function returns a device identifier for the specified device class
' associated with the selected line, address, or call.
' ========================================================================================
DECLARE FUNCTION lineGetID LIB "tapi32.dll" ALIAS "lineGetIDA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL hCall AS QUAD , BYVAL dwSelect AS QUAD , BYREF lpDeviceID AS VARSTRING , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION lineGetIDW LIB "tapi32.dll" ALIAS "lineGetIDW" ( BYVAL hLine AS QUAD
 , BYVAL dwAddressID AS DWORD
 , BYVAL hCall AS DWORD
 , BYVAL dwSelect AS DWORD
 , BYREF lpDeviceID AS VARSTRING
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The lineGetLineDevStatus function enables an application to query the specified open
' line device for its current status.
' ========================================================================================
DECLARE FUNCTION lineGetLineDevStatus LIB "tapi32.dll" ALIAS "lineGetLineDevStatusA" ( BYVAL hLine AS QUAD , BYREF lpLineDevStatus AS LINEDEVSTATUS ) AS LONG
DECLARE FUNCTION lineGetLineDevStatusW LIB "tapi32.dll" ALIAS "lineGetLineDevStatusW" ( BYVAL hLine AS QUAD
 , BYREF lpLineDevStatus AS LINEDEVSTATUS
 ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineGetMessage function returns the next TAPI message that is queued for delivery
' to an application that is using the Event Handle notification mechanism (see
' lineInitializeEx for further details).
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineGetMessage LIB "tapi32.dll" ALIAS "lineGetMessage" ( BYVAL hLineApp AS QUAD , BYREF lpMessage AS LINEMESSAGE , BYVAL dwTimeout AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineGetNewCalls function returns call handles to calls on a specified line or
' address for which the application currently does not have handles. The application is
' granted monitor privilege to these calls.
' ========================================================================================
DECLARE FUNCTION lineGetNewCalls LIB "tapi32.dll" ALIAS "lineGetNewCalls" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwSelect AS QUAD , BYREF lpCallList AS LINECALLLIST ) AS LONG
' ========================================================================================
' The lineGetNumRings function determines the number of rings an incoming call on the
' given address should ring prior to answering the call.
' ========================================================================================
DECLARE FUNCTION lineGetNumRings LIB "tapi32.dll" ALIAS "lineGetNumRings" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpdwNumRings AS QUAD ) AS LONG
' ========================================================================================
' The lineGetProviderList function returns a list of service providers currently installed
' in the telephony system.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineGetProviderList LIB "tapi32.dll" ALIAS "lineGetProviderListA" ( BYVAL dwAPIVersion AS QUAD , BYREF lpProviderList AS LINEPROVIDERLIST ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineGetProviderListW LIB "tapi32.dll" ALIAS "lineGetProviderListW" ( BYVAL dwAPIVersion AS QUAD , BYREF lpProviderList AS LINEPROVIDERLIST ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineGetProxyStatus function returns a list of proxy request types that are currently
' being serviced for the specified device.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetProxyStatus LIB "tapi32.dll" ALIAS "lineGetProxyStatus" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAppAPIVersion AS QUAD , BYREF lpLineProxyReqestList AS LINEPROXYREQUESTLIST ) AS LONG
' ========================================================================================
' The lineGetQueueInfo function returns a structure holding the ACD information associated
' with a particular queue. It generates a LINE_PROXYREQUEST message to be sent to a
' registered proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_GETQUEUEINFO.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetQueueInfo LIB "tapi32.dll" ALIAS "lineGetQueueInfo" ( BYVAL hLine AS QUAD , BYVAL dwQueueID AS QUAD , BYREF lpLineQueueInfo AS LINEQUEUEINFO ) AS LONG
' ========================================================================================
' The lineGetQueueList function returns a list of queues associated with a particular ACD
' Group. It generates a LINE_PROXYREQUEST message to be sent to a registered proxy
' function handler, referencing a LINEPROXYREQUEST structure of type LINEPROXYREQUEST_GETQUEUELIST.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineGetQueueList LIB "tapi32.dll" ALIAS "lineGetQueueListA" ( BYVAL hLine AS QUAD , BYREF lpGroupID AS GUID , BYREF lpQueueList AS LINEQUEUELIST ) AS LONG
' // TAPI v2.2
DECLARE FUNCTION lineGetQueueListW LIB "tapi32.dll" ALIAS "lineGetQueueListW" ( BYVAL hLine AS QUAD , BYREF lpGroupID AS GUID , BYREF lpQueueList AS LINEQUEUELIST ) AS LONG
' ========================================================================================
' The lineGetRequest function retrieves the next by-proxy request for the specified
' request mode.
' ========================================================================================
DECLARE FUNCTION lineGetRequest LIB "tapi32.dll" ALIAS "lineGetRequestA" ( BYVAL hLineApp AS QUAD , BYVAL dwRequestMode AS QUAD , BYREF lpRequestBuffer AS ANY ) AS LONG
DECLARE FUNCTION lineGetRequestW LIB "tapi32.dll" ALIAS "lineGetRequestW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwRequestMode AS DWORD
 , BYREF lpRequestBuffer AS ANY
 ) AS LONG
' ========================================================================================
' The lineGetStatusMessages function enables an application to query which notification
' messages the application is set up to receive for events related to status changes for
' the specified line or any of its addresses.
' ========================================================================================
DECLARE FUNCTION lineGetStatusMessages LIB "tapi32.dll" ALIAS "lineGetStatusMessages" ( BYVAL hLine AS QUAD , BYREF lpdwLineStates AS QUAD , BYREF lpdwAddressStates AS QUAD ) AS LONG
' ========================================================================================
' The lineGetTranslateCaps function returns address translation capabilities.
' ========================================================================================
DECLARE FUNCTION lineGetTranslateCaps LIB "tapi32.dll" ALIAS "lineGetTranslateCapsA" ( BYVAL hLineApp AS QUAD , BYVAL dwAPIVersion AS QUAD , BYREF lpTranslateCaps AS LINETRANSLATECAPS ) AS LONG
DECLARE FUNCTION lineGetTranslateCapsW LIB "tapi32.dll" ALIAS "lineGetTranslateCapsW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwAPIVersion AS DWORD
 , BYREF lpTranslateCaps AS LINETRANSLATECAPS
 ) AS LONG
#ENDIF
' ========================================================================================
' The lineHandoff function gives ownership of the specified call to another application.
' The application can be either specified directly by its file name or indirectly as the
' highest priority application that handles calls of the specified media mode.
' ========================================================================================
DECLARE FUNCTION lineHandoff LIB "tapi32.dll" ALIAS "lineHandoffA" ( BYVAL hCall AS QUAD , BYREF lpszFileName AS ASCIIZ , BYVAL dwMediaMode AS QUAD ) AS LONG
DECLARE FUNCTION lineHandoffW LIB "tapi32.dll" ALIAS "lineHandoffW" ( BYVAL hCall AS QUAD
 , BYREF lpszFileName AS WSTRINGZ
 , BYVAL dwMediaMode AS DWORD
 ) AS LONG
' ========================================================================================
' The lineHold function places the specified call on hold.
' ========================================================================================
DECLARE FUNCTION lineHold LIB "tapi32.dll" ALIAS "lineHold" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineInitialize function is obsolete. It continues to be exported by Tapi.dll and
' Tapi32.dll for backward compatibility with applications using API versions 1.3 and 1.4.
' Applications using API version 2.0 or later must use lineInitializeEx instead.
' For TAPI Versions 1.4 and Earlier: The lineInitialize function initializes the
' application's use of Tapi.dll for subsequent use of the line abstraction. The
' function registers the application's specified notification mechanism and returns the
' number of line devices available to the application. A line device is any device that
' provides an implementation for the line-prefixed functions in TAPI.
' ========================================================================================
DECLARE FUNCTION lineInitialize LIB "tapi32.dll" ALIAS "lineInitialize" ( BYREF lphLineApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszAppName AS ASCIIZ , BYREF lpdwNumDevs AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineInitializeEx function initializes the application's use of TAPI for subsequent
' use of the line abstraction. It registers the application's specified notification
' mechanism and returns the number of line devices available to the application. A line
' device is any device that provides an implementation for the line-prefixed functions in
' the Telephony API.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineInitializeEx LIB "tapi32.dll" ALIAS "lineInitializeExA" ( BYREF lphLineApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszFriendlyAppName AS ASCIIZ , BYREF lpdwNumDevs AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpLineInitializeExParams AS LINEINITIALIZEEXPARAMS ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION lineInitializeExW LIB "tapi32.dll" ALIAS "lineInitializeExW" ( BYREF lphLineApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszFriendlyAppName AS WSTRINGZ , BYREF lpdwNumDevs AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpLineInitializeExParams AS LINEINITIALIZEEXPARAMS ) AS LONG
#ENDIF
' ========================================================================================
' The lineMakeCall function places a call on the specified line to the specified
' destination address. Optionally, call parameters can be specified if anything but
' default call setup parameters are requested.
' ========================================================================================
DECLARE FUNCTION lineMakeCall LIB "tapi32.dll" ALIAS "lineMakeCallA" ( BYVAL hLine AS QUAD , BYREF lphCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ , BYVAL dwCountryCode AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION lineMakeCallW LIB "tapi32.dll" ALIAS "lineMakeCallW" ( BYVAL hLine AS QUAD
 , BYREF lphCall AS DWORD
 , BYREF lpszDestAddress AS WSTRINGZ
 , BYVAL dwCountryCode AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
' ========================================================================================
' The lineMonitorDigits function enables and disables the unbuffered detection of digits
' received on the call. Each time a digit of the specified digit mode is detected, a
' message is sent to the application indicating which digit has been detected.
' ========================================================================================
DECLARE FUNCTION lineMonitorDigits LIB "tapi32.dll" ALIAS "lineMonitorDigits" ( BYVAL hCall AS QUAD , BYVAL dwDigitModes AS QUAD ) AS LONG
' ========================================================================================
' The lineMonitorMedia function enables and disables the detection of media types (modes)
' on the specified call. When a media type is detected, a message is sent to the
' application. For more information, see ITLegacyCallMediaControl::MonitorMedia.
' ========================================================================================
DECLARE FUNCTION lineMonitorMedia LIB "tapi32.dll" ALIAS "lineMonitorMedia" ( BYVAL hCall AS QUAD , BYVAL dwMediaModes AS QUAD ) AS LONG
' ========================================================================================
' The lineMonitorTones function enables and disables the detection of inband tones on the
' call. Each time a specified tone is detected, a message is sent to the application.
' ========================================================================================
DECLARE FUNCTION lineMonitorTones LIB "tapi32.dll" ALIAS "lineMonitorTones" ( BYVAL hCall AS QUAD , BYREF lpToneList AS LINEMONITORTONE , BYVAL dwNumEntries AS QUAD ) AS LONG
' ========================================================================================
' The lineNegotiateAPIVersion function allows an application to negotiate an API version
' to use.
' ========================================================================================
DECLARE FUNCTION lineNegotiateAPIVersion LIB "tapi32.dll" ALIAS "lineNegotiateAPIVersion" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPILowVersion AS QUAD , BYVAL dwAPIHighVersion AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpExtensionID AS LINEEXTENSIONID ) AS LONG
' ========================================================================================
' The lineNegotiateExtVersion function allows an application to negotiate an extension
' version to use with the specified line device. This operation need not be called if the
' application does not support extensions.
' ========================================================================================
DECLARE FUNCTION lineNegotiateExtVersion LIB "tapi32.dll" ALIAS "lineNegotiateExtVersion" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtLowVersion AS QUAD , BYVAL dwExtHighVersion AS QUAD , BYREF lpdwExtVersion AS QUAD ) AS LONG
' ========================================================================================
' The lineOpen function opens the line device specified by its device identifier and
' returns a line handle for the corresponding opened line device. This line handle is used
' in subsequent operations on the line device.
' ========================================================================================
DECLARE FUNCTION lineOpen LIB "tapi32.dll" ALIAS "lineOpenA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYREF lphLine AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYVAL dwCallbackInstance AS QUAD , BYVAL dwPrivileges AS QUAD , BYVAL dwMediaModes AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION lineOpenW LIB "tapi32.dll" ALIAS "lineOpenW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwDeviceID AS DWORD
 , BYREF lphLine AS DWORD
 , BYVAL dwAPIVersion AS DWORD
 , BYVAL dwExtVersion AS DWORD
 , BYVAL dwCallbackInstance AS DWORD
 , BYVAL dwPrivileges AS DWORD
 , BYVAL dwMediaModes AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
' ========================================================================================
' The linePark function parks the specified call according to the specified park mode.
' ========================================================================================
DECLARE FUNCTION linePark LIB "tapi32.dll" ALIAS "lineParkA" ( BYVAL hCall AS QUAD , BYVAL dwParkMode AS QUAD , BYREF lpszDirAddress AS ASCIIZ , BYREF lpNonDirAddress AS VARSTRING ) AS LONG
DECLARE FUNCTION lineParkW LIB "tapi32.dll" ALIAS "lineParkW" ( BYVAL hCall AS QUAD
 , BYVAL dwParkMode AS DWORD
 , BYREF lpszDirAddress AS WSTRINGZ
 , BYREF lpNonDirAddress AS VARSTRING
 ) AS LONG
' ========================================================================================
' The linePickup function picks up a call alerting at the specified destination address
' and returns a call handle for the picked-up call. If invoked with NULL for the
' lpszDestAddress parameter, a group pickup is performed. If required by the device,
' lpszGroupID specifies the group identifier to which the alerting station belongs.
' ========================================================================================
DECLARE FUNCTION linePickup LIB "tapi32.dll" ALIAS "linePickupA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lphCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ , BYREF lpszGroupID AS ASCIIZ ) AS LONG
DECLARE FUNCTION linePickupW LIB "tapi32.dll" ALIAS "linePickupW" ( BYVAL hLine AS QUAD
 , BYVAL dwAddressID AS DWORD
 , BYREF lphCall AS DWORD
 , BYREF lpszDestAddress AS WSTRINGZ
 , BYREF lpszGroupID AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The linePrepareAddToConference function prepares an existing conference call for the
' addition of another party.
' ========================================================================================
DECLARE FUNCTION linePrepareAddToConference LIB "tapi32.dll" ALIAS "linePrepareAddToConferenceA" ( BYVAL hConfCall AS QUAD , BYREF lphConsultCall AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION linePrepareAddToConferenceW LIB "tapi32.dll" ALIAS "linePrepareAddToConferenceW" ( BYVAL hConfCall AS QUAD
 , BYREF lphConsultCall AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineProxyMessage function is used by a registered proxy request handler to generate
' TAPI messages related to its role. For example, an ACD agent handler can use this
' function to generate LINE_AGENTSTATUS messages that are received by all applications
' that have the specified line open. TAPI suppresses generation of the message on the
' hLine specified in the function parameters.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineProxyMessage LIB "tapi32.dll" ALIAS "lineProxyMessage" ( BYVAL hLine AS QUAD , BYVAL hCall AS QUAD , BYVAL dwMsg AS QUAD , BYVAL dwParam1 AS QUAD , BYVAL dwParam2 AS QUAD , BYVAL dwParam3 AS QUAD ) AS LONG
' ========================================================================================
' The lineProxyResponse function indicates completion of a proxy request by a registered
' proxy handler, such as an ACD agent handler on a server.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineProxyResponse LIB "tapi32.dll" ALIAS "lineProxyResponse" ( BYVAL hLine AS QUAD , BYREF lpProxyRequest AS LINEPROXYREQUEST , BYVAL dwResult AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineRedirect function redirects the specified offering call to the specified
' destination address.
' ========================================================================================
DECLARE FUNCTION lineRedirect LIB "tapi32.dll" ALIAS "lineRedirectA" ( BYVAL hCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ , BYVAL dwCountryCode AS QUAD ) AS LONG
DECLARE FUNCTION lineRedirectW LIB "tapi32.dll" ALIAS "lineRedirectW" ( BYVAL hCall AS QUAD
 , BYREF lpszDestAddress AS WSTRINGZ
 , BYVAL dwCountryCode AS DWORD
 ) AS LONG
' ========================================================================================
' The lineRegisterRequestRecipient function registers the invoking application as a
' recipient of requests for the specified request mode.
' ========================================================================================
DECLARE FUNCTION lineRegisterRequestRecipient LIB "tapi32.dll" ALIAS "lineRegisterRequestRecipient" ( BYVAL hLineApp AS QUAD , BYVAL dwRegistrationInstance AS QUAD , BYVAL dwRequestMode AS QUAD , BYVAL bEnable AS QUAD ) AS LONG
' ========================================================================================
' The lineReleaseUserUserInfo function informs the service provider that the application
' has processed the user-user information contained in the LINECALLINFO structure, and
' that subsequently received user-user information can now be written into that structure.
' The service provider sends a LINE_CALLINFO message indicating LINECALLINFOSTATE_USERUSERINFO
' when new information is available.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineReleaseUserUserInfo LIB "tapi32.dll" ALIAS "lineReleaseUserUserInfo" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineRemoveFromConference function removes the specified call from the conference
' call to which it currently belongs. The remaining calls in the conference call are
' unaffected.
' ========================================================================================
DECLARE FUNCTION lineRemoveFromConference LIB "tapi32.dll" ALIAS "lineRemoveFromConference" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineRemoveProvider function removes an existing telephony service provider from the
' telephony system.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineRemoveProvider LIB "tapi32.dll" ALIAS "lineRemoveProvider" ( BYVAL dwPermanentProviderID AS QUAD , BYVAL hwndOwner AS QUAD ) AS LONG
' ========================================================================================
' The lineSecureCall function secures the call from any interruptions or interference that
' can affect the call's media stream.
' ========================================================================================
DECLARE FUNCTION lineSecureCall LIB "tapi32.dll" ALIAS "lineSecureCall" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineSendUserUserInfo function sends user-user information to the remote party on
' the specified call.
' ========================================================================================
DECLARE FUNCTION lineSendUserUserInfo LIB "tapi32.dll" ALIAS "lineSendUserUserInfo" ( BYVAL hCall AS QUAD , BYREF lpsUserUserInfo AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineSetAgentActivity function sets the agent activity code associated with a
' particular address.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetAgentActivity LIB "tapi32.dll" ALIAS "lineSetAgentActivity" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwActivityID AS QUAD ) AS LONG
' ========================================================================================
' The lineSetAgentGroup function sets the agent groups into which the agent is logged into
' on a particular address.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetAgentGroup LIB "tapi32.dll" ALIAS "lineSetAgentGroup" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lpAgentGroupList AS LINEAGENTGROUPLIST ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineSetAgentMeasurementPeriod function sets the measurement period associated with a
' particular agent. It generates a LINE_PROXYREQUEST message to be sent to a registered
' proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_SETAGENTMEASUREMENTPERIOD.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineSetAgentMeasurementPeriod LIB "tapi32.dll" ALIAS "lineSetAgentMeasurementPeriod" ( BYVAL DWORD , BYVAL DWORD , BYVAL DWORD ) AS LONG
' ========================================================================================
' The lineSetAgentSessionState function sets the agent session state associated with a
' particular agent session handle. It generates a LINE_PROXYREQUEST message to be sent to
' a registered proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_SETAGENTSESSIONSTATE.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineSetAgentSessionState LIB "tapi32.dll" ALIAS "lineSetAgentSessionState" ( BYVAL hLine AS QUAD , BYVAL hAgentSession AS QUAD , BYVAL dwAgentSessionState AS QUAD , BYVAL dwNextAgentSessionState AS QUAD ) AS LONG
' ========================================================================================
' The lineSetAgentStateEx function sets the agent state associated with a particular agent
' handle. It generates a LINE_PROXYREQUEST message to be sent to a registered proxy function
' handler, referencing a LINEPROXYREQUEST structure of type LINEPROXYREQUEST_SETAGENTSTATEEX.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineSetAgentStateEx LIB "tapi32.dll" ALIAS "lineSetAgentStateEx" ( BYVAL hLine AS QUAD , BYVAL hAgent AS QUAD , BYVAL dwAgentState AS QUAD , BYVAL dwNextAgentState AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetAgentState function sets the agent state associated with a particular address.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetAgentState LIB "tapi32.dll" ALIAS "lineSetAgentState" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwAgentState AS QUAD , BYVAL dwNextAgentState AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetAppPriority function enables an application to set its priority in the
' handoff priority list for a particular media type or Assisted Telephony request mode, or
' to remove itself from the priority list.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineSetAppPriority LIB "tapi32.dll" ALIAS "lineSetAppPriorityA" ( BYREF lpszAppFilename AS ASCIIZ , BYVAL dwMediaMode AS QUAD , BYREF lpExtensionID AS LINEEXTENSIONID , BYVAL dwRequestMode AS QUAD , BYREF lpszExtensionName AS ASCIIZ , BYVAL dwPriority AS QUAD ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineSetAppPriorityW LIB "tapi32.dll" ALIAS "lineSetAppPriorityW" ( BYREF lpszAppFilename AS WSTRINGZ , BYVAL dwMediaMode AS QUAD , BYREF lpExtensionID AS LINEEXTENSIONID , BYVAL dwRequestMode AS QUAD , BYREF lpszExtensionName AS WSTRINGZ , BYVAL dwPriority AS QUAD ) AS LONG
' ========================================================================================
' The lineSetAppSpecific function enables an application to set the application-specific
' field of the specified call's call-information record.
' ========================================================================================
DECLARE FUNCTION lineSetAppSpecific LIB "tapi32.dll" ALIAS "lineSetAppSpecific" ( BYVAL hCall AS QUAD , BYVAL dwAppSpecific AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineSetCallData function sets the CallData member in LINECALLINFO. Depending on the
' service provider implementation, the CallData member can be propagated to all
' applications having handles to the call, including those on other machines (through the
' server), and can travel with the call when it is transferred.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetCallData LIB "tapi32.dll" ALIAS "lineSetCallData" ( BYVAL hCall AS QUAD , BYREF lpCallData AS ANY , BYVAL dwSize AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetCallParams function allows an application to change bearer mode and/or the
' rate parameters of an existing call.
' ========================================================================================
DECLARE FUNCTION lineSetCallParams LIB "tapi32.dll" ALIAS "lineSetCallParams" ( BYVAL hCall AS QUAD , BYVAL dwBearerMode AS QUAD , BYVAL dwMinRate AS QUAD , BYVAL dwMaxRate AS QUAD , BYREF lpDialParams AS LINEDIALPARAMS ) AS LONG
' ========================================================================================
' The lineSetCallPrivilege function sets the application's privilege to the specified privilege.
' ========================================================================================
DECLARE FUNCTION lineSetCallPrivilege LIB "tapi32.dll" ALIAS "lineSetCallPrivilege" ( BYVAL hCall AS QUAD , BYVAL dwCallPrivilege AS QUAD ) AS LONG
' ========================================================================================
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineSetCallQualityOfService function allows the application to attempt to change the
' quality of service parameters (reserved capacity and performance guarantees) for an
' existing call. Except for basic parameter validation, this is a straight pass-through to
' a service provider.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetCallQualityOfService LIB "tapi32.dll" ALIAS "lineSetCallQualityOfService" ( BYVAL hCall AS QUAD , BYREF lpSendingFlowspec AS ANY , BYVAL dwSendingFlowspecSize AS QUAD , BYREF lpReceivingFlowspec AS ANY , BYVAL dwReceivingFlowspecSize AS QUAD ) AS LONG
' ========================================================================================
' The lineSetCallTreatment function sets the sounds a party on a call that is unanswered
' or on hold hears. Except for basic parameter validation, it is a straight pass-through
' by TAPI to the service provider.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetCallTreatment LIB "tapi32.dll" ALIAS "lineSetCallTreatment"( BYVAL hCall AS QUAD , BYVAL dwTreatment AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetCurrentLocation function sets the location used as the context for address
' translation.
' ========================================================================================
DECLARE FUNCTION lineSetCurrentLocation LIB "tapi32.dll" ALIAS "lineSetCurrentLocation" ( BYVAL hLineApp AS QUAD , BYVAL dwLocation AS QUAD ) AS LONG
' ========================================================================================
' The lineSetDevConfig function allows the application to restore the configuration of a
' media stream device on a line device to a setup previously obtained using
' lineGetDevConfig. For example, the contents of this structure could specify data rate,
' character format, modulation schemes, and error control protocol settings for a
' "datamodem" media device associated with the line.
' ========================================================================================
DECLARE FUNCTION lineSetDevConfig LIB "tapi32.dll" ALIAS "lineSetDevConfigA" ( BYVAL dwDeviceID AS QUAD , BYREF lpDeviceConfig AS ANY , BYVAL dwSize AS QUAD , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION lineSetDevConfigW LIB "tapi32.dll" ALIAS "lineSetDevConfigW" ( BYVAL dwDeviceID AS QUAD
 , BYREF lpDeviceConfig AS ANY
 , BYVAL dwSize AS DWORD
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The lineSetLineDevStatus function sets the line device status. Except for basic
' parameter validation, it is a straight pass-through to the service provider. The service
' provider sends a LINE_LINEDEVSTATE message to inform applications of the new state, when
' set; TAPI does not synthesize these messages.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION lineSetLineDevStatus LIB "tapi32.dll" ALIAS "lineSetLineDevStatus" ( BYVAL hLine AS QUAD , BYVAL dwStatusToChange AS QUAD , BYVAL fStatus AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetMediaControl function enables and disables control actions on the media
' stream associated with the specified line, address, or call. Media control actions can
' be triggered by the detection of specified digits, media types, custom tones, and call
' states.
' ========================================================================================
DECLARE FUNCTION lineSetMediaControl LIB "tapi32.dll" ALIAS "lineSetMediaControl" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL hCall AS QUAD , BYVAL dwSelect AS QUAD , BYREF lpDigitList AS LINEMEDIACONTROLDIGIT , BYVAL dwDigitNumEntries AS QUAD , BYREF lpMediaList AS LINEMEDIACONTROLMEDIA , BYVAL dwMediaNumEntries AS QUAD , BYREF lpToneList AS LINEMEDIACONTROLTONE , BYVAL dwToneNumEntries AS QUAD , BYREF lpCallStateList AS LINEMEDIACONTROLCALLSTATE , BYVAL dwCallStateNumEntries AS QUAD ) AS LONG
' ========================================================================================
' The lineSetMediaMode function sets the media type(s) of the specified call in its
' LINECALLINFO structure. For more information, see ITLegacyCallMediaControl::SetMediaType.
' ========================================================================================
DECLARE FUNCTION lineSetMediaMode LIB "tapi32.dll" ALIAS "lineSetMediaMode" ( BYVAL hCall AS QUAD , BYVAL dwMediaModes AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020002
' ========================================================================================
' The lineSetQueueMeasurementPeriod function sets the measurement period associated with a
' particular queue. It generates a LINE_PROXYREQUEST message to be sent to a registered
' proxy function handler, referencing a LINEPROXYREQUEST structure of type
' LINEPROXYREQUEST_SETQUEUEMEASUREMENTPERIOD.
' ========================================================================================
' // TAPI v2.2
DECLARE FUNCTION lineSetQueueMeasurementPeriod LIB "tapi32.dll" ALIAS "lineSetQueueMeasurementPeriod" ( BYVAL hLine AS QUAD , BYVAL dwQueueID AS QUAD , BYVAL dwMeasurementPeriod AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The lineSetNumRings function sets the number of rings that must occur before an incoming
' call is answered. This function can be used to implement a toll-saver-style function. It
' allows multiple independent applications to each register the number of rings. The
' function lineGetNumRings returns the minimum number of rings requested. It can be used
' by the application that answers incoming calls to determine the number of rings it
' should wait before answering the call.
' ========================================================================================
DECLARE FUNCTION lineSetNumRings LIB "tapi32.dll" ALIAS "lineSetNumRings" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL dwNumRings AS QUAD ) AS LONG
' ========================================================================================
' The lineSetStatusMessages function enables an application to specify which notification
' messages to receive for events related to status changes for the specified line or any
' of its addresses.
' ========================================================================================
DECLARE FUNCTION lineSetStatusMessages LIB "tapi32.dll" ALIAS "lineSetStatusMessages" ( BYVAL hLine AS QUAD , BYVAL dwLineStates AS QUAD , BYVAL dwAddressStates AS QUAD ) AS LONG
' ========================================================================================
' The lineSetTerminal function enables an application to specify which terminal
' information related to the specified line, address, or call is to be routed. The
' lineSetTerminal function can be used while calls are in progress on the line to allow
' an application to route these events to different devices as required.
' ========================================================================================
DECLARE FUNCTION lineSetTerminal LIB "tapi32.dll" ALIAS "lineSetTerminal" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYVAL hCall AS QUAD , BYVAL dwSelect AS QUAD , BYVAL dwTerminalModes AS QUAD , BYVAL dwTerminalID AS QUAD , BYVAL bEnable AS QUAD ) AS LONG
' ========================================================================================
' The lineSetTollList function manipulates the toll list.
' ========================================================================================
DECLARE FUNCTION lineSetTollList LIB "tapi32.dll" ALIAS "lineSetTollListA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYREF lpszAddressIn AS ASCIIZ , BYVAL dwTollListOption AS QUAD ) AS LONG
DECLARE FUNCTION lineSetTollListW LIB "tapi32.dll" ALIAS "lineSetTollListW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwDeviceID AS DWORD
 , BYREF lpszAddressIn AS WSTRINGZ
 , BYVAL dwTollListOption AS DWORD
 ) AS LONG
' ========================================================================================
' The lineSetupConference function sets up a conference call for the addition of the
' third party.
' ========================================================================================
DECLARE FUNCTION lineSetupConference LIB "tapi32.dll" ALIAS "lineSetupConferenceA" ( BYVAL hCall AS QUAD , BYVAL hLine AS QUAD , BYREF lphConfCall AS QUAD , BYREF lphConsultCall AS QUAD , BYVAL dwNumParties AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION lineSetupConferenceW LIB "tapi32.dll" ALIAS "lineSetupConferenceW" ( BYVAL hCall AS QUAD
 , BYVAL hLine AS DWORD
 , BYREF lphConfCall AS DWORD
 , BYREF lphConsultCall AS DWORD
 , BYVAL dwNumParties AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
' ========================================================================================
' The lineSetupTransfer function initiates a transfer of the call specified by the hCall
' parameter. It establishes a consultation call, lphConsultCall, on which the party can be
' dialed that can become the destination of the transfer. The application acquires owner
' privilege to the lphConsultCall parameter.
' ========================================================================================
DECLARE FUNCTION lineSetupTransfer LIB "tapi32.dll" ALIAS "lineSetupTransferA" ( BYVAL hCall AS QUAD , BYREF lphConsultCall AS QUAD , BYREF lpCallParams AS LINECALLPARAMS ) AS LONG
DECLARE FUNCTION lineSetupTransferW LIB "tapi32.dll" ALIAS "lineSetupTransferW" ( BYVAL hCall AS QUAD
 , BYREF lphConsultCall AS DWORD
 , BYREF lpCallParams AS LINECALLPARAMS
 ) AS LONG
' ========================================================================================
' The lineShutdown function shuts down the application's usage of the line abstraction of
' the API.
' ========================================================================================
DECLARE FUNCTION lineShutdown LIB "tapi32.dll" ALIAS "lineShutdown" ( BYVAL hLineApp AS QUAD ) AS LONG
' ========================================================================================
' The lineSwapHold function swaps the specified active call with the specified call on
' consultation hold.
' ========================================================================================
DECLARE FUNCTION lineSwapHold LIB "tapi32.dll" ALIAS "lineSwapHold" ( BYVAL hActiveCall AS QUAD , BYVAL hHeldCall AS QUAD ) AS LONG
' ========================================================================================
' The lineTranslateAddress function translates the specified address into another format.
' ========================================================================================
DECLARE FUNCTION lineTranslateAddress LIB "tapi32.dll" ALIAS "lineTranslateAddressA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYREF lpszAddressIn AS ASCIIZ , BYVAL dwCard AS QUAD , BYVAL dwTranslateOptions AS QUAD , BYREF lpTranslateOutput AS LINETRANSLATEOUTPUT ) AS LONG
DECLARE FUNCTION lineTranslateAddressW LIB "tapi32.dll" ALIAS "lineTranslateAddressW" ( BYVAL hLineApp AS QUAD
 , BYVAL dwDeviceID AS DWORD
 , BYVAL dwAPIVersion AS DWORD
 , BYREF lpszAddressIn AS WSTRINGZ
 , BYVAL dwCard AS DWORD
 , BYVAL dwTranslateOptions AS DWORD
 , BYREF lpTranslateOutput AS LINETRANSLATEOUTPUT
 ) AS LONG
' ========================================================================================
' The lineTranslateDialog function displays an application-modal dialog box that allows
' the user to change the current location of a phone number about to be dialed, adjust
' location and calling card parameters, and see the effect.
' ========================================================================================
' // TAPI v1.4
DECLARE FUNCTION lineTranslateDialog LIB "tapi32.dll" ALIAS "lineTranslateDialogA" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszAddressIn AS ASCIIZ ) AS LONG
' // TAPI v1.4
DECLARE FUNCTION lineTranslateDialogW LIB "tapi32.dll" ALIAS "lineTranslateDialogW" ( BYVAL hLineApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszAddressIn AS WSTRINGZ ) AS LONG
' ========================================================================================
' The lineUncompleteCall function cancels the specified call completion request on the
' specified line.
' ========================================================================================
DECLARE FUNCTION lineUncompleteCall LIB "tapi32.dll" ALIAS "lineUncompleteCall" ( BYVAL hLine AS QUAD , BYVAL dwCompletionID AS QUAD ) AS LONG
' ========================================================================================
' The lineUnhold function retrieves the specified held call.
' ========================================================================================
DECLARE FUNCTION lineUnhold LIB "tapi32.dll" ALIAS "lineUnhold" ( BYVAL hCall AS QUAD ) AS LONG
' ========================================================================================
' The lineUnpark function retrieves the call parked at the specified address and returns a
' call handle for it.
' ========================================================================================
DECLARE FUNCTION lineUnpark LIB "tapi32.dll" ALIAS "lineUnparkA" ( BYVAL hLine AS QUAD , BYVAL dwAddressID AS QUAD , BYREF lphCall AS QUAD , BYREF lpszDestAddress AS ASCIIZ ) AS LONG
DECLARE FUNCTION lineUnparkW LIB "tapi32.dll" ALIAS "lineUnparkW" ( BYVAL hLine AS QUAD
 , BYVAL dwAddressID AS DWORD
 , BYREF lphCall AS DWORD
 , BYREF lpszDestAddress AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The phoneClose function closes the specified open phone device.
' ========================================================================================
DECLARE FUNCTION phoneClose LIB "tapi32.dll" ALIAS "phoneClose" ( BYVAL hPhone AS QUAD ) AS LONG
' ========================================================================================
' The phoneConfigDialog function causes the provider of the specified phone device to
' display a modal dialog box (attached to the application's hwndOwner parameter) that
' allows the user to configure parameters related to the phone device specified by
' dwDeviceID.
' ========================================================================================
DECLARE FUNCTION phoneConfigDialog LIB "tapi32.dll" ALIAS "phoneConfigDialogA" ( BYVAL dwDeviceID AS QUAD , BYVAL hwndOwner AS QUAD , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION phoneConfigDialogW LIB "tapi32.dll" ALIAS "phoneConfigDialogW" ( BYVAL dwDeviceID AS QUAD
 , BYVAL hwndOwner AS DWORD
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The phoneDevSpecific function is used as a general extension mechanism to enable a
' Telephony API implementation to provide features not described in the other TAPI
' functions. The meanings of these extensions are device specific.
' ========================================================================================
DECLARE FUNCTION phoneDevSpecific LIB "tapi32.dll" ALIAS "phoneDevSpecific" ( BYVAL hPhone AS QUAD , BYREF lpParams AS ANY , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetButtonInfo function returns information about the specified button.
' ========================================================================================
DECLARE FUNCTION phoneGetButtonInfo LIB "tapi32.dll" ALIAS "phoneGetButtonInfoA" ( BYVAL hPhone AS QUAD , BYVAL dwButtonLampID AS QUAD , BYREF lpButtonInfo AS PHONEBUTTONINFO ) AS LONG
DECLARE FUNCTION phoneGetButtonInfoW LIB "tapi32.dll" ALIAS "phoneGetButtonInfoW" ( BYVAL hPhone AS QUAD
 , BYVAL dwButtonLampID AS DWORD
 , BYREF lpButtonInfo AS PHONEBUTTONINFO
 ) AS LONG
' ========================================================================================
' The phoneGetData function uploads the information from the specified location in the
' open phone device to the specified buffer.
' ========================================================================================
DECLARE FUNCTION phoneGetData LIB "tapi32.dll" ALIAS "phoneGetData" ( BYVAL hPhone AS QUAD , BYVAL dwDataID AS QUAD , BYREF lpData AS ANY , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetDevCaps function queries a specified phone device to determine its
' telephony capabilities.
' ========================================================================================
DECLARE FUNCTION phoneGetDevCaps LIB "tapi32.dll" ALIAS "phoneGetDevCapsA" ( BYVAL hPhoneApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYREF lpPhoneCaps AS PHONECAPS ) AS LONG ' LOMG
DECLARE FUNCTION phoneGetDevCapsW LIB "tapi32.dll" ALIAS "phoneGetDevCapsW" ( BYVAL hPhoneApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYREF lpPhoneCaps AS PHONECAPS ) AS LONG
' ========================================================================================
' The phoneGetDisplay function returns the current contents of the specified phone display.
' ========================================================================================
DECLARE FUNCTION phoneGetDisplay LIB "tapi32.dll" ALIAS "phoneGetDisplay" ( BYVAL hPhone AS QUAD , BYREF lpDisplay AS VARSTRING ) AS LONG
' ========================================================================================
' The phoneGetGain function returns the gain setting of the microphone of the specified
' phone's hookswitch device.
' ========================================================================================
DECLARE FUNCTION phoneGetGain LIB "tapi32.dll" ALIAS "phoneGetGain" ( BYVAL hPhone AS QUAD , BYVAL dwHookSwitchDev AS QUAD , BYREF lpdwGain AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetHookSwitch function returns the current hookswitch mode of the specified
' open phone device.
' ========================================================================================
DECLARE FUNCTION phoneGetHookSwitch LIB "tapi32.dll" ALIAS "phoneGetHookSwitch" ( BYVAL hPhone AS QUAD , BYREF lpdwHookSwitchDevs AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetIcon function allows an application to retrieve a service phone
' device-specific (or provider-specific) icon that can be displayed to the user.
' ========================================================================================
DECLARE FUNCTION phoneGetIcon LIB "tapi32.dll" ALIAS "phoneGetIconA" ( BYVAL dwDeviceID AS QUAD , BYREF lpszDeviceClass AS ASCIIZ , BYREF lphIcon AS QUAD ) AS LONG
DECLARE FUNCTION phoneGetIconW LIB "tapi32.dll" ALIAS "phoneGetIconW" ( BYVAL dwDeviceID AS QUAD
 , BYREF lpszDeviceClass AS WSTRINGZ
 , BYREF lphIcon AS DWORD
 ) AS LONG
' ========================================================================================
' The phoneGetID function returns a device identifier for the given device class
' associated with the specified phone device.
' ========================================================================================
DECLARE FUNCTION phoneGetID LIB "tapi32.dll" ALIAS "phoneGetIDA" ( BYVAL hPhone AS QUAD , BYREF lpDeviceID AS VARSTRING , BYREF lpszDeviceClass AS ASCIIZ ) AS LONG
DECLARE FUNCTION phoneGetIDW LIB "tapi32.dll" ALIAS "phoneGetIDW" ( BYVAL hPhone AS QUAD
 , BYREF lpDeviceID AS VARSTRING
 , BYREF lpszDeviceClass AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The phoneGetLamp function returns the current lamp mode of the specified lamp.
' ========================================================================================
DECLARE FUNCTION phoneGetLamp LIB "tapi32.dll" ALIAS "phoneGetLamp" ( BYVAL hPhone AS QUAD , BYVAL dwButtonLampID AS QUAD , BYREF lpdwLampMode AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The phoneGetMessage function returns the next TAPI message that is queued for delivery
' to an application that is using the Event Handle notification mechanism (see
' phoneInitializeEx for further details).
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION phoneGetMessage LIB "tapi32.dll" ALIAS "phoneGetMessage" ( BYVAL hPhoneApp AS QUAD , BYREF lpMessage AS PHONEMESSAGE , BYVAL dwTimeout AS QUAD ) AS LONG
#ENDIF
' ========================================================================================
' The phoneGetRing function enables an application to query the specified open phone
' device as to its current ring mode.
' ========================================================================================
DECLARE FUNCTION phoneGetRing LIB "tapi32.dll" ALIAS "phoneGetRing" ( BYVAL hPhone AS QUAD , BYREF lpdwRingMode AS QUAD , BYREF lpdwVolume AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetStatus function enables an application to query the specified open phone
' device for its overall status.
' ========================================================================================
DECLARE FUNCTION phoneGetStatus LIB "tapi32.dll" ALIAS "phoneGetStatusA" ( BYVAL hPhone AS QUAD , BYREF lpPhoneStatus AS PHONESTATUS ) AS LONG
DECLARE FUNCTION phoneGetStatusW LIB "tapi32.dll" ALIAS "phoneGetStatusW" ( BYVAL hPhone AS QUAD
 , BYREF lpPhoneStatus AS PHONESTATUS
 ) AS LONG
' ========================================================================================
' The phoneGetStatusMessages function returns which phone-state changes on the specified
' phone device generate a callback to the application.
' ========================================================================================
DECLARE FUNCTION phoneGetStatusMessages LIB "tapi32.dll" ALIAS "phoneGetStatusMessages" ( BYVAL hPhone AS QUAD , BYREF lpdwPhoneStates AS QUAD , BYREF lpdwButtonModes AS QUAD , BYREF lpdwButtonStates AS QUAD ) AS LONG
' ========================================================================================
' The phoneGetVolume function returns the volume setting of the specified phone's
' hookswitch device.
' ========================================================================================
DECLARE FUNCTION phoneGetVolume LIB "tapi32.dll" ALIAS "phoneGetVolume" ( BYVAL hPhone AS QUAD , BYVAL dwHookSwitchDev AS QUAD , BYREF lpdwVolume AS QUAD ) AS LONG
' ========================================================================================
' The phoneInitialize function is obsolete. It continues to be exported by Tapi.dll and
' Tapi32.dll for backward compatibility with applications using TAPI versions 1.3 and 1.4.
' Applications using TAPI version 2.0 or later must use phoneInitializeEx instead.
' For TAPI Versions 1.4 and Earlier: The phoneInitialize function initializes the
' application's use of TAPI for the subsequent use of the phone functions in the
' Telephony API. It registers the application's specified notification mechanism and
' returns the number of phone devices that are available to the application.
' ========================================================================================
DECLARE FUNCTION phoneInitialize LIB "tapi32.dll" ALIAS "phoneInitialize" ( BYREF lphPhoneApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszAppName AS ASCIIZ , BYREF lpdwNumDevs AS QUAD ) AS LONG
#IF %TAPI_CURRENT_VERSION >= &H00020000
' ========================================================================================
' The phoneInitializeEx function initializes the application's use of TAPI for subsequent
' use of the phone abstraction. It registers the application's specified notification
' mechanism and returns the number of phone devices available to the application. A phone
' device is any device that provides an implementation for the phone-prefixed functions in
' the Telephony API.
' ========================================================================================
' // TAPI v2.0
DECLARE FUNCTION phoneInitializeEx LIB "tapi32.dll" ALIAS "phoneInitializeExA" ( BYREF lphPhoneApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszFriendlyAppName AS ASCIIZ , BYREF lpdwNumDevs AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpPhoneInitializeExParams AS PHONEINITIALIZEEXPARAMS ) AS LONG
' // TAPI v2.0
DECLARE FUNCTION phoneInitializeExW LIB "tapi32.dll" ALIAS "phoneInitializeExW" ( BYREF lphPhoneApp AS QUAD , BYVAL hInstance AS QUAD , BYVAL lpfnCallback AS QUAD , BYREF lpszFriendlyAppName AS WSTRINGZ , BYREF lpdwNumDevs AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpPhoneInitializeExParams AS PHONEINITIALIZEEXPARAMS ) AS LONG
#ENDIF
' ========================================================================================
' The phoneNegotiateAPIVersion allows an application to negotiate an API version to use
' for the specified phone device.
' ========================================================================================
DECLARE FUNCTION phoneNegotiateAPIVersion LIB "tapi32.dll" ALIAS "phoneNegotiateAPIVersion" ( BYVAL hPhoneApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPILowVersion AS QUAD , BYVAL dwAPIHighVersion AS QUAD , BYREF lpdwAPIVersion AS QUAD , BYREF lpExtensionID AS PHONEEXTENSIONID ) AS LONG
' ========================================================================================
' The phoneNegotiateExtVersion function allows an application to negotiate an extension
' version to use with the specified phone device. This operation need not be called if the
' application does not support extensions.
' ========================================================================================
DECLARE FUNCTION phoneNegotiateExtVersion LIB "tapi32.dll" ALIAS "phoneNegotiateExtVersion" ( BYVAL hPhoneApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtLowVersion AS QUAD , BYVAL dwExtHighVersion AS QUAD , BYREF lpdwExtVersion AS QUAD ) AS LONG
' ========================================================================================
' The phoneOpen function opens the specified phone device. A phone device can be opened
' using either owner privilege or monitor privilege. An application that opens the phone
' with owner privilege can control the phone's lamps, display, ringer, and hookswitch or
' hookswitches. An application that opens the phone device with monitor privilege is notified
' only about events that occur at the phone, such as hookswitch changes or button presses.
' Ownership of a phone device is exclusive. In other words, only one application can have
' a phone device opened with owner privilege at a time. The phone device can, however, be
' opened multiple times with monitor privilege.
' ========================================================================================
DECLARE FUNCTION phoneOpen LIB "tapi32.dll" ALIAS "phoneOpen" ( BYVAL hPhoneApp AS QUAD , BYVAL dwDeviceID AS QUAD , BYREF lphPhone AS QUAD , BYVAL dwAPIVersion AS QUAD , BYVAL dwExtVersion AS QUAD , BYVAL dwCallbackInstance AS QUAD , BYVAL dwPrivilege AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetButtonInfo function sets information about the specified button on the
' specified phone.
' ========================================================================================
DECLARE FUNCTION phoneSetButtonInfo LIB "tapi32.dll" ALIAS "phoneSetButtonInfoA" ( BYVAL hPhone AS QUAD , BYVAL dwButtonLampID AS QUAD , BYREF lpButtonInfo AS PHONEBUTTONINFO ) AS LONG
DECLARE FUNCTION phoneSetButtonInfoW LIB "tapi32.dll" ALIAS "phoneSetButtonInfoW" ( BYVAL hPhone AS QUAD
 , BYVAL dwButtonLampID AS DWORD
 , BYREF lpButtonInfo AS PHONEBUTTONINFO
 ) AS LONG
' ========================================================================================
' The phoneSetData function downloads the information in the specified buffer to the
' opened phone device at the selected data identifier.
' ========================================================================================
DECLARE FUNCTION phoneSetData LIB "tapi32.dll" ALIAS "phoneSetData" ( BYVAL hPhone AS QUAD , BYVAL dwDataID AS QUAD , BYREF lpData AS ANY , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetDisplay function causes the specified string to be displayed on the
' specified open phone device.
' ========================================================================================
DECLARE FUNCTION phoneSetDisplay LIB "tapi32.dll" ALIAS "phoneSetDisplay" ( BYVAL hPhone AS QUAD , BYVAL dwRow AS QUAD , BYVAL dwColumn AS QUAD , BYREF lpsDisplay AS ASCIIZ , BYVAL dwSize AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetGain function sets the gain of the microphone of the specified hookswitch
' device to the specified gain level.
' ========================================================================================
DECLARE FUNCTION phoneSetGain LIB "tapi32.dll" ALIAS "phoneSetGain" ( BYVAL hPhone AS QUAD , BYVAL dwHookSwitchDev AS QUAD , BYVAL dwGain AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetHookSwitch function sets the hook state of the specified open phone's
' hookswitch devices to the specified mode. Only the hookswitch state of the hookswitch
' devices listed is affected.
' ========================================================================================
DECLARE FUNCTION phoneSetHookSwitch LIB "tapi32.dll" ALIAS "phoneSetHookSwitch" ( BYVAL hPhone AS QUAD , BYVAL dwHookSwitchDevs AS QUAD , BYVAL dwHookSwitchMode AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetLamp function causes the specified lamp to be lit on the specified open
' phone device in the specified lamp mode.
' ========================================================================================
DECLARE FUNCTION phoneSetLamp LIB "tapi32.dll" ALIAS "phoneSetLamp" ( BYVAL hPhone AS QUAD , BYVAL dwButtonLampID AS QUAD , BYVAL dwLampMode AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetRing function rings the specified open phone device using the specified ring
' mode and volume.
' ========================================================================================
DECLARE FUNCTION phoneSetRing LIB "tapi32.dll" ALIAS "phoneSetRing" ( BYVAL hPhone AS QUAD , BYVAL dwRingMode AS QUAD , BYVAL dwVolume AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetStatusMessages function enables an application to monitor the specified
' phone device for selected status events.
' ========================================================================================
DECLARE FUNCTION phoneSetStatusMessages LIB "tapi32.dll" ALIAS "phoneSetStatusMessages" ( BYVAL hPhone AS QUAD , BYVAL dwPhoneStates AS QUAD , BYVAL dwButtonModes AS QUAD , BYVAL dwButtonStates AS QUAD ) AS LONG
' ========================================================================================
' The phoneSetVolume function sets the volume of the speaker component of the specified
' hookswitch device to the specified level.
' ========================================================================================
DECLARE FUNCTION phoneSetVolume LIB "tapi32.dll" ALIAS "phoneSetVolume" ( BYVAL hPhone AS QUAD , BYVAL dwHookSwitchDev AS QUAD , BYVAL dwVolume AS QUAD ) AS LONG
' ========================================================================================
' The phoneShutdown function shuts down the application's usage of TAPI's phone abstraction.
' ========================================================================================
DECLARE FUNCTION phoneShutdown LIB "tapi32.dll" ALIAS "phoneShutdown" ( BYVAL hPhoneApp AS QUAD ) AS LONG
' ========================================================================================
' The tapiGetLocationInfo function returns the country code and city (area) code that the
' user has set in the current location parameters in the Telephony Control Panel. The
' application can use this information to assist the user in forming proper canonical
' telephone numbers, such as by offering these as defaults when new numbers are entered in
' a phone book entry or database record.
' ========================================================================================
DECLARE FUNCTION tapiGetLocationInfo LIB "tapi32.dll" ALIAS "tapiGetLocationInfoA" ( BYREF lpszCountryCode AS ASCIIZ , BYREF lpszCityCode AS ASCIIZ ) AS LONG
DECLARE FUNCTION tapiGetLocationInfoW LIB "tapi32.dll" ALIAS "tapiGetLocationInfoW" ( BYREF lpszCountryCode AS WSTRINGZ
 , BYREF lpszCityCode AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The tapiRequestDrop function is nonfunctional and obsolete for all classes of
' Windows-based applications. It should not be used. Will always return an error code.
' ========================================================================================
'DECLARE FUNCTION tapiRequestDrop LIB "tapi32.dll" ALIAS "tapiRequestDrop" ( ' BYVAL hwnd AS DWORD
' , BYVAL wRequestID AS DWORD
' ) AS LONG
' ========================================================================================
' The tapiRequestMakeCall function requests the establishment of a voice call. A
' call-manager application is responsible for establishing the call on behalf of the
' requesting application, which is then controlled by the user's call-manager application.
' ========================================================================================
DECLARE FUNCTION tapiRequestMakeCall LIB "tapi32.dll" ALIAS "tapiRequestMakeCallA" ( BYREF lpszDestAddress AS ASCIIZ , BYREF lpszAppName AS ASCIIZ , BYREF lpszCalledParty AS ASCIIZ , BYREF lpszComment AS ASCIIZ ) AS LONG
DECLARE FUNCTION tapiRequestMakeCallW LIB "tapi32.dll" ALIAS "tapiRequestMakeCallW" ( BYREF lpszDestAddress AS WSTRINGZ
 , BYREF lpszAppName AS WSTRINGZ
 , BYREF lpszCalledParty AS WSTRINGZ
 , BYREF lpszComment AS WSTRINGZ
 ) AS LONG
' ========================================================================================
' The tapiRequestMediaCall function was never implemented in any version of TAPI. This
' function is obsolete and should not be used.
' ========================================================================================
'DECLARE FUNCTION tapiRequestMediaCall LIB "tapi32.dll" ALIAS "tapiRequestMediaCallA" ( ' BYVAL hwnd AS DWORD
' BYVAL wRequestID AS DWORD
' BYREF lpszDeviceClass AS ASCIIZ
' BYREF lpDeviceID AS ASCIIZ
' BYVAL dwSize AS DWORD
' BYVAL dwSecure AS DWORD
' BYREF lpszDestAddress AS ASCIIZ
' BYREF lpszAppName AS ASCIIZ
' BYREF lpszCalledParty AS ASCIIZ
' BYREF lpszComment AS ASCIIZ
' ) AS LONG
'DECLARE FUNCTION tapiRequestMediaCallW LIB "tapi32.dll" ALIAS "tapiRequestMediaCallW" ( ' BYVAL hwnd AS DWORD
' BYVAL wRequestID AS DWORD
' BYREF lpszDeviceClass AS WSTRINGZ
' BYREF lpDeviceID AS WSTRINGZ
' BYVAL dwSize AS DWORD
' BYVAL dwSecure AS DWORD
' BYREF lpszDestAddress AS WSTRINGZ
' BYREF lpszAppName AS WSTRINGZ
' BYREF lpszCalledParty AS WSTRINGZ
' BYREF lpszComment AS WSTRINGZ
' ) AS LONG
'/*
'TAPIERROR_FORMATMESSAGE - macro to convert a TAPI error constant
' into a constant that FormatMessage will accept
' TAPIERR : Negative numbers and 0
' Map to : strip off high WORD
' Example: &HFFFFFFFF (-1) becomes &H0000FFFF
' LINEERR : Start at &H80000000
' Map to : strip off &H80000000 and add &HE000
' Example: &H80000004 becomes &H0000E004
' PHONEERR: Start at &H90000000
' Map to : strip off &H90000000 and add &HF000
' Example: &H9000000A becomes &H0000F00A
' pseudocode:
' if (__ErrCode__ is a TAPIERR)
' strip off high word
' else if (__ErrCode__ is a PHONEERR)
' strip off &H90000000
' add &HE000
' else
' strip off &H80000000
' add &HF000
'*/
'#define TAPIERROR_FORMATMESSAGE(__ErrCode__) \
' \
' ( ( (__ErrCode__) > &HFFFF0000 ) ? \
' \
' ( (__ErrCode__) & &H0000FFFF ) : \
' \
' ( ( (__ErrCode__) & &H10000000 ) ? \
' \
' ( (__ErrCode__) - &H90000000 + &HF000 ) : \
' \
' ( (__ErrCode__) - &H80000000 + &HE000 ) ) )
FUNCTION TAPIERROR_FORMATMESSAGE (BYVAL dwErrCode AS DWORD) AS DWORD
 IF dwErrCode > &HFFFF0000 THEN
 dwErrCode = dwErrCode AND &H0000FFFF
 ELSEIF (dwErrCode AND &H10000000) THEN
 dwErrCode = dwErrCode - &H90000000 + &HF000
 ELSE
 dwErrCode = dwErrCode - &H80000000 + &HE000
 END IF
 FUNCTION = dwErrCode
END FUNCTION
'#pragma pack()
#ENDIF
