?? djsscx.pas.bak
字號(hào):
begin
if Assigned(FOnDialError) then
FOnDialError(self,ChnlID,-1)
else
self.HangUp(ChnlID); //掛斷外線
end
end
else
begin
self.DialIn(ChnlID,ChannelIn.ChannelID);
end;
end;
end;
UserChannel:
begin
Caller := self.CheckDTMFNum(DTMFNum) ;
case Caller of
1: //呼叫外線
begin
//尋找外線,連接,結(jié)束
//尋找不到外線,放忙音,結(jié)束
InCallOut(ChnlID);
end;
2: //呼叫內(nèi)線
begin
Self.InCallIn(ChnlID,DTMFNum);
end;
-1:
begin
if Assigned(FOnDialError) then
FOnDialError(self,ChnlID,-1)
else
Self.HangUp(ChnlID);
end;
else
begin
end;
end;
end;
else
begin
end;
end;
end;
function TDjSSCx.InCallOut(ChnlID: integer): Integer;
var
ChannelIn:PChannel;
ChannelOut:PChannel;
begin
ChannelIn := ChannelList.Items[ChnlID];
ChannelOut := ChannelList.GetFreeTurnk;
if (Assigned(ChannelOut)) and (ChannelOut.State = idle) then
begin
tc08a32.OffHook(ChannelOut.ChannelID);
Result:= DjTc081.SetLink(ChannelOut.ChannelID,ChannelIn.ChannelID) ;
if Result = 0 then
begin
if Assigned(FOnLink) then
FOnLink(self,ChnlID,ChannelOut.ChannelID);
end;
ChannelIn.Step := 1001;
if Assigned(FOnCallOut) then
FOnCallOut(Self,ChnlID,-1);
end
else
begin
if Assigned(FOnCallBusy) then
FOnCallBusy(self,ChnlID,-1)
else
self.HangUp(ChnlID);
end;
end;
function TDjSSCx.InCallOut(Chnlid: integer; DTMFNum: String): integer;
var
Channel:PChannel ;
Channel2:PChannel;
begin
Channel := ChannelList.Items[ChnlID];
Channel2 := ChannelList.GetFreeTurnk ;
result := InCallOut(Channel,Channel2,DTMFNum);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.HangOff
作者: 姜亦文
日期: 2006.09.08
參數(shù): ChnlID: Integer 振鈴摘機(jī)坐席
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.HangOff(ChnlID: Integer);
var
Channel:PChannel ;
// i:integer;
begin
Channel := ChannelList.Items[ChnlID];
DjTc081.OffHook(Channel);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.OffHook
作者: 姜亦文
日期: 2006.09.08
參數(shù): ChnlID: Integer //內(nèi)線主動(dòng)摘機(jī)
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.OffHook(ChnlID: Integer);
var
Channel:PChannel ;
begin
Channel := ChannelList.Items[ChnlID];
DjTc081.OffHook(Channel);
end;
function TDjSSCx.InCallOut(Chnlid: integer; CallerPhone,
DTMFNum: String): integer;
var
Channel1,Channel2:pChannel;
begin
Channel1 := ChannelList.Items[ChnlID];
Channel2 := ChannelList.GetChannelFromPhone(CallerPhone);
Result := InCallOut(Channel1,Channel2,DTMFNum);
end;
function TDjSSCx.InCallOut(Channel1, Channel2: PChannel;
DialerPhone: string): integer;
begin
Channel1.ConnectChannel.ConState := OneConnect ;
Channel1.ConnectChannel.ConChnlId := Channel2.ChannelID ;
Channel1.ConnectChannel.CallActive := false;
Channel1.ConnectChannel.CallerPhone := '';
Channel1.ConnectChannel.Channeler := Channel2 ;
Channel1.Step := 1001 ;
Channel1.CallActor := CallerActor ;
//Channel2.State := Dailing ;
Channel2.Ringing := True ;
Channel2.ConnectChannel.ConState := OneConnect ;
Channel2.ConnectChannel.ConChnlId := Channel1.ChannelID;
Channel2.ConnectChannel.CallActive := False;
Channel2.ConnectChannel.CallerPhone := Channel1.Phone;
Channel2.ConnectChannel.Channeler := Channel1 ;
Channel2.CallActor := DialerActor ;
//Channel2.Step := 0 ;
Result := DjTc081.CallOut(Channel1,Channel2,DialerPhone);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.InCallIn
作者: 姜亦文
日期: 2006.09.11
參數(shù): ChnlID1, ChnlID2: integer 內(nèi)線呼叫內(nèi)線,內(nèi)線號(hào)碼為參數(shù)
返回值: integer
-------------------------------------------------------------------------------}
function TDjSSCx.InCallIn(ChnlID1, ChnlID2: integer): integer;
//var
// Channel1,Channel2:pChannel;
begin
// Channel1 := ChannelList.GetChannelFromPhone(IntToStr(ChnlID1));
// Channel2 := ChannelList.GetChannelFromPhone(IntToStr(ChnlID2));
// InCallIn(Channel1,Channel2);
Result := 0 ;
end;
procedure TDjSSCx.test;
begin
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.GetKeepChannel
作者: 姜亦文
日期: 2006.09.13
參數(shù): ChnlInID, ChnlOutID: integer 通過通道號(hào)取保持
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.GetKeepChannel(ChnlInID, ChnlOutID: integer);
begin
GetKeepChannel(ChannelList.Items[ChnlInID],ChannelList.Items[ChnlOutID]);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.GetKeepChannel
作者: 姜亦文
日期: 2006.09.13
參數(shù): ChnlInID: integer; DTMFNum: string 通過主叫號(hào)碼取保持
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.GetKeepChannel(ChnlInID: integer; DTMFNum: string);
var
ChannelIn,ChannelOut:PChannel ;
begin
ChannelIn := ChannelList.Items[ChnlInID];
ChannelOut := ChannelList.GetChannelFromPhone(DTMFNum);
GetKeepChannel(ChannelIn,ChannelOut);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.GetKeepChannel
作者: 姜亦文
日期: 2006.09.13
參數(shù): KeepChannelList: Variant 取系統(tǒng)中保持的通道
返回值: integer
-------------------------------------------------------------------------------}
function TDjSSCx.GetKeepChannel(KeepChannelList: Variant): integer;
begin
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.KeepChannel
作者: 姜亦文
日期: 2006.09.13
參數(shù): ChnlID: Integer 保持來電
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.KeepChannel(ChnlID: Integer);
var
KeepResult:integer;
begin
KeepResult := DjTc081.KeepChannel(ChannelList.Items[ChnlID]);
if Assigned(FOnKeep) then
FOnKeep(Self,ChnlID,KeepResult);
end;
{-------------------------------------------------------------------------------
過程名: TDjSSCx.KeepChannel
作者: 姜亦文
日期: 2006.09.13
參數(shù): SubPhone: string 通過分機(jī)號(hào)保持來電11
返回值: 無
-------------------------------------------------------------------------------}
procedure TDjSSCx.KeepChannel(SubPhone: string);
var
Channel:PChannel ;
begin
Channel := ChannelList.GetChannelFromPhone(SubPhone) ;
if Assigned(Channel) then
KeepChannel(Channel.ChannelID);
end;
procedure TDjSSCx.GetKeepChannel(ChnlIn, ChnlOut: PChannel);
var
KeepResult:integer;
begin
if Assigned(FBeforeGetKeep) then
FBeforeGetKeep(Self,ChnlIn.ChannelID,ChnlOut.ChannelID);
KeepResult := DjTc081.GetKeepChannel(ChnlIn,ChnlOut);
if Assigned(FOnGetKeep) then
FOnGetKeep(self,ChnlIn.ChannelID,ChnlOut.ChannelID,KeepResult);
end;
procedure TDjSSCx.GetKeepChannel(ChnlInPhone, ChnlOutPhone: string);
begin
end;
function TDjSSCx.ClearThree(Channel1, Channel2: PChannel): integer;
var
// Meeting:PMeeting;
i:integer;
Channel3:PChannel;
begin
if Channel1 = nil then
Channel1 := DjMC.GetThreeChannel(Channel2.Meeting,Channel2);
Channel3 := DjMC.GetThreeChannel(Channel1.Meeting,Channel1,Channel2);
i := DjMC.DeleteChannel(Channel2);
if i = 0 then
begin
i := DjMC.DeleteChannel(Channel1);
if i = 0 then
begin
i := DjMC.DeleteChannel(Channel3);
if i = 0 then
begin
//StartPlaySignal(Channel1.ChannelID,SIG_STOP);
//StartPlaySignal(Channel3.ChannelID,SIG_STOP);
Channel2.ConnectChannel.ConState := OneConnect;
Self.HangUp(Channel2.ChannelID);
if Assigned(self.FOnClearThree) then
FOnClearThree(Self,Channel1.ChannelID,Channel3.ChannelID,Channel2.ChannelID)
else
begin
DjTc081.SetLink(Channel1.ChannelID,Channel3.ChannelID);
end;
end;
end;
end;
end;
function TDjSSCx.LinkThree(Channel1, Channel2: PChannel): integer;
var
Meeting:PMeeting;
i:integer;
Channel3:PChannel;
begin
Meeting :=DjMC.StartMeet(Channel1);
if Assigned(Meeting) then
begin
i := DjMC.AddChannel(Meeting,Channel2);
if i =0 then
if Channel1.ConnectChannel.ConState = Connected then
begin
Channel3 := Channel1.ConnectChannel.Channeler ;
// i:= DjTc081.ClearLink(Channel1,Channel3);
i := DjMC.AddChannel(Meeting,Channel3);
if i = 0 then
begin
Channel1.ConnectChannel.ConState := ThreeState ;
Channel2.ConnectChannel.ConState := ThreeState ;
Channel3.ConnectChannel.ConState := ThreeState ;
if Assigned(self.FOnLinkThree) then
FOnLinkThree(Self,Channel1.ChannelID,Channel2.ChannelID,Channel3.ChannelID);
end;
end;
end
else
begin
if Assigned(Self.FOnException) then
FOnException(Self,Channel1.ChannelID,DjE_LINKTHREE);
end;
end;
function TDjSSCx.ClearThree(ChnlId: integer; CallerPhone: string): integer;
var
Channel1,Channel2: PChannel;
begin
Channel1 := ChannelList.Items[ChnlId];
Channel2 := ChannelList.GetChannelFromPhone(CallerPhone);
Result := ClearThree(Channel1,Channel2);
end;
function TDjSSCx.LinkThree(ChnlID: integer; CallerPhone: string): integer;
var
Channel1,Channel2: PChannel;
begin
Channel1 := ChannelList.Items[ChnlId];
Channel2 := ChannelList.GetChannelFromPhone(CallerPhone);
Result := LinkThree(Channel1,Channel2);
end;
function TDjSSCx.ClearThree(ChnlId1, ChnlID2: integer): integer;
var
Channel1,Channel2: PChannel;
begin
if ChnlId1 = -1 then
Channel1 := nil
else
Channel1 := ChannelList.Items[ChnlId1];
Channel2 := ChannelList.Items[ChnlId2];
ClearThree(Channel1,Channel2);
end;
function TDjSSCx.LinkThree(ChnlID1, ChnlID2: integer): integer;
var
Channel1,Channel2: PChannel;
begin
Channel1 := ChannelList.Items[ChnlId1];
Channel2 := ChannelList.Items[ChnlId2];
LinkThree(Channel1,Channel2);
end;
procedure TDjSSCx.SetRecord(ChnlId, RecordChnlID, RecordType: integer;
IsAgc: boolean);
var
Channel:PChannel;
begin
Channel := ChannelList.Items[ChnlID];
if Recorded then
begin
Channel.Recorded.IsRecord := True;
Channel.Recorded.RecordChannel := RecordChnlID;
Channel.Recorded.RecordType := TRecordType(RecordType);
Channel.Recorded.IsAGC := IsAgc ;
end;
end;
procedure TDjSSCx.SetUse(ChnlID: integer; IsUse: Boolean);
var
Channel:PChannel;
begin
Channel := ChannelList.Items[ChnlID];
Channel.IsUse := IsUse ;
end;
procedure TDjSSCx.SetRecordFilePath(RecordFilePath: string);
begin
RecordCenter.RecordPath := RecordFilePath;
end;
procedure TDjSSCx.SetFilePath(FilePath: Shortstring);
begin
FRecordFilePath := FilePath;
if Assigned(RecordCenter) then
RecordCenter.RecordPath := FilePath ;
end;
procedure TDjSSCx.SetPackRate(aPackRate: Integer);
begin
FPackRate := aPackRate ;
//tc08a32.SetPackRate(aPackRate);
end;
procedure TDjSSCx.PlayFile(ChnlID: integer; FileName: string);
begin
DjTc081.StartPlayFile(ChannelList.Items[ChnlID],FileName);
end;
procedure TDjSSCx.StopPlayFile(ChnlId: integer);
begin
DjTc081.StopPlayFile(ChannelList.Items[ChnlId]);
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -