模拟通道的dial

上传人:子 文档编号:42003842 上传时间:2018-05-31 格式:DOC 页数:12 大小:37KB
返回 下载 相关 举报
模拟通道的dial_第1页
第1页 / 共12页
模拟通道的dial_第2页
第2页 / 共12页
模拟通道的dial_第3页
第3页 / 共12页
模拟通道的dial_第4页
第4页 / 共12页
模拟通道的dial_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《模拟通道的dial》由会员分享,可在线阅读,更多相关《模拟通道的dial(12页珍藏版)》请在金锄头文库上搜索。

1、模拟通道的模拟通道的 dialdialunit DialFunc;interfacetype APP_USER_STATE=(USER_IDLE,USER_DIAL_Auto,USER_WAIT_DIAL_TONE,USER_DIAL,USER_WAIT_RING_BACKTON,USER_WAIT_REMOTE_PICKUP,USER_TALKING,USER_WAIT_HANGUP);type TRUNK_CH_INFO=record /发起呼叫方InUse:Integer; /只是自己定义的状态,告诉别人而已,不实现程序状态真实改变DtmfBuf:array 0.250 of char;

2、end;type USER_CH_INFO=record /被呼叫方EnCalled:boolean;lineState:integer;nStep:APP_USER_STATE; /用了第一个的结构体nToTrkCh:Integer;pPhoNumBuf:array 0.50 of char;nTimeOut:Integer;end;/function myGetAnIdleChannel():Integer;function InitCtiBoard():boolean;procedure DrawTrunkChState;procedure DrawUserChState;procedu

3、re DoUserWork;procedure ExitCtiBoard;procedure GetVersion;/varnTotalCh:WORD;UserCh:array 0.99of USER_CH_INFO;TrunkCh:array 0.99 of TRUNK_CH_INFO;/implementationuses Shpa3api,Main,Windows, Messages, SysUtils, Classes, Graphics,Controls, Forms, Dialogs,ComCtrls, ExtCtrls;/procedure DoUserWork;varch:In

4、teger;i:Integer;PhoNumLen:Integer;/number:string;beginfor i:=0 to nTotalCh-1 dobeginif (SsmGetChType(i) tmpstr thenMainForm.TrunkChListView.Itemsnindex.SubItems0:=state;SsmGetDtmfStr(i,TrunkChi.DtmfBuf0);tmpstr:=MainForm.TrunkChListView.Itemsnindex.SubItems1;if tmpstr tmpstr thenMainForm.UserChListV

5、iew.Itemsnindex.SubItems0:=state;tmpstr:=MainForm.UserChListView.Itemsnindex.SubItems1;if UserChi.pPhoNumBuf 0 thenbeginGetMem(ErrMsg,200);SsmGetLastErrMsg(ErrMsg);Application.MessageBox(ErrMsg,错误, MB_OK) ;FreeMem(ErrMsg);InitCtiBoard:=false;Exit;end;nTotalCh := SsmGetMaxCh();for i:=0 to nTotalCh-1

6、dobeginUserChi.EnCalled := false;if( SsmGetChType(i) = 0 ) thenbeginSsmStartPickUpAnalyze(i);/SsmSetASDT(i, true);UserChi.pPhoNumBuf:=;UserChi.nStep := USER_IDLE;end;if( SsmGetAutoCallDirection(i,nDirection) = 1 ) then/AutoDial 任务启动后,通道的状态机开始自导能够进行区划呼叫接续beginif( nDirection = 1) or (nDirection = 2 )

7、thenbeginTrunkChi.InUse := 0;TrunkChi.DtmfBuf:=;/SsmSetMinVocDtrEnergy (i, 30000);UserChi.EnCalled := true;end;end;end;InitCtiBoard:=True;end;procedure ExitCtiBoard;beginSsmCloseCti();end;procedure GetVersion;beginend;function myGetAnIdleChannel():integer;vari:integer;beginfor i:=0 to nTotalCh-1 dobeginif( (TrunkChi.InUse = 0) and UserChi.EnCalled ) then break;end;/因 trunk 和 user 都用的 i 所以说两者在同一通道上通话if (i=nTotalCh) then myGetAnIdleChannel:=-1else myGetAnIdleChannel:=i;end;end.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号