首頁>>廠商>>CT中間件廠商>>朗深技術(shù)

UniMedia MSIX座席控件Delphi調(diào)用實(shí)例解析

2009/05/31

目標(biāo)功能

  在Delphi中實(shí)現(xiàn)來話通知和電話應(yīng)答。

Delphi調(diào)用實(shí)例

unit Unit1;

interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, MSIProj_TLB;

type
TForm1 = class(TForm)
MSIX1: TMSIX;
ButtonInit: TButton;
ButtonLogin: TButton;
ButtonAnswer: TButton;
procedure MSIX1CallIncome(ASender: TObject; const AlertingDN,
CallingDN, UUD: WideString);
procedure MSIX1Login(ASender: TObject; MsgID, SuccFlag: Integer;
const ErrorCause: WideString; AgentID: Integer);
procedure ButtonInitClick(Sender: TObject);
procedure ButtonLoginClick(Sender: TObject);
procedure ButtonAnswerClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
{$R *.dfm}

procedure TForm1.MSIX1CallIncome(ASender: TObject; const AlertingDN,
CallingDN, UUD: WideString);
begin
MessageDlg('來電話了!', mtInformation, [mbOk], 0);
end;

procedure TForm1.MSIX1Login(ASender: TObject; MsgID, SuccFlag: Integer;
const ErrorCause: WideString; AgentID: Integer);
begin
if (SuccFlag = 0) then
MessageDlg('登錄成功!', mtInformation, [mbOk], 0)
else
MessageDlg('登錄失。'+MSIX1.GetLastErrorCauseDesc, mtInformation, [mbOk], 0);
end;

procedure TForm1.ButtonInitClick(Sender: TObject);
begin
MSIX1.SetConnInfo('192.168.1.1', 10089);
MSIX1.SetDN('1000');
MSIX1.Start();
end;

procedure TForm1.ButtonLoginClick(Sender: TObject);
begin
MSIX1.Login(0, 1000, 1, 0, '2000', '5', 'xms', '');
end;

procedure TForm1.ButtonAnswerClick(Sender: TObject);
var
ret: integer;
begin
ret := MSIX1.SetHookStatus(0, 2);
if (ret = 0) then
MessageDlg('摘機(jī)成功!', mtInformation, [mbOk], 0)
else
MessageDlg('摘機(jī)失!'+MSIX1.GetLastErrorCauseDesc, mtInformation, [mbOk], 0);
end;
end.

說明:

  1. 先初始化控件,然后登錄座席,登錄成功后打內(nèi)線電話1000或通過ACD分配到1000,應(yīng)答來話即可;

  2. SetConnInfo/SetDN/Start等函數(shù)都有事件返回,可判斷是否成功;

  3. 具體API以及事件的用法請參考開發(fā)文檔。

CTI論壇報(bào)道


相關(guān)鏈接:
UniMedia IDE集成環(huán)境文件操作實(shí)例解析 2009-05-22
UniMedia IDE集成環(huán)境調(diào)用DLL動態(tài)庫實(shí)例解析 2009-05-22
UniMedia IDE集成環(huán)境訪問數(shù)據(jù)庫實(shí)例解析 2009-05-19
UniMedia 6S級電話語音中間件典型應(yīng)用-多機(jī)同振 2009-05-18
UniMedia 6S級電話語音中間件應(yīng)用-自動人工互轉(zhuǎn) 2009-05-15