Connecting to an IP Office using DevLink
DevLink Programmer’s Guide
Page 9
IP Office CTI Link
40DHB0002UKAD Issue 11a (14th June 2005)
Example: Connecting to IP Office in Delphi
Note that the "systempassword" in the call to DLOpen () should be replaced with your unit's actual
system password.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
devlink;
{$R *.DFM}
var
hEvent : THANDLE;
dwCommsEvent : DWORD;
bStarting: boolean;
procedure HandleCommsEvent( pbxh : LongInt;
Comms_status : DWORD;
Parm1 : DWORD ); stdcall;
begin
case Comms_status of
DEVLINK_COMMS_OPERATIONAL,
DEVLINK_COMMS_NORESPONSE, DEVLINK_COMMS_REJECTED:
begin
if bStarting then
begin
dwCommsEvent := comms_status;
SetEvent( hEvent );
end;
end;
DEVLINK_COMMS_MISSEDPACKETS:
begin
// parm1 indicates the number of packets missed...
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
bStarting := TRUE;
hEvent := CreateEvent( nil, FALSE, FALSE, nil );
DLOpen( 0, '255.255.255.255', 'systempassword', nil, nil, - HandleCommsEvent
);
dwCommsEvent := DEVLINK_COMMS_NORESPONSE;
WaitForSingleObject( hEvent, 10000 ); // 10-second timeout
bStarting := FALSE;
if dwCommsEvent = DEVLINK_COMMS_OPERATIONAL then
begin
ShowMessage('Connected OK');
end
else
begin
Summary of Contents for IP Office CTI Link
Page 1: ...IP Office CTI Link DevLink Programmer s Guide 40DHB0002UKAD Issue 11a 14th June 2005 ...
Page 2: ......
Page 4: ......
Page 22: ......
Page 27: ......