+ All Categories
Home > Documents > Avaya DevLink

Avaya DevLink

Date post: 08-Sep-2014
Category:
Upload: hanporras
View: 368 times
Download: 1 times
Share this document with a friend
Popular Tags:
24
IP Office CTI Link DevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)
Transcript
Page 1: Avaya DevLink

IP Office CTI LinkDevLink Programmer's Guide

40DHB0002UKAD – Issue 1 (28/08/2001)

Page 2: Avaya DevLink

Page 2 - Contents

Page 2 - Contents IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

IP Office CTI Link......................................................................................................................... 1Introduction ........................................................................................................................................ 3

Overview ..................................................................................................................................................................3IP Office CTI Link Lite..........................................................................................................................................................3IP Office CTI Link Pro..........................................................................................................................................................3DevLink................................................................................................................................................................................4

Using the DevLink DLL...................................................................................................................... 5Overview ..................................................................................................................................................................5Using DevLink with Microsoft Visual C++.................................................................................................................5Using DevLink with Borland Delphi ..........................................................................................................................5

Connecting to IP Office using DevLink............................................................................................ 6Connecting ...............................................................................................................................................................6Disconnecting...........................................................................................................................................................6

Example: Connecting to IP Office in “C” ..............................................................................................................................7Example: Connecting to IP Office in Delphi .........................................................................................................................8

DevLink CDR ...................................................................................................................................... 9Overview ..................................................................................................................................................................9

DevLink Real-time event stream..................................................................................................... 11Overview ................................................................................................................................................................11

S events ............................................................................................................................................................................11D events ............................................................................................................................................................................11A events ............................................................................................................................................................................11

S events .................................................................................................................................................................12D events.................................................................................................................................................................14A events .................................................................................................................................................................14

DevLink reference............................................................................................................................ 15Functions................................................................................................................................................................15

DLOpen .............................................................................................................................................................................15DLClose.............................................................................................................................................................................16DLRegisterCallLog.............................................................................................................................................................16DLRegisterType2CallDeltas ..............................................................................................................................................17

Callbacks................................................................................................................................................................18COMMSEVENT.................................................................................................................................................................18CALLLOGEVENT ..............................................................................................................................................................19

Glossary............................................................................................................................................ 20Appendix A ....................................................................................................................................... 21

DEVLINK.H ............................................................................................................................................................21Appendix B ....................................................................................................................................... 22

DEVLINK.PAS........................................................................................................................................................22Index.................................................................................................................................................. 23

Contents

Page 3: Avaya DevLink

Introduction Overview - Page 3

IP Office CTI Link Introduction - Page 340DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

IntroductionOverview

IP Office DevLink is part of the IP Office CTI Link Software Development Kit. The IPOffice CTI Link is available in Lite and Pro versions, which provide run-timeinterfaces for applications to use. The Software Development Kit (SDK) providesdocumentation on both Lite and Pro interfaces for software developers.Both the Lite and Pro offerings are the same program. The additional functionalityprovided by IP Office CTI Link Pro is enabled when the CTI Link Pro licence key isinstalled.This manual provides a tutorial and reference to the DevLink Lite and Pro interfaces,as well as providing example source code.

IP Office CTI Link LiteIP Office CTI Link Lite is a free of charge offering, and contains the followingcomponents:• TAPILink Lite

This component implements Microsoft TAPI, and allows programs to controlone telephone line per PC. It provides simple CTI, including answer,hangup, make-call, transfer, and provides CLI/ANI for screen-popping.Please see the TAPILink Developers Guide for more details on TAPILinkLite and TAPILink Pro.

• DevLink LiteThis component implements a proprietory interface for collecting CDR (CallData Record) or SMDR information from the IP Office system unit. Thisprovides an event per telephone call received or made, and is useful for callcosting, call billing, and call recording applications.

IP Office CTI Link ProIP Office CTI Link Pro includes all of the Lite functionality. It contains the followingcomponents:• TAPILink Pro

This component provides both first-party and third-party TAPI control oftelephony devices. In addition to the functionality provided by TAPILink Lite,it also adds the ability to receive information on ACD queues, hunt groups,and provides additional advanced functionality. Please see the TAPILinkDevelopers Guide for more details on TAPILink Lite and TAPILink Pro.

• DevLink ProThis component provides a real-time event stream in addition to the CDRinterface. The real-time event stream provides information on telephoneactivity as and when that activity occurs, and also provides information ontrunk activity.

Page 4: Avaya DevLink

Page 4 - Overview Introduction

Page 4 - Introduction IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

DevLink DevLink provides two programmers’ interfaces which complement the MicrosoftTAPI interfaces provided by TAPILink Lite and Pro:– CDR (Call Data Record - also known as SMDR) definition– Real-time event streamThe CDR interface, which provides a summary record of each external call after thecall is complete, is provided free of charge with all IP Office systems.The Real-time event stream is enabled by installing the CTI Pro licence key onto thesystem unit.The DevLink DLL, which is included on the User CD-ROM can be installed with orwithout the licence key. DevLink enables third-party applications, such as callcosting software or call recorders to use information provided by the telephonesystem. Please refer to the IP Office CTI Link Installation Manual for installationinstructions.When the DevLink component is installed, a Windows Dynamic Link Library,DEVLINK.DLL is installed into the SYSTEM/SYSTEM32 directory. Programs usingthis interface simply need to link to this library and use it's functions.Notes: 1. Any application that uses the DevLink DLL should include it in the

application installation script. As the DLL is not a COM component, noregistration is necessary. The DLL does not require any registry settingsor supporting files.

2. When developing an application that uses the DLL, the DevLink headerfile (devlink.h) and appropriate library file (devlink.lib or devlinkomf.lib)should be copied to the same directory as the project source files. Thedevlink.lib library file contains export symbols in COFF format which canbe used with projects written in Visual C++. The devlinkomf.lib library filecontains export symbols in OMF format for other linkers.

Page 5: Avaya DevLink

Using the DevLink DLL Overview - Page 5

IP Office CTI Link Using the DevLink DLL - Page 540DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

Using the DevLink DLLOverview

DEVLINK.DLL can be used in any language that supports Dynamic Link Libraries(DLLs), e.g. Microsoft Visual C++ or Borland Delphi.DevLink allows developers to request call-backs, which will be generated whensignificant events occur. For the CDR interface, this occurs whenever a call iscompleted or finished on the system. Both telephony calls and data calls areincluded in the CDR output. For the real-time event stream, this occurs at variousstages throughout a call’s lifetime. Again, both telephony calls and data calls areincluded in the events generated.Please note that all application call-backs made on a thread which DevLink creates.As a result, consideration must be given by programmers to ensure that all functionscalled from within a call-back are thread-safe.

Using DevLink with Microsoft Visual C++This section to contain details for using DevLink from within MSVC. It shouldhighlight the location of the .LIB file, and (if there is an issue) which .LIB file to use. Itshould also discuss which version of MSVC should be used (latest only?)Appendix A contains the DEVLINK.H file which should be used with Microsoft VisualC++Programs written in Microsoft Visual C++ should link to the DEVLINK.LIB library.

Using DevLink with Borland DelphiAppendix B contains the DEVLINK.PAS file which should be used with BorlandDelphi.Programs written using Borland Delphi should use the DEVLINK.PAS file, whichlinks directly to the DEVLINK.DLL library.

Page 6: Avaya DevLink

Page 6 - Connecting Connecting to IP Office using DevLink

Page 6 - Connecting to IP Office using DevLink IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

Connecting to IP Office using DevLinkConnecting

DevLink supports connection to multiple IP Office systems at the same time. Toconnect to an IP Office system, the DLOpen() function must be called:

LONG DLOpen( LONG pbxh, TEXT *pbx_address, TEXT *pbx_password, TEXT *reserved1, TEXT *reserved2, COMMSEVENT cb);

The application-supplied pbxh handle is used internally by DevLink to track theconnected IP Office System. Each connected system must have a different pbxhhandle, supplied by the application.The pbx_address field is the IP address of the IP Office system unit. A value of"255.255.255.255" can be used, in which case DevLink will broadcast to locate an IPOffice system unit.Notes: 1. If DevLink is being used to control more than one IP Office system at the

same time, then the specific IP address of the IP Office must be used.2. The cb parameter (Communications Status Callback) is required, and

must not be set to NULL. The return result from DLOpen () does notnecessarily indicate whether or not the connection to the system unit wassuccessful. If the connection attempt succeeds, then a COMMSEVENTcallback will be generated, indicating that connection to the system hassucceeded.

The reserved1 and reserved2 parameters are for future expansion, and should beset to NULL (nil in Delphi).

DisconnectingTo disconnect from IP Office, use the DLClose() routine, passing the sameapplication-supplied handle that was used to open the connection:

LONG PASCAL DLClose( LONG pbxh );

Page 7: Avaya DevLink

Connecting to IP Office using DevLink Disconnecting - Page 7

IP Office CTI Link Connecting to IP Office using DevLink - Page 740DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

Example: Connecting to IP Office in “C”Note that the "systempassword" in the call to DLOpen () should be replaced withyour 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;}

Page 8: Avaya DevLink

Page 8 - Disconnecting Connecting to IP Office using DevLink

Page 8 - Connecting to IP Office using DevLink IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

Example: Connecting to IP Office in DelphiNote that the "systempassword" in the call to DLOpen () should be replaced withyour unit's actual system password.unit Unit1;

interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,StdCtrls;

type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(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 : LongIat; Comms_status : DWORD; Parm1 : DWORD );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 ShowMessage('Error connecting to IP Office'); end;

DLClose( 0 ); CloseHandle( hEvent );

end;

end.

Page 9: Avaya DevLink

DevLink CDR Overview - Page 9

IP Office CTI Link DevLink CDR - Page 940DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

DevLink CDROverview

Applications request information from CDR by calling the DLRegisterCallLogfunction after they have connected to the IP Office system:LONG PASCAL DLRegisterCallLog( LONG pbxh, CALLLOGEVENT cb );

This registers a function provided by the application, of type CALLLOGEVENT, whichwill be called by DevLink whenever a call is completed.typedef void (CALLBACK * CALLLOGEVENT)( LONG pbxh, TEXT * info );

The two parameters (pbxh and info) are provided to the application. Thepbxh parameter is the identifier that was used in the call to DLOpen(), and canbe used to identify the system when the application is connected to multiple IPOffice systems.The second parameter is a string, containing the call record. The call record is acomma-separated string, with fixed-width fields.The format of the string is as follows:CALL: Call_start, Call_duration, Ring_duration, Caller, Direction,Called_number, Dialled_number, Name, Tag, Account, Is_internal,Lcr_called_number, <Reserved>

The CDR record is 289 characters in length (including the terminating zerocharacter). Applications should not rely on this, however, as additional informationmay be added in future releases of DevLink and IP Office. The string length willalways be less than 1500 bytes in length.The fields in the string, as detailed above, have the meanings detailed in the tableon the next page.In the description column in the table below, internal calls are extension-to-extensionor extension-to-group calls, inbound calls are where a call arrives from the PSTN tothe telephone system, and outbound calls are where a call is made to a telephonenumber over the PSTN from an extension.

Page 10: Avaya DevLink

Page 10 - Overview DevLink CDR

Page 10 - DevLink CDR IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

Calls to other telephone systems via Qsig networking or through H.323 VoIP (Voiceover IP) are also considered to be external calls – either inbound or outbound.Field Offset Length Description

CALL: 0 5 CALL: identifier. This is always present inthe CDR record.

Call_start 6 16 Start date and time of call. Format isYYYY/MM/DD HH:MM, all numbers haveleading zeros if less than the specifiednumber of digits. The hours field is a 24-hourclock.

Example: 2001/06/21 14:04

Call_duration 23 8 Call duration. Format is HH:MM:SS. Allnumbers have leading zeros if less than thespecified number of digits.

Example: 01:56:57

Ring_duration 32 3 Ring duration. The interval in secondsbetween the call arriving at the switch, andthe call being answered or cancelled.

Please note that this is the ring time from thecallers’ perspective, which may not be thesame as the ring time for an extension.

Caller 36 32 This is the callers number. If the call wasoriginated by an extension, this will be thenumber of that extension. If the calloriginated externally, this will be blank.

Direction 69 1 Direction of the call. This will be either ‘I’ foran inbound call or ‘O’ for an outbound call.For internal calls, this will be ‘O’.

Called_number 71 32 This is the number called. For internal calls,this will be the extension or group called. Forinbound calls, this will be the hunt group towhich the call was routed, and for outboundcalls, this will be the digits dialled beforeLeast Cost Routing translation is applied.

Dialled_number 104 32 For internal calls and for outbound calls, thisis identical to the called_number above. Forinbound calls, this the DDI dialled by thecaller.

Name 137 32 This is the name of the group or extensioninvolved in the call. For internal calls, this isthe name of the originating extension.

Tag 170 32 This is any tag associated with the call (tagscan be attached to calls using VoiceMail/Pro, eConsole or TAPI)

Account 203 16 This is any account code associated with thecall. Account codes can be attached to callsfrom digital handsets.

Is_Internal 220 1 1 for an internal call, 0 for an external call.

Lcr_called_number

222 32 This is the number dialled after Least CostRouting translation is applied

<Reserved> 255 32 Reserved for future expansion

Page 11: Avaya DevLink

DevLink Real-time event stream Overview - Page 11

IP Office CTI Link DevLink Real-time event stream - Page 1140DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

DevLink Real-time event streamOverview

Calls in IP Office are modelled as being a communications line between two end-points, called A and B respectively. An A end is always present, but a B end may ormay not be present, depending on the state of the call (A and B are typicallyextensions or trunks, but they may also be connected to the voice mail system orparked).Three different types of real-time events are generated by DevLink. These are usedto track the call throughout its lifetime:- S events- D events- A eventsThe format and information contained in these events are described in more detailbelow.Applications request information real-time events by calling theDLRegisterCallDelta2() function after they have connected to the IP Office system:

LONG PASCAL DLRegisterType2CallDeltas( HANDLE pbxh, CALLLOGEVENT cb );

This registers a function provided by the application, of type CALLLOGEVENT,which will be called by DevLink whenever a real-time event is generated.typedef void (CALLBACK * CALLLOGEVENT)( LONG pbxh, TEXT * info );

The two parameters (pbxh and info) are provided to the application. The pbxhparameter is the identifier that was used in the call to DLOpen() and can be used toidentify the system when the application is connected to multiple IP Office systems.The second parameter is a string, containing the call record. The call record is acomma-separated string, with variable width fields. The string will always be lessthan 1500 bytes in length inclusive of a terminating NULL character.

S eventsS events give information on the status of a call. S events are generated when callsare first created, answered, or the status of a device involved in the call changes.

D eventsD events are generated when the call is completed or abandoned. They indicate thatthe call no longer exists.

A eventsA events are generated when the A and B ends of a call are swapped. This typicallyhappens when a call is transferred or parked by the originator, as the system doesnot allow A ends to be changed, so the system swaps the ends first.

Page 12: Avaya DevLink

Page 12 - S events DevLink Real-time event stream

Page 12 - DevLink Real-time event stream IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

S eventsS Events are sent whenever a call is first created, and whenever any part of the callchanges state.The format of an S event is as follows:CALL: S <field1>,<field2>, …<field59>All of the information is provided in the character string. Thus, numbers arerepresented in ASCII form. All numbers are integers, and do not contain a decimalpoint. Each string field has a maximum of 128 characters in length.The field definitions are documented in the following table. Please note that fieldsmarked as <reserved> may contain information, but their contents and meaning willchange between releases of the IP Office core software.

Field

number

Name Type Description

1-6 <reserved> String Reserved for future expansion

7 Astate Number State of the A end of the call. Validnumbers are:

0 Idle1 Ringing2 Connected3 Disconnected4 Suspending5 Suspended6 Resuming7 Dialling8 Dialled9 LocalDial10 Queued11 Parked12 Held13 Redialling

8 Bstate Number State of the B end of the call – seeabove for values. If there is no B end,this will be 0 (Idle)

9 Aconnected Number 0 indicates not connected to the switch(eg. If receiving dialtone)

10 <reserved> String Reserved for future expansion

11 Bconnected Number As in field 9 above, but for the B end

12 <reserved> String Reserved for future expansion

13 Aname String Name of the A end of the call. Theformat of this string is:For extensions: Name (Number)For trunks: Line number

14 Bname String As in field 13 above. If there is no Bend, this will be empty.

15 Blist String List of possible targets for the call.Targets are separated by semicolons,and if there are more than four, the listis terminated after 4 elements with anellipsis.

16 Aslot Number Slot number of the A side of the call.This is the identify of the TDM trunk.

17 Achannel Number Channel number within the Aslotabove.

18 Bslot Number As in field 16 above, but for the B sideof the call.

Page 13: Avaya DevLink

DevLink Real-time event stream S events - Page 13

IP Office CTI Link DevLink Real-time event stream - Page 1340DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

Field

number

Name Type Description

19 Bchannel Number As Achannel, but for the B side of thecall.

20-40 <reserved> String Reserved for future expansion

41 TargetUserName String Name of user to which the call is beingtargeted.

42 <reserved> String Reserved for future expansion

43 IsInternalCall Number 1 the call is internal, otherwise 0

44-49 <reserved> String Reserved for future expansion

50 ParkslotNumber String When the call is parked, the B end isundefined, and this field contains thepark slot number.

51 <reserved> String Reserved for future expansion

53 Tag String Contains the tag, which may be appliedthrough TAPI, Voice Mail/Pro, oreConsole.

53-57 <reserved> String Reserved for future expansion

58 AccountCode String The account code of the call, if any

59 CallID Number Unique call id

Page 14: Avaya DevLink

Page 14 - D events DevLink Real-time event stream

Page 14 - DevLink Real-time event stream IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

D eventsD Events signify that the call is deleted. The format of a D event is as follows:CALL: D <field1>,<field2>,…<field7>The fields are as follows:Field

number

Name Type Description

1-6 <reserved> String Reserved for future expansion

7 CallID Number Unique call id

A eventsA Events indicate that the call ends have been swapped. This occurs, for example,when the originating extension transfers a call to another extension. The format ofan A event is very similar to that for a D event:CALL: A <field1>,<field2>,…<field7>The fields are as follows:Field

number

Name Type Description

1-6 <reserved> String Reserved for future expansion

7 CallID Number Unique call id

Page 15: Avaya DevLink

DevLink reference Functions - Page 15

IP Office CTI Link DevLink reference - Page 1540DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

DevLink referenceFunctions

DLOpenC / C++LONG PASCAL DLOpen( LONG pbxh , TEXT * pbx_address , TEXT * pbx_password , TEXT * reserved1 , TEXT * reserved2 , COMMSEVENT cb );

Delphifunction DLOpen(pbxh: LongInt; pbx_address: PChar; pbx_password: PChar; reserved1: PChar; reserved2: PChar; cb: TCommsEvent): LongInt; stdcall;

DescriptionThe DLOpen() routine is used to connect to an IP Office system.

Parameterspbxh A number used to identify the system. This is a user-supplied

parameter that must remain consistent across all calls to DevLink.pbx_address The IP address of the IP Office system (either a IP address or a

host name can be used). This may be set to "255.255.255.255" inwhich case DevLink will make a network broadcast to locate thesystem unit. Please note that only the first unit to respond will beconnected to; if you wish to connect to multiple system units, youmust specify the IP address or host name of the unit here.

reserved1 This parameter should be set to NULL (nil in Delphi)reserved2 This parameter should be set to NULL (nil in Delphi)cb This is the address of a call-back function, to which connection

status events will be sent. This parameter is mandatory.

Return valueThis routine may return either 0 (DEVLINK_SUCCESS) or 1(DEVLINK_UNSPECIFIEDFAIL). Please note that a return valueof DEVLINK_SUCCESS only indicates that communications withthe unit has been initiated; the subsequent connection may fail forseveral reasons. Further information will be provided to theCOMMSEVENT callback function specified in the cb parameter.

Page 16: Avaya DevLink

Page 16 - Functions DevLink reference

Page 16 - DevLink reference IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

DLCloseC / C++LONG PASCAL DLClose( LONG pbxh );

Delphifunction DLClose(pbxh: LongInt): LongInt; stdcall;

DescriptionThe DLClose() routine is used to disconnect from an IP Office system.

Parameterspbxh a number used to identify the system. This is the user-supplied

parameter used to connect to DevLink in the call to DLOpen().

Return valueThis routine may return 0 (DEVLINK_SUCCESS) or 1(DEVLINK_UNSPECIFIEDFAIL) in the event of an error.

DLRegisterCallLogC / C++LONG PASCAL DLRegisterCallLog( LONG pbxh, CALLLOGEVENT cb );

Delphifunction DLRegisterCallLog(pbxh: LongInt; cb: TCallLogEvent): LongInt; stdcall;

DescriptionThe DLRegisterCallLog() routine is used to request CDR information.

Parameterspbxh A number used to identify the system. This is the user-supplied

parameter used to connect to DevLink in the call to DLOpen().cb The address of the callback function that will receive CDR

events. Only one callback can receive CDR events at one time,and if this parameter is NULL, then CDR events will no longer besent to the application.

Return valueThis routine may return 0 (DEVLINK_SUCCESS) or 1(DEVLINK_UNSPECIFIEDFAIL) in the event of an error.

Page 17: Avaya DevLink

DevLink reference Functions - Page 17

IP Office CTI Link DevLink reference - Page 1740DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

DLRegisterType2CallDeltasC / C++LONG PASCAL DLRegisterType2CallDeltas( LONG pbxh, CALLLOGEVENT cb );

Delphifunction DLRegisterType2CallDeltas(pbxh: LongInt; cb: TCallLogEvent): LongInt; stdcall;

DescriptionThe DLRegisterType2CallDeltas() routine is used to request CDR information.

Parameterspbxh A number used to identify the system. This is the user-supplied

parameter used to connect to DevLink in the call to DLOpen().cb The address of the callback function that will receive real-time

events. Only one callback can receive real-time events at onetime, and if this parameter is NULL, then real-time events will nolonger be sent to the application.

Return valueThis routine may return:-0 = DEVLINK_SUCCESS1 = DEVLINK_UNSPECIFIEDFAIL Returned in the event of an error.2 = DEVLINK_LICENCENOTFOUND If no CTI licence is activated on the IP Office system.

Page 18: Avaya DevLink

Page 18 - Callbacks DevLink reference

Page 18 - DevLink reference IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

CallbacksCOMMSEVENT

C / C++typedef void (CALLBACK * COMMSEVENT)( LONG pbxh, DWORD comms_state, DWORD parm1 );

Delphitype TCommsEvent = procedure( pbxh : LongInt; comms_state : DWORD; Parm1 : DWORD );

DescriptionThe COMMSEVENT callback is called by DevLink whenever the state of thecommunication with the IP Office system unit changes.

Parameterspbxh A number used to identify the system. This is the user-supplied

parameter used to connect to the IP Office system unit inDLOpen().

comms_state A number indicating the state of the communications. Validvalues are:

Name Value DescriptionDEVLINK_COMMS_OPERATIONAL 0 Communications established. This occurs either

after the initial call to DLOpen(), or after thesystem unit has come back on-line after beingpowered off or rebooted.

DEVLINK_COMMS_NORESPONSE 1 No response from system unit. This occurs eitherafter the initial call to DLOpen(), or if the systemunit is powered off or rebooted. It can also occur ifnetwork problems prevent communications.

DEVLINK_COMMS_REJECTED 2 The system unit was located, but the systempassword was incorrect. The connection wasrejected.When this message is received, the applicationshould disconnect using DLClose(), and re-attempt the connection with the correct systempassword.This event may be generated either after the initialcall to DLOpen(), or if the system password hasbeen changed by the administrator.

DEVLINK_COMMS_MISSEDPACKETS 3 Packets were generated by the IP Office systemunit, but were not received by DevLink. This canoccur either because the IP Office system unit isunder heavy load, or because the applicationusing DevLink did not return from a callbackquickly enough. Applications should ensure thatthey do not take more than 100 milliseconds toprocess events.

parm1 This value is only defined for:DEVLINK_COMMS_MISSEDPACKETS events, in which case itindicates the number of packets dropped.

Return value No return value.

Page 19: Avaya DevLink

DevLink reference Callbacks - Page 19

IP Office CTI Link DevLink reference - Page 1940DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

CALLLOGEVENTC / C++typedef void (CALLBACK * CALLLOGEVENT)( Long pbxh, TEXT * info );

Delphitype TCallLogEvent = procedure( pbxh : LongInt; info : PChar );

DescriptionThe CALLLOGEVENT callback is called by DevLink either to deliver a CDR event,or to deliver a real-time event, depending on which has been registered.Note: A CTI license is required for returning Delta2 events.

Parameterspbxh A number used to identify the system. This is the user-supplied

parameter used to connect to the IP Office system unit inDLOpen().

info Text string containing the event. Please see the previousseconds on CDR and real-time events for more details.

Return value No return value.

Page 20: Avaya DevLink

Page 20 - Callbacks Glossary

Page 20 - Glossary IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

GlossaryThis section contains the list of all abbreviations and acronyms used in thisdocument.ACD Automated Call DistributorCD Compact DiskID IdentifierI/O Input / OutputIP Internet ProtocolISDN Integrated Standard Digital NetworkME Millennium Edition (Windows)MSDN Microsoft Developer NetworkPSTN Public Switched Telephone NetworkSDK Software Developer’s KitTAPI Telephony Applications Programming InterfaceTSP Telephony Service ProviderTSPI Telephony Service Provider InterfaceUUI User-to-User Information

Page 21: Avaya DevLink

Appendix A DEVLINK.H - Page 21

IP Office CTI Link Appendix A - Page 2140DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

Appendix ADEVLINK.H

This appendix contains a copy of the DEVLINK.H header file, used for C and C++programs./********************************************************************//* *//* C/C++ Header File (c) 2001 Avaya Global SME Solutions *//* *//* Contents:- *//* IP Office Dev link DLL provides an interface for managing *//* the IP Office product ranges from a Windows PC. *//********************************************************************/

#ifndef _DEVLINK_H_#define _DEVLINK_H_

typedef char TEXT;

#define DEVLINK_SUCCESS 0#define DEVLINK_UNSPECIFIEDFAIL 1#define DEVLINK_LICENCENOTFOUND 2

#define DEVLINK_COMMS_OPERATIONAL 0#define DEVLINK_COMMS_NORESPONSE 1#define DEVLINK_COMMS_REJECTED 2#define DEVLINK_COMMS_MISSEDPACKETS 3

#ifdef __cplusplusextern "C"{#endif

typedef void (CALLBACK * CALLLOGEVENT)( LONG pbxh, TEXT * info );

typedef void (CALLBACK * COMMSEVENT)( LONG pbxh, DWORD comms_state, DWORD parm1 );

LONG PASCAL DLOpen( HANDLE pbxh , TEXT * pbx_address , TEXT * pbx_password , TEXT * reserved1 , TEXT * reserved2 , COMMSEVENT cb );

LONG PASCAL DLClose( LONG pbxh );

LONG PASCAL DLRegisterCallLog( LONG pbxh, CALLLOGEVENT cb );

LONG PASCAL DLRegisterType2CallDeltas( LONG pbxh, CALLLOGEVENT cb );

#ifdef __cplusplus};#endif

#endif // _DEVLINK_H_

Page 22: Avaya DevLink

Page 22 - DEVLINK.PAS Appendix B

Page 22 - Appendix B IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

Appendix BDEVLINK.PAS

This appendix contains a copy of the DEVLINK.PAS file, used for Borland Delphiprograms.unit DEVLINK;{**************************************************************************}{ Delphi unit for DevLink (c) 2001 Avaya Global SME Solutions }{ Contents:- }{ IP Office DevLink DLL provides an interface for managing }{ the IP Office product ranges from a Windows PC }{**************************************************************************}

interface

uses Windows;

const DEVLINK_SUCCESS = 0; DEVLINK_UNSPECIFIEDFAIL = 1; DEVLINK_LICENCENOTFOUND = 2;const DEVLINK_COMMS_OPERATIONAL = 0; DEVLINK_COMMS_NORESPONSE = 1; DEVLINK_COMMS_REJECTED = 2; DEVLINK_COMMS_MISSEDPACKETS = 3;

type TCallLogEvent = procedure( pbxh : LongInt; info : PChar );

type TCommsEvent = procedure( pbxh : LongInt; Comms_status : DWORD; Parm1 : DWORD );

function DLOpen(pbxh: LongInt; pbx_address: PChar; pbx_password: PChar; reserved1: PChar; reserved2: PChar; cb: TCommsEvent): LongInt; stdcall;

function DLClose(pbxh: THandle): LongInt; stdcall;

function DLRegisterCallLog(pbxh: LongInt; cb: TCallLogEvent): LongInt; stdcall;

function DLRegisterType2CallDeltas(pbxh: LongInt; cb: TCallLogEvent): LongInt; stdcall;

implementation

function DLOpen; external 'DEVLINK.DLL';function DLClose; external 'DEVLINK.DLL';function DLRegisterCallLog; external 'DEVLINK.DLL';function DLRegisterType2CallDeltas; external 'DEVLINK.DLL';

end.

Page 23: Avaya DevLink

Index - Page 23

IP Office CTI Link Index - Page 2340DHB0002UKAD – Issue 1 (28/08/2001) DevLink Programmer's Guide

IndexBBorland Delphi ...........................................................................................................................................................................5,22CCallID.......................................................................................................................................................................................13,14CALLLOGEVENT ..................................................................................................................................................9,11,16,17,19,21CDR..................................................................................................................................................................................3,4,5,9,16COMMSEVENT ...............................................................................................................................................................6,15,18,21DDLClose ........................................................................................................................................................................................18DLOpen ......................................................................................................................................... 6,7,8,9,11,15,16,17,18,19,21,22DLRegisterCallDelta2 ...................................................................................................................................................................11DLRegisterCallLog......................................................................................................................................................9,16,17,21,22EEvents

A events..................................................................................................................................................................................................11,14D events..................................................................................................................................................................................................11,14S events..................................................................................................................................................................................................11,12

MMicrosoft Visual Basic.....................................................................................................................................................................5Microsoft Visual C++.......................................................................................................................................................................5RReal-time events..............................................................................................................................................................4,11,17,19SSMDR ......................................................................................................................................................................4,9,10,16,17,19TTAPI......................................................................................................................................................................................4,10,13TCallLogEvent ...............................................................................................................................................................16,17,19,22TCommsEvent ....................................................................................................................................................................15,18,22

Page 24: Avaya DevLink

Page 24 - DEVLINK.PAS Index

Page 24 - Index IP Office CTI LinkDevLink Programmer's Guide 40DHB0002UKAD – Issue 1 (28/08/2001)

Performance figures and data quoted in this document are typical, and must bespecifically confirmed in writing by Avaya before they become applicable to anyparticular order or contract. The company reserves the right to make alterationsor amendments to the detailed specifications at its discretion. The publication of

information in this document does not imply freedom from patent or otherprotective rights of Avaya, or others.

Intellectual property related to this product (including trademarks) and registeredto Lucent Technologies has been transferred or licensed to Avaya.

This confidential document is the property of Avaya and without its prior writtenconsent may not be disclosed to a third party nor copied.

Copyright 2001 AvayaSterling Court

15 - 21 MundellsWelwyn Garden City

Hertfordshire AL7 1LZEngland

Tel: +44 (0) 1707 392200Fax: +44 (0) 1707 376933

Email: [email protected]: http://www.avaya.com.


Recommended