Printed Documentation
DevLink Programmer’s Guide
Page 8
IP Office CTI Link
40DHB0002UKAD Issue 11a (14th June 2005)
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;
}
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: ......