

'       FILE: d40low.txt
'
'Misc. values
 
Global Const NULLSPTR = &HFFFF        ' null silence pointer

'
'reset complete values
 
Global Const DLR_SUCC = &H0           ' board was successfully reset
Global Const DLR_MEMFAIL = &H1        ' board failed memory test
Global Const DLR_REGFAIL = &H2        ' board failed register test
Global Const DLR_FLAGFAIL = &H3       ' board failed flags test
Global Const DLR_CHKSUM = &H4         ' board failed checksum test
Global Const DLR_PRODID = &H5         ' invalid product ID code
Global Const DLR_CHNUM = &H6          ' invalid number of channels

'
'Equates for Dialog/4x to PC command codes.
'The following messages are enabled by the set_IEN command.
 
Global Const DL_B0FULL = &H1          ' buffer 0 full
Global Const DL_B1FULL = &H2          ' buffer 1 full
Global Const DL_B0EMPTY = &H3         ' buffer 0 empty
Global Const DL_B1EMPTY = &H4         ' buffer 1 empty

'
'Equates for Dialog/4x to PC command codes.
'The following message is enabled by the 'old' param. of the PC_INITBUF cmd.
 
Global Const DL_DIGITRDY = &H0        ' digit collected

'
'Equates for Dialog/4x to PC command codes.
'The following messages are always enabled.
 
Global Const DL_RECORD = &H8          ' record complete
Global Const DL_RECCMPLT = DL_RECORD ' duplicate name for driver
Global Const DL_PLAYBACK = &H7        ' playback complete
Global Const DL_PLAYCMPLT = DL_PLAYBACK ' duplicate name for driver
Global Const DL_DIAL = &H5            ' dial complete
Global Const DL_BEEP = &HA            ' beep complete

Global Const DL_COMTEST = &HB         ' communication test
Global Const DL_ACK = &HC             ' communication test acknowledgement

Global Const DL_CST = &H6             ' call status transition

Global Const DL_ERROR = &H9           ' PC to DIALOG/4X command error

Global Const DL_MTST = &HD            ' memory test complete

'
'New equates for Dialog/4x to PC command codes supported by firmware ver.60.
'The following messages are always enabled.
 
Global Const DL_RPTBUF = &H15         ' digit buffer count
Global Const DL_GETDIGITS = &H10      ' get digits complete
Global Const DL_UPDPARM = &H16        ' update of parameters complete
Global Const DL_GETPARM = &H13        ' current parameters
Global Const DL_WINK = &H17           ' wink complete
Global Const DL_TIMER = &H11          ' timer reached zero
Global Const DL_WATCHDOG1 = &H12      ' 1st watchdog timeout
Global Const DL_WATCHDOG2 = &H14      ' 2nd watchdog timeout

Global Const MAXDLCMD = &H17          ' maximum number of DIALOG/4X commands

'
'Special equates for new Dialog/4x to PC command codes to replace certain
'CST event flavors.
 
Global Const DL_OFFHOOKC = &H30       ' offhook complete
Global Const DL_ONHOOKC = &H31        ' onhook complete
Global Const DL_CALL = &H32           ' call analysis complete

'
'Special equates for simulated Dialog/4x to PC command codes to support
'driver handling of play and record.
 
Global Const DL_BUFEMPTY = &H40       ' virtual buffer empty
Global Const DL_BUFFULL = &H41        ' virtual buffer full

'
'Equates for PC to Dialog/4x command codes.
'The following commands do not cause the board to send a DL reply msg.
 
Global Const PC_SETIEN = &H7          ' set the interrupt enable mask
Global Const PC_SETRINGS = &H5        ' set number of rings for cst event
Global Const PC_PULSE = &HB           ' enable pulse digit collection

'
'Equates for PC to Dialog/4x command codes.
'The following commands cause the board to send a DL reply msg.
 
Global Const PC_RECORD = &H1          ' place channel in record mode
Global Const PC_PLAYBACK = &H2        ' place channel in playback mode
Global Const PC_DIAL = &H6            ' dial ASCIIZ string in buf0
Global Const PC_BEEP = &H8            ' start beeping

Global Const PC_COMTEST = &H9         ' communication test
Global Const PC_ACK = &HA             ' communication test response

Global Const PC_OFFHOOK = &H4         ' place channel offhook
Global Const PC_ONHOOK = &H3          ' place channel onhook

Global Const PC_STOP = &H0            ' stop operation in progress

'
'New equates for PC to Dialog/4x command codes supported by firmware ver.60.
'The following commands do not cause the board to send a DL reply msg.
 
Global Const PC_SETTERMS = &H14       ' set terminating conditions
Global Const PC_CLRHIST = &H19        ' clear termination history
Global Const PC_INITBUF = &H10        ' initialize digit buffer
Global Const PC_CLRBUF = &H11         ' clear digit buffer

'
'New equates for PC to Dialog/4x command codes supported by firmware ver.60.
'The following commands cause the board to send a DL reply msg.
 
Global Const PC_RPTBUF = &H12         ' report digit buffer count
Global Const PC_GETDIGITS = &H13      ' get digits
Global Const PC_UPDPARM = &H17        ' update parameters
Global Const PC_GETPARM = &H18        ' get current parameters
Global Const PC_WINK = &H1A           ' initiate a wink command
Global Const PC_TIMER = &H15          ' start timer
Global Const PC_WATCHDOG = &H16       ' start watchdog

Global Const MAXPCCMD = &H1A          ' maximum number of PC commands

'
'Equates for PC to Dialog/4x at boot up time.
 
Global Const REQ_RESET = &HFF         ' clear, reset and go

Global Const REQ_MTST = &HFE          ' do the memory test and stop

'
'Call status transition data equates.
'The following CST's are enabled by the set_IEN command.
 
Global Const CST_OFFHOOK = &H1        ' offhook transition complete
Global Const CST_HOOK_DONE = CST_OFFHOOK ' duplicate name for driver
Global Const CST_ONHOOK = &H6         ' onhook transition complete
Global Const CST_ONH_DONE = CST_ONHOOK ' duplicate name for driver
Global Const CST_RINGS = &H2          ' rings received
Global Const CST_WINKRCVD = &HE       ' wink received
Global Const CST_RNGOFF = &HF         ' ring off messages

Global Const CST_LCOFF = &H3          ' loop current off
Global Const CST_LCON = &HD           ' loop current on
Global Const CST_LCREV = &H20         ' loop current reversal
Global Const CST_SILENCEOFF = &H4     ' silence off
Global Const CST_SILENCEON = &H5      ' silence on

'
'Call status transition data equates.
'The following CST's are always enabled.
 
Global Const CST_BUSY = &H7            ' line busy  (call analysis)
Global Const CST_NOANS = &H8           ' no answer (call analysis)
Global Const CST_NORB = &H9            ' no ringback (call analysis)
Global Const CST_CNCT = &HA            ' call connected (call analysis)
Global Const CST_CEPT = &HB            ' operator intercept (call analysis)
Global Const CST_STOPD = &HC           ' call analysis stopped (call analysis)
Global Const CST_NO_DIALTONE = &H11
Global Const CST_FAXTONE = &H12

'
'Interrupt enable(IEN) bits, if bit is 1(on) then int is enabled, 0 is
'disabled for set_ien message.
'The following bits enable DL reply messages.
 
Global Const IEN_BUFEMPTY = &H1       ' enable buffer empty messages
Global Const IEN_BUFFULL = &H2        ' enable buffer full messages

'
'Interrupt enable(IEN) bits, if bit is 1(on) then int is enabled, 0 is
'disabled for set_ien message.
'The following bits enable flavors of the DL_CST message.
 
Global Const IEN_OFFHOOK = &H20       ' enable offhook complete messages
Global Const IEN_ONHOOK = &H100       ' enable onhook complete messages
Global Const IEN_RINGS = &H10         ' enable rings received messages
Global Const IEN_WINKRCVD = &H800     ' enable wink received messages
Global Const IEN_RNGOFF = &H1000      ' enable ring off messages

Global Const IEN_LCOFF = &H8          ' enable loop current drop messages
Global Const IEN_LCON = &H400         ' enable loop current on messages
Global Const IEN_LCREV = &H1000       ' enable loop current reversal messages
Global Const IEN_SILENCEOFF = &H80    ' enable silence off messages
Global Const IEN_SILENCEON = &H40     ' enable silence on messages

'
'Interrupt enable(IEN) bits, if bit is 1(on) then int is enabled, 0 is
'disabled for set_ien message.
'The following bit has no effect on DL reply messages.
 
Global Const IEN_DTMF = &H4           ' enable DTMF digit collection

'
'pdd reception type - data value for PC_PULSE message
 
Global Const PDD_OFF = &H0            ' turn pulse digit detect off
Global Const PDD_ON = &H1             ' turn pulse digit detect on

'
'Set digit type in the DL_DIGITRDY (digit ready) message.
 
Global Const DG_DTMF = &H0             ' DTMF Digit
Global Const DG_LPD = &H1              ' Loop Pulse Digit
Global Const DG_DPD = &H2              ' Dial Pulse Digit
Global Const DG_APD = &H2              ' Audio Pulse Digit
Global Const DG_MF = &H3               ' MF Digit

Global Const DM_DTMF = 1                ' (1 << DG_DTMF)
Global Const DM_LPD = 2                 ' (1 << DG_LPD)
Global Const DM_APD = 4                 ' (1 << DG_APD)
Global Const DM_MF = 8                  ' (1 << DG_MF)
Global Const DM_DPD = &H10              ' Enable DPD detection
Global Const DM_DPDZ = &H20             ' Enable Zero-Trained DPD Detection

'
'Record complete reason codes
 
Global Const RCR_STOP = &H2           ' record stopped
Global Const RCR_DTMF = &H3           ' record terminated by DTMF

'
'Play complete reason codes
 
Global Const PCR_MAXBYTE = &H1        ' playback reached maximum bytes
Global Const PCR_STOP = &H2           ' playbacked stopped
Global Const PCR_DTMF = &H3           ' playback terminated by DTMF

'
'Beep complete reason codes
 
Global Const BCR_MAXCNT = &H1         ' beep reached maximum repetions
Global Const BCR_STOP = &H2           ' beep stopped
Global Const BCR_DTMF = &H3           ' beep terminated by DTMF

'
'Record type codes - this field is bitmapped
 
Global Const RT_SIMARK = &H1          ' mark silence start/stop events
Global Const RT_TTINIT = &H2          ' initiate record with DTMF
Global Const RT_TTTERM = &H4          ' terminate record with DTMF
Global Const RT_TDTONE = &H8          ' play tone before record initiation
Global Const RT_INITSET = &H110       ' touch tone initiation set

'
'Playback type codes - this field is bitmapped
 
Global Const PT_TTINIT = &H2          ' initiate playback with DTMF
Global Const PT_TTTERM = &H4          ' terminate playback with DTMF
Global Const PT_TDTONE = &H8          ' play tone before playback initiation
Global Const PT_INITSET = &H110       ' touch tone initiation set

'
'Beep type codes - this field is bitmapped
 
Global Const BT_TTINIT = &H2          ' initiate beep with DTMF
Global Const BT_TTTERM = &H4          ' terminate beep with DTMF

'
'DTMF initiator bit masks used in dl_dtinit#
 
Global Const DM_D = &H1               ' DTMF d
Global Const DM_1 = &H2               ' DTMF 1
Global Const DM_2 = &H4               ' DTMF 2
Global Const DM_3 = &H8               ' DTMF 3
Global Const DM_4 = &H10              ' DTMF 4
Global Const DM_5 = &H20              ' DTMF 5
Global Const DM_6 = &H40              ' DTMF 6
Global Const DM_7 = &H80              ' DTMF 7
Global Const DM_8 = &H100             ' DTMF 8
Global Const DM_9 = &H200             ' DTMF 9
Global Const DM_0 = &H400             ' DTMF 0
Global Const DM_STAR = &H800          ' DTMF'
Global Const DM_POUND = &H11000       ' DTMF #
Global Const DM_A = &H22000           ' DTMF a
Global Const DM_B = &H44000           ' DTMF b
Global Const DM_C = &H88000           ' DTMF c

'
'DTMF flags (see dl_dflags) - the edge on which to send DTMF ready message
 
Global Const DF_MKBK1 = &H1           ' for channel 1
Global Const DF_MKBK2 = &H2           ' for channel 2
Global Const DF_MKBK3 = &H4           ' for channel 3
Global Const DF_MKBK4 = &H8           ' for channel 4

'
'Flag for operator intercept part of call progress
 
Global Const OPTEN = &H1              ' enable operator intercept w/connect
Global Const OPTDIS = &H2             ' disable operator intercept
Global Const OPTCON = &H3             ' enable operator intercept w/o connect

Global Const H_REDGE = &H1            ' rising edge detection of "hello"
Global Const H_FEDGE = &H2            ' falling edge detection of "hello"

Global Const ANSRDIS = &HFFFF         ' disable answer deglitching

Global Const DLPRODA = 0              ' an A series D/4x
Global Const DLPRODB = 11             ' a B series D/4x

'
'Success or failure indicators of update parameters function
 
Global Const UPD_OK = 0               ' parameters updated successfully
Global Const UPD_FAIL = 11            ' parameters not updated successfully

'
'ROM type definition bit masked
 
Global Const ROM_CCITT = 11           ' CCITT dial table used for DTMF dialing


'FILE: dxcallp.bas

Global Const DX_CALLP = 1               ' Turn on Call Analysis

'Defines for Call Analysis modes ( ca_intflg field )
 
Global Const DX_OPTEN = 1               ' Enable Operator Intercept with Connect
Global Const DX_OPTDIS = 2              ' Disable Operator Intercept
Global Const DX_OPTNOCON = 3            ' Enable Operator Intercept w/o Connect
Global Const DX_PVDENABLE = 4           ' Enable PVD
Global Const DX_PVDOPTEN = 5            ' Enable PVD with OPTEN
Global Const DX_PVDOPTNOCON = 6         ' Enable PVD with OPTNOCON
Global Const DX_PAMDENABLE = 7          ' Enable PAMD
Global Const DX_PAMDOPTEN = 8           ' Enable PAMD with OPTEN

'Call Analysis termination type.
 
Global Const CR_BUSY = 7                     ' Line busy
Global Const CR_NOANS = 8                    ' No answer
Global Const CR_NORB = 9                     ' No ringback
Global Const CR_CNCT = 10                    ' Call connected
Global Const CR_CEPT = 11                    ' Operator intercept
Global Const CR_STOPD = 12                   ' Call analysis stopped
Global Const CR_NODIALTONE = 17              ' No dialtone detected
Global Const CR_FAXTONE = 18                 ' Fax tone detected
Global Const CR_ERROR = &H100                ' Call analysis error

'Tone ID types
 
Global Const TID_FIRST = 250
Global Const TID_DIAL_LCL = 250
Global Const TID_DIAL_INTL = 251
Global Const TID_DIAL_XTRA = 252
Global Const TID_BUSY1 = 253
Global Const TID_RNGBK1 = 254
Global Const TID_BUSY2 = 255
Global Const TID_RNGBK2 = 256
Global Const TID_DISCONNECT = 257
Global Const TID_FAX1 = 258
Global Const TID_FAX2 = 259
Global Const TID_LAST = 259

'Call Analysis Errors as returned by ATDX_CPERROR()
 
Global Const CR_MEMERR = 1             ' Out of Memory when Creating Temporary SIT Tone Templates
Global Const CR_TMOUTON = 2            ' Timeout Waiting for SIT Tone
Global Const CR_TMOUTOFF = 3           ' SIT Tone too long
Global Const CR_UNEXPTN = 4            ' Unexpected SIT Tone
Global Const CR_MXFRQERR = 5           ' Invalid ca_maxtimefrq field in DX_CAP
Global Const CR_UPFRQERR = 6           ' Invalid Upper Frequency Selection
Global Const CR_LGTUERR = 7            ' Lower Freq. Greater than Upper Freq.
Global Const CR_OVRLPERR = 8           ' Overlap in Selected SIT Tones

'Connection types ( ATDX_CONNTYPE() )
 
Global Const CON_CAD = 1               ' Cadence Break
Global Const CON_LPC = 2               ' Loop Current Drop
Global Const CON_PVD = 3               ' Positive Voice Detect
Global Const CON_PAMD = 4              ' Positive Answering Machine Detect

'PAMD equates
 
Global Const PAMD_FULL = 1             ' FULL decision on PAMD
Global Const PAMD_QUICK = 2            ' QUICK decision on PAMD
Global Const PAMD_ACCU = 3             ' ACCURACY more important than speed (recommended)

Global Const PAMD_QUAL1TMP = 11 ' Qualification template 1 for PAMD
Global Const PAMD_QUAL2TMP = 12 ' Qualification template 1 for PAMD


'FILE: dxdigit.bas
'
'dx_getdig( ) related defines
 
Global Const LEN_DIGBUF = 31           ' Max # of entries for collecting DTMF
Global Const DG_MAXDIGS = LEN_DIGBUF   ' Max Digits Returned by dx_getdig()
Global Const DG_END = &HFF             ' Terminator for dg_type Array in DV_DIGIT

'
'Defines for Digit Control Mask.
 
Global Const D_DTMF = &H1              ' Enable DTMF detection
Global Const D_LPD = &H2               ' Enable Loop pulse detection
Global Const D_APD = &H4               ' Enable Audio pulse detection
Global Const D_MF = &H8                ' Enable MF digit detection
Global Const D_DPD = &H10              ' Enable DPD detection
Global Const D_DPDZ = &H20             ' Enable Zero-Trained DPD Detection


'       FILE: dxr2mf.txt

'Global Const __DXR2MF=_H__

'
'Group I Forward Signals
 
Global Const SIGI_1 = 101          ' Digit 1 ' Language digit - French
Global Const SIGI_2 = 102           ' Digit 2 ' Language digit - English
Global Const SIGI_3 = 103           ' Digit 3 ' Language digit - German
Global Const SIGI_4 = 104           ' Digit 4 ' Language digit - Russian
Global Const SIGI_5 = 105           ' Digit 5 ' Language digit - Spanish
Global Const SIGI_6 = 106           ' Digit 6 ' Spare (Language digit)
Global Const SIGI_7 = 107           ' Digit 7 ' Spare (Language digit)
Global Const SIGI_8 = 108           ' Digit 8 ' Spare (Language digit)
Global Const SIGI_9 = 109           ' Digit 9 ' Spare (Discriminating digit)
Global Const SIGI_10 = 110          ' Digit 0 ' Discriminating Digit
Global Const SIGI_11 = 111          ' Access to Incoming Operator (code 11) ' Outgoing Half-Echo Suppressor Required
Global Const SIGI_12 = 112          ' Access to Delay Operator (code 12) ' No Echo Suppressor Required
Global Const SIGI_13 = 113          ' Access to Test Equipment (code 13)
                                   '   Satellite Link not Included
                                   ' Test Call Indicator
Global Const SIGI_14 = 114          ' Incoming Half-Echo Suppressor Required;
                                   '   Satellite Link Included
                                   ' Outgoing Half-Echo Suppressor Inserted
Global Const SIGI_15 = 115          ' End of Pulsing (code 15);
                                   '   End of Identification
                                   ' Signal Not Used


'
'Group II Forward Signals
 
Global Const SIGII_1 = 101             ' National: Subsrciber without Priority
Global Const SIGII_2 = 102             ' National: Subsrciber with Priority
Global Const SIGII_3 = 103             ' National: Maintenance Equipment
Global Const SIGII_4 = 104             ' National: Spare
Global Const SIGII_5 = 105             ' National: Operator
Global Const SIGII_6 = 106             ' National: Data Transmission
Global Const SIGII_7 = 107             ' International: Subscriber, operator, or
                                      '  Maintenance equipment
                                      '  (without forward Transfer)
Global Const SIGII_8 = 108             ' International: Data Transmission
Global Const SIGII_9 = 109             ' International: Subscriber with Priority
Global Const SIGII_10 = 110            ' International: Operator with Forward
                                      '  Transfer Facility
Global Const SIGII_11 = 111            ' Spare for National Use
Global Const SIGII_12 = 112            ' Spare for National Use
Global Const SIGII_13 = 113            ' Spare for National Use
Global Const SIGII_14 = 114            ' Spare for National Use
Global Const SIGII_15 = 115            ' Spare for National Use

'
'Group A Backward Signals
 
Global Const SIGA_1 = 101           ' Send next Digit (n+1)
Global Const SIGA_2 = 102           ' Send Last but One Digit (n-1)
Global Const SIGA_3 = 103           ' Address Complete, change to Group B Signals
Global Const SIGA_4 = 104           ' Congestion in the National Network
Global Const SIGA_5 = 105           ' Send Calling Party's Category
Global Const SIGA_6 = 106           ' Address Complete; Charge; Set-Up Speech
Global Const SIGA_7 = 107           ' Send Last but Two Digit (n-2)
Global Const SIGA_8 = 108           ' Send Last but Three Digit (n-3)
Global Const SIGA_9 = 109           ' Spare for National Use
Global Const SIGA_10 = 110          ' Spare for National Use
Global Const SIGA_11 = 111          ' Send Country Code Indicator
Global Const SIGA_12 = 112          ' Send Language or Discriminating Digit
Global Const SIGA_13 = 113          ' Send Nature of Circuit(Satellite Link Only)
Global Const SIGA_14 = 114          ' Is an Incoming Half-Suppressor Required?
Global Const SIGA_15 = 115          ' Congestion in an International Exchange

'
'Group B Backward Signals
 
Global Const SIGB_1 = 101           ' Spare for National Use
Global Const SIGB_2 = 102           ' Send Special Information Tone
Global Const SIGB_3 = 103          ' Subscriber Line Busy
Global Const SIGB_4 = 104           ' Congestion Encountered after change
                                   '   to Group B
Global Const SIGB_5 = 105           ' Unallocated Number
Global Const SIGB_6 = 106           ' Subscriber line Free, Charge
Global Const SIGB_7 = 107           ' Subscriber line Free, No Charge
Global Const SIGB_8 = 108           ' Subscriber line out of Order
Global Const SIGB_9 = 109           ' Spare for National Use
Global Const SIGB_10 = 110          ' Spare for National Use
Global Const SIGB_11 = 111          ' Spare for National Use
Global Const SIGB_12 = 112          ' Spare for National Use
Global Const SIGB_13 = 113          ' Spare for National Use
Global Const SIGB_14 = 114          ' Spare for National Use
Global Const SIGB_15 = 115          ' Spare for National Use

'
'Socotel Confirmation Signals
 
Global Const SIGACK_1700 = 116
Global Const SIGACK_1900 = 117

'
'Miscellaneous Defines
 
Global Const R2_SIGNAL = 1
Global Const R2_BASEID = 101
Global Const R2_LASTID = 115
Global Const R2_ALLFSIG = 255
Global Const R2_DEFAMPL = -10
Global Const R2_DEFDUR = 1600

Global Const SOC_SIGNAL = 2
Global Const SOC_LASTID = 117
Global Const SOC_DEFAMPL = -9


'FILE: dxsync.bas

'
'       SYNC/ASYNC operation flags

Global Const EV_ASYNC = &H8000
Global Const EV_SYNC = &H0


'FILE: dxtables.bas
'
'Termination mask defines for use with ATDX_TERMMSK( )
 
Global Const TM_NORMTERM = &H0              ' Normal Termination
Global Const TM_MAXDTMF = &H1               ' Max Number of Digits Recd
Global Const TM_MAXSIL = &H2                ' Max Silence
Global Const TM_MAXNOSIL = &H4              ' Max Non-Silence
Global Const TM_LCOFF = &H8                 ' Loop Current Off
Global Const TM_IDDTIME = &H10              ' Inter Digit Delay
Global Const TM_MAXTIME = &H20              ' Max Function Time Exceeded
Global Const TM_DIGIT = &H40                ' Digit Mask or Digit Type Term.
Global Const TM_PATTERN = &H80              ' Pattern Match Silence Off
Global Const TM_USRSTOP = &H100             ' Function Stopped by User
Global Const TM_EOD = &H200                 ' End of Data Reached on Playback
Global Const TM_TONE = &H2000               ' Tone On/Off Termination
Global Const TM_ERROR = &H80000             ' I/O Device Error

Global Const IO_DEV = &H0                   ' play/record from a file
Global Const IO_MEM = &H8                   ' play/record from memory
Global Const IO_UIO = &H10                  ' play/record using user I/O functions

'Defines for the TPT
 
Global Const DX_MAXDTMF = 1                 ' Maximum Number of Digits Received
Global Const DX_MAXSIL = 2                  ' Maximum Silence
Global Const DX_MAXNOSIL = 3                ' Maximum Non-Silence
Global Const DX_LCOFF = 4                   ' Loop Current Off
Global Const DX_IDDTIME = 5                 ' Inter-Digit Delay
Global Const DX_MAXTIME = 6                 ' Function Time
Global Const DX_DIGMASK = 7                 ' Digit Mask Termination
Global Const DX_PMOFF = 8                   ' Pattern Match Silence On
Global Const DX_PMON = 9                    ' Pattern Match Silence Off
Global Const DX_DIGTYPE = 11                ' Digit Type Termination
Global Const DX_TONE = 12                   ' Tone On/Off Termination

'Defines for TPT Termination Flags
 
Global Const TF_EDGE = &H0
Global Const TF_LEVEL = &H1
Global Const TF_CLREND = &H2
Global Const TF_CLRBEG = &H4
Global Const TF_USE = &H8
Global Const TF_SETINIT = &H10
Global Const TF_10MS = &H20
Global Const TF_FIRST = TF_CLREND

Global Const TF_MAXDTMF = (TF_LEVEL Or TF_USE)
Global Const TF_MAXSIL = (TF_EDGE Or TF_USE)
Global Const TF_MAXNOSIL = (TF_EDGE Or TF_USE)
Global Const TF_LCOFF = (TF_LEVEL Or TF_USE Or TF_CLREND)
Global Const TF_IDDTIME = (TF_EDGE)
Global Const TF_MAXTIME = (TF_EDGE)
Global Const TF_DIGMASK = (TF_LEVEL)
Global Const TF_PMON = (TF_EDGE)
Global Const TF_DIGTYPE = (TF_LEVEL)
Global Const TF_TONE = (TF_LEVEL Or TF_USE Or TF_CLREND)

'Defines for the DV_TPT data for DX_TONE terminator
 
Global Const DX_TONEON = &H1
Global Const DX_TONEOFF = &H0


'       FILE: dxxxlib.bas
'
'Macros to get at the class and model parts of a device ID
 
'Global Const dl_devclass(i)  ((i) & &HFF00)
'Global Const dl_devmodel(i)  ((i) & &H00FF)

Global Const DEV_CLASS_VOICE = "Voice"

'
'Maximum terminator values.
 
Global Const MAX_TC_TIMER = 6000  ' Max time units for term. conditions

'
'Values for setting hook state
 
Global Const DL_ONHOOK = 0
Global Const DL_OFFHOOK = 1
Global Const DX_ONHOOK = 0
Global Const DX_OFFHOOK = 1

'
'       Define Event Types

Global Const TDX_PLAY = &H81           ' Play Completed
Global Const TDX_RECORD = &H82         ' Record Completed
Global Const TDX_GETDIG = &H83         ' Get Digits Completed
Global Const TDX_DIAL = &H84           ' Dial Completed
Global Const TDX_CALLP = &H85          ' Call Progress Completed
Global Const TDX_CST = &H86            ' CST Event Received
Global Const TDX_SETHOOK = &H87        ' SetHook Completed
Global Const TDX_WINK = &H88           ' Wink Completed
Global Const TDX_PLAYTONE = &H8A       ' Play Tone Completed
Global Const TDX_GETR2MF = &H8B        ' Get R2MF completed

Global Const TDX_ERROR = &H89          ' Error Event
Global Const DX_ATOMIC_ERR = &HEE      ' Error event for Atomic Funcs

'
'qDefine sendevt flag values

Global Const EVFL_SENDSELF = &H1       ' Send event to self process
Global Const EVFL_SENDOTHERS = &H2     ' Send event to other processes
Global Const EVFL_SENDALL = &H3        ' Send event to all processes

'
'Error codes returned by ATDV_LASTERR()
 
Global Const EDX_NOERROR = 0        ' No Errors
Global Const EDX_SYSTEM = 1         ' System Error
Global Const EDX_FWERROR = 2        ' Firmware Error
Global Const EDX_TIMEOUT = 3        ' Function Timed Out
Global Const EDX_BADIOTT = 4        ' Invalid Entry in the DX_IOTT
Global Const EDX_BADTPT = 5         ' Invalid Entry in the DX_TPT
Global Const EDX_BADPARM = 6        ' Invalid Parameter in Function Call
Global Const EDX_BADDEV = 7         ' Invalid Device Descriptor
Global Const EDX_BADPROD = 8        ' Func. Not Supported on this Board
Global Const EDX_BUSY = 9           ' Device is Already Busy
Global Const EDX_IDLE = 10          ' Device is Idle
Global Const EDX_STOPRINGS = 11     ' Stop waitrings (MT only)
Global Const EDX_BADWAVEFILE = 12   ' Bad/Unsupported WAV file
Global Const EDX_XPBPARM = 13       ' Bad XPB structure
Global Const EDX_NOSUPPORT = 14     ' Data format not supported
Global Const EDX_NOTIMP = 15        ' Function not implemented

'
'GTD Error Codes
 
Global Const EDX_TONEID = &H41      ' Bad Tone Template ID
Global Const EDX_MAXTMPLT = &H42    ' Max number of Templates Exists
Global Const EDX_INVSUBCMD = &H43   ' Invalid Sub Command Number
Global Const EDX_CHANNUM = &H44     ' Invalid Channel Number Specified
Global Const EDX_FREQDET = &H45     ' Invalid Freq Component Values
                                    ' in Tone Template Description
Global Const EDX_CADENCE = &H46     ' Invalid Cadence Component Values
                                    ' in Tone Template Description
Global Const EDX_ASCII = &H47       ' Invalid Ascii Value
                                    ' in Tone Template Description
Global Const EDX_DIGTYPE = &H48     ' Invalid Dig_Type Value
                                    ' in Tone Template Description
Global Const EDX_MSGSTATUS = &H49   ' Invalid Message Status Setting

'
'Speed and Volume Control Error Codes
 
Global Const EDX_SVADJBLKS = &H4A   ' Invalid Number of Speed/Volume
                                    ' Adjustment Blocks
Global Const EDX_SPDVOL = &H4B      ' Must Specify either SV_SPEEDTBL or
                                    ' SV_VOLUMETBL
Global Const EDX_SVMTSIZE = &H4C    ' Invalid Table Size Specified
Global Const EDX_SVMTRANGE = &H4D   ' An out of Range entry in DX_SVMT
Global Const EDX_NONZEROSIZE = &H4E ' Reset to Default was Requested but
                                    ' size was non-zero
'
'GTG Error Codes
 
Global Const EDX_FLAGGEN = &H4F     ' Invalid tg_dflag field in
                                    ' Tone Generation Template
Global Const EDX_FREQGEN = &H50     ' Invalid Frequency Component in
                                    ' Tone Generation Template
Global Const EDX_AMPLGEN = &H51     ' Invalid Amplitude Value in
                                    ' Tone Generation Template
'
'Switch Handler / SCSA  Error Codes
 
Global Const EDX_SH_CMDBLOCK = &H59   ' Blocking Command is in progress
Global Const EDX_SH_BADCMD = &H60     ' Command not supported
Global Const EDX_SH_LIBBSY = &H61     ' Switching Handler Lib is busy
Global Const EDX_SH_BADINDX = &H62    ' Invalid Switching Handler indx #
Global Const EDX_SH_LIBNOTINIT = &H63 ' Switching Handler Library has not been initialized
Global Const EDX_SH_NOCLK = &H64      ' Switching Handler Clock fallback failed
Global Const EDX_SH_MISSING = &H66    ' Switching Handler is not Present
Global Const EDX_SH_BADMODE = &H6A    ' Invalid Switching Handler Bus Mode
Global Const EDX_SH_BADLCLTS = &H6F   ' Invalid local timeslot (Channel)
Global Const EDX_SH_BADTYPE = &H70    ' Invalid local timeslot type
Global Const EDX_SH_BADEXTTS = &H71   ' External timeslot not supported at current clock rate
Global Const EDX_SH_LCLTSCNCT = &H72  ' Channel is already connected to SCbus
Global Const EDX_SH_LCLDSCNCT = &H73  ' Channel is already disconnected from SCbus

'
'Error Codes Specific to caller ID
 
Global Const EDX_CLIDINFO = &H80    ' caller ID info/sub-msg not available
Global Const EDX_CLIDBLK = &H81     ' caller ID private ('P') or blocked
Global Const EDX_CLIDOOA = &H82     ' caller ID out of area ('O')

'
'Error Codes Specific to PBXpert TSF loading
 
Global Const EDX_BADREGVALUE = &H90   ' Unable to locate value in registry
Global Const EDX_BADTSFFILE = &H91    ' Filename doesn't exist or not valid TSF
Global Const EDX_BADTSFDATA = &H92    ' TSF Data not consolidated
Global Const EDX_FEATUREDISABLED = &H93     ' TSF File Support Disabled
'
'Equates for generic caller ID message type IDs
 
Global Const CLIDINFO_CMPLT = &H100          ' complete caller ID message
Global Const CLIDINFO_GENERAL = &H101        ' date,time,phone #,name
Global Const CLIDINFO_CALLID = &H102         ' caller ID
Global Const CLIDINFO_FRAMETYPE = &H103      ' see frame type equates

'
'Equates for CLASS
 
Global Const CLASSFRAME_SDM = &H4        ' Single Data Message caller ID frame
Global Const CLASSFRAME_MDM = &H80       ' Multiple Data Message caller ID frame
' CLASS MDM message IDs
Global Const MCLASS_DATETIME = &H1       ' date and time w/o '/" & ':'
Global Const MCLASS_DN = &H2             ' calling line directory number
Global Const MCLASS_DDN = &H3            ' dialed number
Global Const MCLASS_ABSENCE1 = &H4       ' caller ID absence: 'O' or 'P'
Global Const MCLASS_REDIRECT = &H5       ' call frwd-universal,busy,or unanswered
Global Const MCLASS_QUALIFIER = &H6      ' 'L' for long distance
Global Const MCLASS_NAME = &H7           ' caller name
Global Const MCLASS_ABSENCE2 = &H8       ' name absence- 'O' or 'P'

'
'Equates for CLIP
 
Global Const CLIPFRAME_MDM = &H80        ' Multiple Data Message caller ID frame
' CLIP message IDs
Global Const CLIP_DATETIME = &H1         ' date and time (w/o '/" & ':')
Global Const CLIP_DN = &H2               ' calling line directory number
Global Const CLIP_DDN = &H3              ' dialed number
Global Const CLIP_ABSENCE1 = &H4         ' caller ID absence: 'O' or 'P'
Global Const CLIP_NAME = &H7             ' caller name
Global Const CLIP_ABSENCE2 = &H8         ' name absence- 'O' or 'P'
Global Const CLIP_CALLTYPE = &H11        ' voice call,rng-bck-when-free call or msg waiting call
Global Const CLIP_NETMSG = &H13          ' no. of message waiting

'
'Equates for A-CLIP
 
Global Const ACLIPFRAME_SDM = &H4        ' Single Data Message caller ID frame
Global Const ACLIPFRAME_MDM = &H80       ' Multiple Data Message caller ID frame
' A-CLIP MDM message IDs
Global Const MACLIP_DATETIME = &H1       ' date and time (w/o '/" & ':'
Global Const MACLIP_DN = &H2             ' calling line directory number
Global Const MACLIP_DDN = &H3            ' dialed number
Global Const MACLIP_ABSENCE1 = &H4       ' caller ID absence: 'O' or 'P'
Global Const MACLIP_REDIRECT = &H5       ' call frwd-universal,busy,or unanswered
Global Const MACLIP_QUALIFIER = &H6      ' 'L' for long distance
Global Const MACLIP_NAME = &H7           ' caller name
Global Const MACLIP_ABSENCE2 = &H8       ' name absence- 'O' or 'P'

'
'Defines for for channel state values
 
Global Const CS_IDLE = 1         ' Channel is idle
Global Const CS_PLAY = 2         ' Channel is playing back
Global Const CS_RECD = 3         ' Channel is recording
Global Const CS_DIAL = 4         ' Channel is dialing
Global Const CS_GTDIG = 5        ' Channel is getting digits
Global Const CS_TONE = 6         ' Channel is generating a tone
Global Const CS_STOPD = 7        ' Operation has terminated
Global Const CS_SENDFAX = 8      ' Channel is sending a fax
Global Const CS_RECVFAX = 9      ' Channel is receiving a fax
Global Const CS_CALL = 13        ' Channel is Call Progress Mode
Global Const CS_GETR2MF = 14     ' Channel is Getting R2MF

'
'This is a complex state composed of one of the
'above states and faxmode.
 
Global Const CS_FAXIO = 10       ' Channel is between fax pages

'
'Define a channel state for the remaining blocking commands
 
Global Const CS_HOOK = 11        ' A change in hookstate is in progress
Global Const CS_WINK = 12        ' A wink operation is in progress
Global Const CS_RINGS = 15       ' Call status Rings state

'
'D/4X Events and masks
 
Global Const DE_RINGS = 1        ' Rings received
Global Const DE_SILON = 2        ' Silence on
Global Const DE_SILOF = 3        ' Silenec off
Global Const DE_LCON = 4         ' Loop current on
Global Const DE_LCOF = 5         ' Loop current off
Global Const DE_WINK = 6         ' Wink received
Global Const DE_RNGOFF = 7       ' Ring off event
Global Const DE_DIGITS = 8       ' Digit Received
Global Const DE_DIGOFF = 9       ' Digit tone off event
Global Const DE_LCREV = 13       ' Loop current reversal
Global Const DE_TONEON = 17      ' Tone ON  Event Received
Global Const DE_TONEOFF = 18     ' Tone OFF Event Received
Global Const DE_STOPRINGS = 19   ' Stop ring detect state

' Alt. defines for DM_SILOF, DM_LCOF are DM_SILOFF and DM_LCOFF
'
'Event mask values
 
Global Const DM_RINGS = 1      ' ( 1 << (DE_RINGS - 1) )
Global Const DM_SILON = 2      ' ( 1 << (DE_SILON - 1) )
Global Const DM_SILOF = 4      ' ( 1 << (DE_SILOF - 1) )
Global Const DM_LCON = 8       ' ( 1 << (DE_LCON - 1) )
Global Const DM_LCOF = 16      ' ( 1 << (DE_LCOF - 1) )
Global Const DM_LCREV = 4096   ' ( 1 << (DE_LCREV - 1) )
Global Const DM_WINK = 32      ' ( 1 << (DE_WINK - 1) )
Global Const DM_RNGOFF = 64    ' ( 1 << (DE_RNGOFF - 1) )
Global Const DM_DIGITS = 128   ' ( 1 << (DE_DIGITS - 1) )
Global Const DM_DIGOFF = 256   ' ( 1 << (DE_DIGOFF - 1) )

'
'Termination reasons
 
Global Const T_NORML = 0         ' Normal termination
Global Const T_MXDIG = 1         ' Max. digits received
Global Const T_MXSIL = 2         ' Max. silence exceeded
Global Const T_MXNSIL = 3        ' Max. non-silence exceeded
Global Const T_LOOP = 4          ' Loop current drop
Global Const T_IDIG = 5          ' Max. inter-digit delay exceeded
Global Const T_MXSEC = 6         ' Max. time elapsed
Global Const T_TDIG = 7          ' Terminating digit received
Global Const T_PATRN = 8         ' Pattern match detected
Global Const T_STOP = 9          ' Stopped by user
Global Const T_EOD = 10          ' End of data on playback
Global Const T_ERR = 13          ' I/O device error

'
'Masked DTMF termination/initiation equates
 
Global Const DM_D = &H1              ' Mask for DTMF d.
Global Const DM_1 = &H2              ' Mask for DTMF 1.
Global Const DM_2 = &H4              ' Mask for DTMF 2.
Global Const DM_3 = &H8              ' Mask for DTMF 3.
Global Const DM_4 = &H10             ' Mask for DTMF 4.
Global Const DM_5 = &H20             ' Mask for DTMF 5.
Global Const DM_6 = &H40             ' Mask for DTMF 6.
Global Const DM_7 = &H80             ' Mask for DTMF 7.
Global Const DM_8 = &H100            ' Mask for DTMF 8.
Global Const DM_9 = &H200            ' Mask for DTMF 9.
Global Const DM_0 = &H400            ' Mask for DTMF 0.
Global Const DM_S = &H800            ' Mask for DTMF *.
Global Const DM_P = &H1000           ' Mask for DTMF #.
Global Const DM_A = &H2000           ' Mask for DTMF a.
Global Const DM_B = &H4000           ' Mask for DTMF b.
Global Const DM_C = &H8000           ' Mask for DTMF c.

'
'Macros to get the parts out of a parameter ID
 
'Global Const parmtype(id) (((id) >> 8) & &HF)   ' High byte, lo nibble
'Global Const parmnumb(id) (((id) & &HFF) - 1)   ' Low byte

'
'D/4x Parameter Type Equates
 
Global Const PT_BD = 0            ' Board parameter
Global Const PT_CH = 1            ' Channel parameter

'
'Defines used by the parameter functions
 
Global Const PM_BD = &H800000           ' Board Level Parameter
Global Const PM_CH = &H0                ' Channel Level Parameter

Global Const PM_DXXX = &H0              ' D/xxx Parameter
Global Const PM_D12X = &H1000000        ' D/12x Parameter
Global Const PM_MF40 = &H2000000        ' MF/40 Parameter
Global Const PM_D12XDEV = &H4000000

Global Const PM_FW = &H0                ' Firmware Parameter
Global Const PM_DRV = &H8000000         ' Driver Parameter
Global Const PM_LIB = &H10000000        ' Library Parameter

Global Const PRM_DEST = &H18000000
Global Const PRM_DEVTYP = &H7000000
Global Const PRM_DATTYP = &HE0000000
Global Const PRM_NUM = &HFFFF
Global Const PRM_TERM = &H7F0000

Global Const PM_BYTE = &H0              ' Byte
Global Const PM_SHORT = &H20000000      ' Short
Global Const PM_INT = &H40000000        ' Int
Global Const PM_LONG = &H60000000       ' Long
Global Const PM_VLSTR = &H80000000      ' Variable Length String
Global Const PM_FLSTR = &HA0000000      ' Fixed Length String

Global Const PM_VLSTR_MAXLEN = 128 ' Max Length for Variable Length Parms

'
'CHANNEL PARAMETERS
 
' DTMF anti-talkoff during playback
Global Const DXCH_DTMFTLK = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H101)

' DTMF debounce time
Global Const DXCH_DTMFDEB = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H201)

' DTMF initiation bitmap
Global Const DXCH_DTINITSET = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H203)

' Delay after ring recvd before winking
Global Const DXCH_WINKDLY = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H204)

' Duration of wink (off-hook state)
Global Const DXCH_WINKLEN = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H205)

' Min LC on to be recognized as wink
Global Const DXCH_MINRWINK = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H206)

' Max LC on to be recognized as wink
Global Const DXCH_MAXRWINK = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H207)

' Length of DTMF digit for dialing
Global Const DXCH_TTDATA = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H208)

' Length of TT inter digit delay
Global Const DXCH_T_IDD = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H209)

' MF detection mask
Global Const DXCH_MFMODE = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H201)

' Diagnostic mask
Global Const DXCH_MFDIAG = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H202)

' Per channel dig rate: play (D/xxx only)
Global Const DXCH_PLAYDRATE = ((PM_SHORT Or PM_FW Or PM_D12X Or PM_CH) Or &HE01)

' Per channel dig rate: rec (D/xxx only)
Global Const DXCH_RECRDRATE = ((PM_SHORT Or PM_FW Or PM_D12X Or PM_CH) Or &HE02)

' DTMF detection edge select
Global Const DXCH_DFLAGS = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &H801)

' Per channel ring count
Global Const DXCH_RINGCNT = ((PM_SHORT Or PM_DRV Or PM_DXXX Or PM_CH) Or &H1)

' Enable/disable Caller ID
Global Const DXCH_CALLID = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &HE04)

' Enable/disable Caller ID values
Global Const DX_CALLIDDISABLE = &H0       ' Disable Caller ID
Global Const DX_CALLIDENABLE = &H1        ' Enable Caller ID

' Enable/disable Audio line-in
Global Const DXCH_AUDIOLINEIN = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_CH) Or &HE05)

' Enable/disable Audio line-in values
Global Const DX_LINEINDISABLE = &H0       ' Disable audio line-in connection
Global Const DX_LINEINENABLE = &H1        ' Enable audio line-in connection

' DTMF Digit buffering mode
Global Const DXCH_DIGBUFMODE = ((PM_SHORT Or PM_LIB Or PM_DXXX Or PM_CH) Or &H2)

' DTMF Digit buffering modes
Global Const DX_DIGCYCLIC = 1      ' Cyclic shift digits once buffer is full
Global Const DX_DIGTRUNC = 2       ' Truncate digits once buffer is full

'
'Board Parameters
 
' Flash character in dial string
Global Const DXBD_FLASHCHR = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H301)

' Init delay time
Global Const DXBD_INITDLY = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H302)

' Min time of LC on for LPD
Global Const DXBD_MINPDON = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H303)

' Min time of LC off for LPD
Global Const DXBD_MINPDOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H304)

' Length of DTMF digit for dialing
Global Const DXBD_TTDATA = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H305)

' Min time of silence on for APD
Global Const DXBD_MINSLON = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H306)

' Min time for silence off for APD
Global Const DXBD_MINSLOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H307)

' Min time for dti signal on
Global Const DXBD_MINTION = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H308)

' Min time for dti signal off
Global Const DXBD_MINTIOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H309)

' Edge of ring detection
Global Const DXBD_R_EDGE = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H30A)

' Flash time during dialing
Global Const DXBD_FLASHTM = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H401)

' Pause time during dialing
Global Const DXBD_PAUSETM = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H402)

' Minimum off-hook time
Global Const DXBD_MINOFFHKTM = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H403)

' Length of pulse dialing make
Global Const DXBD_P_MK = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H404)

' Length of pulse dialing break
Global Const DXBD_P_BK = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H405)

' Length of pulse inter digit delay
Global Const DXBD_P_IDD = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H406)

' Length of TT inter digit delay
Global Const DXBD_T_IDD = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H407)

' Delay before offhook finished
Global Const DXBD_OFFHDLY = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H408)

' Min time for ring detection
Global Const DXBD_R_ON = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H409)

' Min time for for the end of a ring
Global Const DXBD_R_OFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40A)

' Max wait between rings
Global Const DXBD_R_IRD = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40B)

' Silence on and off debounce time
Global Const DXBD_S_BNC = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40C)

' Min interpulse digit time for LPD
Global Const DXBD_MINIPD = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40D)

' Min time of lc off before message
Global Const DXBD_MINLCOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40E)

' Max time for lc off for LPD
Global Const DXBD_MAXPDOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H40F)

' Min time for silence on for APD
Global Const DXBD_MINISL = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H410)

' Max time for silence off for  APD
Global Const DXBD_MAXSLOFF = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H411)

' Either a D/40 or D/41
Global Const DXBD_HWTYPE = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H601)

' Number of channels on board
Global Const DXBD_CHNUM = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H602)

' System configuration
Global Const DXBD_SYSCFG = ((PM_SHORT Or PM_FW Or PM_DXXX Or PM_BD) Or &H604)

'
'NOTE: Must use PM_CH instead of PM_BD on MF40 paramters.
 
' Min time for MF detection
Global Const DXBD_MFMINON = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H101)

' Duration of MF tone during dial
Global Const DXBD_MFTONE = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H102)

' Inter-digit delay during MF dialing
Global Const DXBD_MFDELAY = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H103)

' Duration of LKP tone during MF dialing
Global Const DXBD_MFLKPTONE = ((PM_SHORT Or PM_FW Or PM_MF40 Or PM_CH) Or &H104)

'
'Board Parameter values
 
'
'When a rings received message is sent (BD_R_EDGE)
 
Global Const ET_RON = 1        ' At the beginning of the ring
Global Const ET_ROFF = 2       ' At the end of the ring

'
'Channel Mode values
 
Global Const MD_ADPCM = &H0          ' ADPCM data (the default)
Global Const MD_PCM = &H100          ' Mu-Law PCM data
Global Const MD_GAIN = &H0           ' AGC on
Global Const MD_NOGAIN = &H1000      ' AGC off
Global Const PM_TONE = &H1           ' Tone initiated play/record
Global Const RM_TONE = PM_TONE
Global Const PM_SR6 = &H2000         ' 6KHz sampling rate (digitization)
Global Const PM_SR8 = &H4000         ' 8KHz sampling rate (digitization)
Global Const RM_SR6 = PM_SR6
Global Const RM_SR8 = PM_SR8
Global Const PM_ALAW = &H20          ' Play A-Law data
Global Const RM_ALAW = PM_ALAW       ' Record data using A-Law
Global Const PM_DTINIT = &H2         ' Play with DTMF init
Global Const RM_DTINIT = PM_DTINIT ' Record with DTMF init
Global Const PM_DTINITSET = &H10 Or PM_DTINIT    ' Play with DTMF init set
Global Const RM_DTINITSET = PM_DTINITSET  ' Record with DTMF init set
Global Const R2_COMPELDIG = &H400    ' R2MF Compelled signalling

'
'Channel modes for ADSI support
 
Global Const PM_RAW = &H200          ' Raw playback mode
Global Const PM_ADSI = &H80          ' ADSI playback mode
Global Const PM_ADSIALERT = PM_ADSI Or PM_DTINITSET Or PM_TONE

'
'Alternate defines for DE_SILOF, DM_SILOF, DE_LCOF, DM_LCOF
 
Global Const DE_SILOFF = DE_SILOF
Global Const DE_LCOFF = DE_LCOF
Global Const DM_SILOFF = DM_SILOF
Global Const DM_LCOFF = DM_LCOF

'
'Define's for Mode Checking
 
Global Const MD_SELECT = (MD_PCM)

Global Const EV_ASYNC = &H8000
Global Const EV_SYNC = &H0

'
'Raw Line Status Defines
 
Global Const RLS_SILENCE = &H80  ' Sil Bit in Raw Line Status
Global Const RLS_DTMF = &H40     ' DTMF Signal Bit in Raw Line Status
Global Const RLS_LCSENSE = &H20  ' Loop Current Sense Bit in Raw Line Status
Global Const RLS_RING = &H10     ' Ring Detect Bit in Raw Line Status
Global Const RLS_HOOK = &H8      ' Hook Switch Status Bit in Raw Line Status
Global Const RLS_RINGBK = &H4    ' Audible Ringback Detect Bit in Raw Line Status

'
'GTD Defines
 
Global Const DM_TONEON = &H1     ' Tone ON Mask
Global Const DM_TONEOFF = &H2    ' Tone OFF Mask

Global Const TONEALL = &HFFFF           ' Enable/Disable All Tone ID's

Global Const TN_SINGLE = 0       ' Single Tone
Global Const TN_DUAL = 1         ' Dual Tone

'
'Template Modes and Frequency for GTD
 
Global Const TN_FREQDEV = 5      ' Frequency Deviation

Global Const TN_CADENCE = &H1   ' Cadence Detection
Global Const TN_LEADING = &H2    ' Leading Edge Detection
Global Const TN_TRAILING = &H4   ' Trailing Edge Detection

'
'Digit Type Values for User-Defined Tone Templates for GTD
 
Global Const DG_USER1 = 5        ' User Defined Tone
Global Const DG_USER2 = 6        ' User Defined Tone
Global Const DG_USER3 = 7        ' User Defined Tone
Global Const DG_USER4 = 8        ' User Defined Tone
Global Const DG_USER5 = 9        ' User Defined Tone

'
'Ascii digit type returned in DV_DIGIT structure.
 
Global Const DG_DTMF_ASCII = &H30      ' DTMF Digit
Global Const DG_LPD_ASCII = &H31       ' Loop Pulse Digit
Global Const DG_APD_ASCII = &H32       ' Audio Pulse Digit
Global Const DG_DPD_ASCII = &H32       ' Dial Pulse Digit
Global Const DG_MF_ASCII = &H33        ' MF Digit

'
'Speed and Volume Control Defines

Global Const SV_SPEEDTBL = &H1         ' Modify Speed
Global Const SV_VOLUMETBL = &H2        ' Modify Volume

Global Const SV_ABSPOS = &H0           ' Absolute Position
Global Const SV_RELCURPOS = &H10       ' Relative to Current Position
Global Const SV_TOGGLE = &H20          ' Toggle

Global Const SV_WRAPMOD = &H10
Global Const SV_SETDEFAULT = &H20
Global Const SV_LEVEL = &H100
Global Const SV_BEGINPLAY = &H200

'
'Toggle Modes for Play Adjustment Conditions
 
Global Const SV_TOGORIGIN = &H0     ' Toggle Between Origin and Last
                                                                        ' Modified Position
Global Const SV_CURORIGIN = &H1     ' Reset Current Position to Origin
Global Const SV_CURLASTMOD = &H2    ' Reset Current Position to Last
                                                                        ' Modified Position
Global Const SV_RESETORIG = &H3     ' Reset Current Position and Last
                                                                        ' Modified State to Origin
'
'Defines for dx_addspddig()
 
Global Const SV_ADD10PCT = 1     ' Speed up Play-Back 10 Percent
Global Const SV_ADD20PCT = 2     ' Speed up Play-Back 20 Percent
Global Const SV_ADD30PCT = 3     ' Speed up Play-Back 30 Percent
Global Const SV_ADD40PCT = 4     ' Speed up Play-Back 40 Percent
Global Const SV_ADD50PCT = 5     ' Speed up Play-Back 50 Percent
Global Const SV_SUB10PCT = -1    ' Slow Down Play-Back 10 Percent
Global Const SV_SUB20PCT = -2    ' Slow Down Play-Back 20 Percent
Global Const SV_SUB30PCT = -3    ' Slow Down Play-Back 30 Percent
Global Const SV_SUB40PCT = -4    ' Slow Down Play-Back 40 Percent

Global Const SV_NORMAL = &HFF    ' Set Play-Back to Normal Speed/Volume

'
'Defines for dx_addvoldig()
 
Global Const SV_ADD2DB = 1       ' Increase Play-Back Volume by 2db
Global Const SV_ADD4DB = 2       ' Increase Play-Back Volume by 4db
Global Const SV_ADD6DB = 3       ' Increase Play-Back Volume by 6db
Global Const SV_ADD8DB = 4       ' Increase Play-Back Volume by 8db
Global Const SV_SUB2DB = -1      ' Decrease Play-Back Volume by 2db
Global Const SV_SUB4DB = -2      ' Decrease Play-Back Volume by 4db
Global Const SV_SUB6DB = -3      ' Decrease Play-Back Volume by 6db
Global Const SV_SUB8DB = -4      ' Decrease Play-Back Volume by 8db

Global Const IGNORESTATE = 1

'
'Wave file support defines
 
'
'File formats
 
Global Const FILE_FORMAT_VOX = 1       ' Dialogic VOX format
Global Const FILE_FORMAT_WAVE = 2      ' Microsoft Wave format

'
'Sampling rate
 
Global Const DRT_6KHZ = &H30           ' 6KHz
Global Const DRT_8KHZ = &H40           ' 8KHz
Global Const DRT_11KHZ = &H58          ' 11KHz

'
'Data format
 
Global Const DATA_FORMAT_DIALOGIC_ADPCM = &H1   ' OKI ADPCM
Global Const DATA_FORMAT_ALAW = &H3             ' alaw PCM
Global Const DATA_FORMAT_MULAW = &H7            ' mulaw PCM
Global Const DATA_FORMAT_PCM = &H8              ' PCM

'
'dx_gtsernum() subfunctions
 
Global Const GS_SN = &H0         ' return board serial number, 8 bytes ASCIIZ string
Global Const GS_SSN = &H1        ' return board silicon serial number, 8 bytes

'
'Value defines
 
' device family
Global Const CT_DFD41E = &H2
Global Const CT_DFSPAN = &H3
Global Const CT_DFMSI = &H4

' device mode
Global Const CT_DMNETWORK = &H0
Global Const CT_DMRESOURCE = &H1

' network type
Global Const CT_NTNONE = &H0
Global Const CT_NTT1 = &H1
Global Const CT_NTE1 = &H2
Global Const CT_NTANALOG = &H3
Global Const CT_NTMSI = &H4

' bus mode
Global Const CT_BMPEB = &H0
Global Const CT_BMSCBUS = &H1

' bus encoding
Global Const CT_BEULAW = &H0
Global Const CT_BEALAW = &H1


'FILE: srllib.bas - srllib global constants
 
Global Const AT_FAILURE = -1
Global Const AT_FAILUREP = Null

Global Const EDV_BADDESC = -1
Global Const EDV_NOERROR = 0

'Open Flags for devices
 
Global Const OF_DEFAULT = &H0           ' Open device without automatic notification
Global Const O_NOTIFY = &H1             ' Open device with automatic notification

'General Defines
 
Global Const EV_ANYEVT = &HFFFF         ' Matches Any Event Type
Global Const EV_ANYDEV = -1             ' Matches Any Device
Global Const SR_DFLT_DATASIZE = 48      ' Max size for SRl's statically allocated
                                        ' event data area
'EVENT MANAGEMENT
 
Global Const SR_INTERPOLLID = &H1       ' Parameter id for inter-poll delay
Global Const SR_MODEID = &H2            ' Set SRL running in signalling or DOS mode
Global Const SR_DATASZID = &H3          ' Parameter id for getting/setting SRL's
                                        ' preallocated event data memory size
Global Const SR_QSIZEID = &H4           ' Maximum size of SRL's internal event queue
Global Const SR_MODELTYPE = &H5         ' Set SRL model type (for NT only)

Global Const SR_POLLMODE = 0            ' Run SRL in polling mode
Global Const SR_SIGMODE = 1             ' Run SRL in signalling/interrupt mode
Global Const SRL_DEVICE = 0             ' The SRL device
Global Const SR_TMOUTEVT = 0            ' Timeout event - occurs on the SRL DEVICE

Global Const SR_STASYNC = 0             ' single threaded async model
Global Const SR_MTASYNC = 1             ' multithreaded asynchronous model
Global Const SR_MTSYNC = 2              ' multithreaded synchronous model

Global Const SR_NOTIFY_ON = 0           ' Turn on message notification
Global Const SR_NOTIFY_OFF = 1          ' Turn off message notification

' SRL errors

Global Const ESR_NOERR = 0              ' No SRL errors
Global Const ESR_SCAN = 1               ' SRL scanning function returned an error
Global Const ESR_PARMID = 2             ' Unknown parameter id
Global Const ESR_TMOUT = 3              ' Returned by ATDV_LASTERR( SRL_DEVICE ) when
                                        ' an SRL function timed out
Global Const ESR_SYS = 4                ' System error - consult errno
Global Const ESR_DATASZ = 5             ' Invalid size for default event data
                                        ' memory
Global Const ESR_QSIZE = 6              ' Illegal event queue size
Global Const ESR_NOHDLR = 7             ' No such handler
Global Const ESR_MODE = 8               ' Illegal mode for this operation
Global Const ESR_NOTIMP = 9             ' function not implemented

Global Const SR_TMOUT = -1              ' Returned by event scanning functions (e.g.
                                        ' sr_waitevt()) when they time out
                                        
' Defines for DLL modes (to be passed to the xx_libinit functions)

Global Const DLGC_ST = 0                ' Single threaded operation
Global Const DLGC_MT = 1                ' Multithreaded operation

Global Const EQ = "="


'FILE: srltpt.bas

Global Const IO_CONT = &H1                ' Next TPT is contiguous in memory
Global Const IO_LINK = &H2                ' Next TPT found thru tp_nextp ptr
Global Const IO_EOT = &H4                 ' End of the Termination Parameters

