Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DEVLink Programming 1

Status
Not open for further replies.

zyzjacky

Programmer
Jan 19, 2006
76
MT
Hi guys. I am currently working on DEVlink programming (single user mode) and i have managed to connect to IP Office by using DLOpen(), and I also want to get information from it, e.g. the tel number of the caller, is it right i can use DLRegisterType2CallDeltas() function? if yes, how should i actually work with it. my code is i:=DLRegisterType2CallDeltas(0, HandleLogEvent);{delphi} and i return 0 it means successful. but how can i get the information, i've noticed that there are three types of event S, D, A. any help? thank you.
 
Hi zyzjacky,

I'm having exactly the same problem. I also managed to connect IPO with DLOpen() and I'm getting DLRegisterType2CallDeltas() events (0,1,2), but have no idea how to catch the S,D,A events.

[tt]DLRegisterType2CallDeltas(hEvent, cb)[/tt]

Could you please point me in the right direction? Thank you very much!!
 
here is the code

unit master;

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

const
WM_ICONTRAY = WM_USER + 1;

type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2 : TForm2;

implementation

{$R *.dfm}

{$R WindowsXP.RES}

uses
devlink,
rtEventHandler;

var
hEvent : THANDLE;
dwCommsEvent : DWORD;
bStarting : boolean;

procedure ShowDetailForm ;external 'showform.dll';

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 HandleEvent(pbxh:LongInt;info:pChar);stdcall;
begin
rtEventHandler.getEvent(info);
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
bStarting := TRUE;
hEvent := CreateEvent( nil, FALSE, FALSE, nil );
DLOpen( 0, PChar(IPOAddress), PChar(IPOPassword), nil, nil, HandleCommsEvent);
dwCommsEvent := DEVLINK_COMMS_NORESPONSE;
WaitForSingleObject( hEvent, 5000 ); // 5-second timeout
bStarting := FALSE;
if dwCommsEvent = DEVLINK_COMMS_OPERATIONAL then
begin
DLRegisterType2CallDeltas(0,HandleEvent);
showmessage('connected');
end;
end;
end.

the above is a unit file and it calls another unit, see below:

unit rtEventHandler;


interface

uses

Windows,SysUtils;

function getEvent(info:pChar):integer;

var
iComingCall :Integer;

implementation
uses
ShowDetail;

function getEvent(info:pChar):integer;

begin
//info:pChar is a string value of event, you can handld it by code here
end;
end.

 
Thank you for your quick response!

There is one problem still, it seems that the HandleEvent is never called by DLRegisterType2CallDeltas.

I've set breakpoint at locations in line where DLRegisterType2CallDeltas is called but debuger doesn't trace into HandleEvent.

It just steps over to showmessage line.



Any ideas?
 
What I'm trying to say is:

event obviously doesn't get triggered (when I for eg. get a call to IP Office), so callback never occurs. I have no idea what's wrong.

Thanks.
 
Actually, it couldn't work. I just figured out the dongle isn't working. I already contacted Avayo, so they will ship replacement asap.

Thanks again zyzjacky, your posts were very helpful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top