⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc08a32.pas

📁 word是我们常用的
💻 PAS
字号:
unit tc08a32;

interface
uses Windows;
const
  MAX_CARD_NO = 16;
const
  MAX_CHANNEL_NO = 8 * MAX_CARD_NO;

const
  LEN_FILEPATH = 70;

  // the value of every card-type
const
  CARD_TYPE_T5_64 = 1;
const
  CARD_TYPE_T5_128 = 2;
const
  CARD_TYPE_T5_REC = 3;

const
  CARD_TYPE_T5_128_NT = 10;
const
  CARD_TYPE_T5_REC_NT = 11;
const
  CARD_TYPE_T5_ID_NT = 12;

const
  CHTYPE_USER = 0;
const
  CHTYPE_TRUNK = 1;
const
  CHTYPE_EMPTY = 2;
const
  CHTYPE_RECORD = 3;

const
  NODTMF = -1;
const
  DTMF_CODE_0 = 10;
const
  DTMF_CODE_1 = 1;
const
  DTMF_CODE_2 = 2;
const
  DTMF_CODE_3 = 3;
const
  DTMF_CODE_4 = 4;
const
  DTMF_CODE_5 = 5;
const
  DTMF_CODE_6 = 6;
const
  DTMF_CODE_7 = 7;
const
  DTMF_CODE_8 = 8;
const
  DTMF_CODE_9 = 9;
const
  DTMF_CODE_STAR = 11;
const
  DTMF_CODE_SHARP = 12;
const
  DTMF_CODE_A = 13;
const
  DTMF_CODE_B = 14;
const
  DTMF_CODE_C = 15;
const
  DTMF_CODE_D = 16;

const
  RECORD_CHECK = 01;
const
  PLAY_CHECK = 02;
const
  SEND_CHECK = 03;
const
  SEND_READY_CHECK = 04;

const
  R_BUSY = $21;
const
  R_OTHER = $20;

const
  S_NORESULT = $10;
const
  S_BUSY = $11;
const
  S_NOBODY = $13;
const
  S_CONNECT = $14;
const
  S_NOSIGNAL = $15;

const
  S_DIALSIG = $30;

const
  PACK_64KBPS = 0;
const
  PACK_32KBPS = 1;
const
  PACK_16KBPS = 2;
const
  PACK_8KBPS = 3;

  // NEW ADD for Feed and Signal

const
  SIG_STOP = 0;
const
  SIG_DIALTONE = 1;
const
  SIG_BUSY1 = 2;
const
  SIG_BUSY2 = 3;
const
  SIG_RINGBACK = 4;

const
  HANG_UP_FLAG_FALSE = 0;
const
  HANG_UP_FLAG_TRUE = 1;
const
  HANG_UP_FLAG_START = 2;
const
  HANG_UP_FLAG_PRESS_R = 3;

  // caller-ID
const
  ID_STEP_NONE = 0;
const
  ID_STEP_HEAD = 1;
const
  ID_STEP_ID = 2;
const
  ID_STEP_OK = 3;
const
  ID_STEP_FAIL = 4;
const
  ID_STEP_LEN = 5;

  // end of caller-ID

type
  TPD_RPB = record
    PlayFlag: WORD;
    RecordFlag: WORD;
    PlayCount: WORD;
    RecordCount: WORD;
    DtmfCount: WORD;
    DialFlag: WORD;
    SigCount: WORD;
    SigStartPoint: WORD;
    SigBuf: PChar;
  end;

type
  TPD_WPB = record
    Busy1Count1Low: BYTE;
    Busy1Count1High: BYTE;
    Busy1Count0Low: BYTE;
    Busy1Count0High: BYTE;

    BusySigCount: WORD;
    BusySigLen: WORD;

    SendReadyLen: WORD;

    SendBusy1Count1Low: BYTE;
    SendBusy1Count1High: BYTE;
    SendBusy1Count0Low: BYTE;
    SendBusy1Count0High: BYTE;

    SendSigCount1Low: BYTE;
    SendSigCount1High: BYTE;
    SendSigCount0Low: BYTE;
    SendSigCount0High: BYTE;

    SendNoSignalLen: WORD;

    MaxRingTimes: BYTE;
  end;

  //use play index file
type
  TPD_PIF = record
    FileName: array[0..99] of char;
    gHandle: array[0..99] of HFILE;
    FileCount: DWORD;
  end;

  //*******************************************
  //	define struct & type
  //********************************************/
type
  TC_INI_TYPE = record
    // get from "TC08A-V.INI"
    wCardNo: WORD;
    wCardType: WORD;
    wConnect: WORD;
    wIRQ: WORD;
    cbDir: array[0..LEN_FILEPATH - 1] of char;
    wAddress: array[0..MAX_CARD_NO] of WORD;

    // get from driver
    wMajorVer: WORD;
    wMinorVer: WORD;
    wChType: array[0..MAX_CHANNEL_NO] of WORD;
  end;

function LoadDRV(): LongInt; stdcall; far external 'Tc08a32.dll';
procedure FreeDRV(); stdcall; far external 'Tc08a32.dll';
procedure GetSysInfo(TmpIni: pointer); stdcall; far external 'Tc08a32.dll';
function CheckValidCh(): WORD; stdcall; far external 'Tc08a32.dll';
function CheckChType(wChnlNo: WORD): WORD; stdcall; far external 'Tc08a32.dll';
function CheckChTypeNew(wChnlNo: WORD): WORD; stdcall; far external
'Tc08a32.dll';
function IsSupportCallerID(): boolean; stdcall; far external 'Tc08a32.dll';
function EnableCard(wUsedCh: WORD; wFileBufLen: WORD): LONGINT; stdcall; far
external 'Tc08a32.dll';
procedure DisableCard(); stdcall; far external 'Tc08a32.dll';
function SetPackRate(pack: integer): Integer; stdcall; far external
'Tc08a32.dll';

procedure PUSH_PLAY(); stdcall; far external 'Tc08a32.dll';

function RingDetect(wChnlNo: WORD): BOOLEAN; stdcall; far external
'Tc08a32.dll';
function CheckPolarity(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function OffHook(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function HangUp(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';

function SetLink(one: integer; another: integer): Integer; stdcall; far external
'Tc08a32.dll';
function ClearLink(one: integer; another: integer): Integer; stdcall; far
external 'Tc08a32.dll';
function LinkOneToAnother(wOne: WORD; wAnother: WORD): LongInt; stdcall; far
external 'Tc08a32.dll';
function ClearOneFromAnother(wOne: WORD; wAnother: WORD): LongInt; stdcall; far
external 'Tc08a32.dll';
function LinkThree(wOne: WORD; wTwo: WORD; wThree: WORD): LongInt; stdcall; far
external 'Tc08a32.dll';
function ClearThree(wOne: WORD; wTwo: WORD; wThree: WORD): LongInt; stdcall; far
external 'Tc08a32.dll';

procedure InitDtmfBuf(wChnlNo: WORD); stdcall; far external 'Tc08a32.dll';
function GetDtmfCode(wChnlNo: WORD): Shortint; stdcall; far external
'Tc08a32.dll';
function DtmfHit(wChnlNo: WORD): boolean; stdcall; far external 'Tc08a32.dll';

//拨号检测
function Sig_Init(para: word): integer; stdcall; external 'Newsig.dll';
function Sig_StartDial(wChNo: word; DialNum: pchar; PreDialNum: pchar; wMode:
  word): integer; stdcall; external 'Newsig.dll';
function Sig_CheckDial(wChNo: word): integer; stdcall; external 'Newsig.dll';
procedure Sig_ResetCheck(wChNo: word); stdcall; external 'Newsig.dll';

function StartSigCheck(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function StopSigCheck(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function ReadCheckResult(chanelNo: integer; checkMode: integer): Integer;
stdcall; far external 'Tc08a32.dll';
function ReadBusyCount: Integer; stdcall; far external 'Tc08a32.dll';
function Sig_CheckBusy(chanelNo: integer): boolean; stdcall; far external
'newsig.dll';

function SetBusyPara(busylen: integer): Integer; stdcall; far external
'Tc08a32.dll';
function SetDialPara(ringBack1: integer; ringBack0: integer; busyLen: integer;
  ringTimes: integer): Integer; stdcall; far external 'Tc08a32.dll';
procedure ReadSigBuf(wChnlNo: WORD; pwStartPoint: pointer; pwCount: pointer;
  SigBuf: array of byte); stdcall; far external 'Tc08a32.dll';

function StopPlay(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function CheckPlayEnd(wChnlNo: WORD): BOOLEAN; stdcall; far external
'Tc08a32.dll';
procedure ReadStatus(wChnlNo: WORD; TmpRead: pointer); stdcall; far external
'Tc08a32.dll';

function StartPlayFile(wChnlNo: WORD; FileName: PCHAR; StartPos: LONGINT):
  BOOLEAN; stdcall; far external 'Tc08a32.dll';
procedure StopPlayFile(wChnlNo: WORD); stdcall; external 'Tc08a32.dll';
//文件索引放音
procedure RsetIndexPlayFile(chanelNo: integer); stdcall; far external
'Tc08a32.dll';
function AddIndexPlayFile(chanelNo: integer; filename: Pchar): Integer; stdcall;
far external 'Tc08a32.dll';
function StartIndexPlayFile(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function CheckIndexPlayFile(chanelNo: integer): integer; stdcall; far external
'Tc08a32.dll';
procedure StopIndexPlayFile(chanelNo: integer); stdcall; far external
'Tc08a32.dll';

procedure ResetIndex(); stdcall; far external 'Tc08a32.dll';
function SetIndex(VocBuf: PChar; dwVocLen: WORD): boolean; stdcall; far external
'Tc08a32.dll';
procedure StartPlayIndex(wChnlNo: WORD; pIndexTable: array of WORD; wIndexLen:
  WORD); stdcall; far external 'Tc08a32.dll';

function SendDtmfBuf(chanelNo: integer; dialNum: Pchar): Integer; stdcall; far
external 'Tc08a32.dll';
function CheckSendEnd(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';

function StopRecord(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function StartRecordFile(wChnlNo: WORD; FileName: PCHAR; dwRecordLen: LONGINT):
  BOOLEAN; stdcall; external 'Tc08a32.dll';
function CheckRecordEnd(wChnlNo: WORD): BOOLEAN; stdcall; external
'Tc08a32.dll';
procedure StopRecordFile(wChnlNo: WORD); stdcall; external 'Tc08a32.dll';

function FeedSigFunc: Integer; stdcall; far external 'Tc08a32.dll';
procedure StartTimer(wChnlNo: WORD; ClockType: WORD); stdcall; far external
'Tc08a32.dll';
function ElapseTime(wChnlNo: WORD; ClockType: WORD): LongInt; stdcall; far
external 'Tc08a32.dll';
function StartPlaySignal(chanelNo: integer; sigtype: integer): Integer; stdcall;
far external 'Tc08a32.dll';
function StartHangUpDetect(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function HangUpDetect(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
procedure FeedRing(wChnlNo: WORD); stdcall; far external 'Tc08a32.dll';
function FeedRealRing(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function FeedPower(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function OffHookDetect(chanelNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
function ReadGenerateSigBuf(lpfilename: Pchar): Integer; stdcall; far external
'Tc08a32.dll';
// caller-id
procedure ResetCallerIDBuffer(wChnlNo: WORD); stdcall; far external
'Tc08a32.dll';
function GetCallerIDRawStr(wChnlNo: WORD; IDRawStr: PChar): WORD; stdcall; far
external 'Tc08a32.dll';
function GetCallerIDStr(wChnlNo: WORD; IDStr: PChar): WORD; stdcall; far external
'Tc08a32.dll';

function StartRecordFileNew(wChnlNo: WORD; FileName: PChar; dwRecordLen: DWORD;
  dwRecordStartPos: DWORD): boolean; stdcall; far external 'Tc08a32.dll';
function NewReadPass(wCardNo: WORD): LongInt; stdcall; far external
'Tc08a32.dll';
//function CheckSilence(chanelNo: integer): Integer; stdcall; far external
//'Tc08a32.dll';

function SetSendPara(ToneLen: Integer; SilenceLen: Integer): Integer; stdcall;
far external 'Tc08a32.dll';
procedure NewSendDtmfBuf(ChannelNo: Integer; DialNum: PChar); stdcall; far
external 'Tc08a32.dll';
function NewCheckSendEnd(ChannelNo: Integer): Integer; stdcall; far external
'Tc08a32.dll';

function SetSigPara(AlNo: integer; clNo: integer): Integer; stdcall; far external
'Tc08a32.dll';
procedure StartPlay(wChnlNo: WORD; PlayBuf: PChar; dwStartPos: WORD; dwPlayLen:
  DWORD); stdcall; far external 'Tc08a32.dll';
  
implementation
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -