Example: Connecting To Ip Office In "C - Avaya IP Office CTI Link Programmer's Manual

Devlink
Hide thumbs Also See for IP Office CTI Link:
Table of Contents

Advertisement

Printed Documentation

Example: Connecting to IP Office in "C"

Note that the "systempassword" in the call to DLOpen () should be replaced with your unit's actual
system password.
#include <windows.h>
#include <stdio.h>
#include "devlink.h"
LONG hEvent;
DWORD dwCommsEvent;
BOOL bStarting;
void CALLBACK HandleCommsEvent( LONG pbxh, DWORD comms_evt, DWORD parm1 )
{
switch( comms_evt ) {
case DEVLINK_COMMS_OPERATIONAL:
// we are working fine... fall through
case DEVLINK_COMMS_NORESPONSE:
// system not found (initial connection),
// or network connection lost (rebooted?)
// fall through...
case DEVLINK_COMMS_REJECTED:
// incorrect system password specified...
if( bStarting ) {
dwCommsEvent = comms_evt;
SetEvent( hEvent );
}
else {
// insert your code here...
}
break;
case DEVLINK_COMMS_MISSEDPACKETS:
// Indicates that the system is under
// heavy load. IP Office always prioritises
// data routing and call handling above CTI events.
// (parm1 contains the number of packets missed)
break;
}
}
int main(int argc, char* argv[])
{
printf( "connecting...");
bStarting = TRUE;
hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
DLOpen( 0,
"255.255.255.255"
"systempassword",
NULL,
NULL,
HandleCommsEvent );
dwCommsEvent = DEVLINK_COMMS_NORESPONSE;
WaitForSingleObject( hEvent, 10000 ); // 10 seconds
bStarting = FALSE;
if( dwCommsEvent == DEVLINK_COMMS_OPERATIONAL ) {
printf("Connected OK\n");
}
else {
printf("Error connecting to IP Office\n");
}
DLClose( 0 );
CloseHandle( hEvent );
return 0;
}
DevLink Programmer's Guide
IP Office CTI Link
40DHB0002UKAD Issue 11a (14th June 2005)
Page 8

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the IP Office CTI Link and is the answer not in the manual?

Questions and answers

Table of Contents