Sei sulla pagina 1di 29

Eventra Java Recording API Guide

Updated - March 2009 Document Version 1.1

Eventra Java Recording API Guide v1.0

Empathy Systems 2009

Copyright Empathy Systems 2009. All rights reserved.

CONTENTS

Eventra Java Recording API v1.0

IMPORTANT INFORMATION Contact address: Empathy Systems Langebjergaenget 8A DK-4000 Roskilde Denmark

Eventra Recording API The information in this document is confidential and subject to change without notice. This document has been produced by Empathy Systems (Empathy) with great care and attention to detail. Every effort has been made to ensure accuracy and fitness for purpose. However, please note the following: Empathy makes no representation or warranty with respect to the contents of this document. Empathy disclaims any implied warranties of the merchandise or implied fitness for any particular purpose. Empathy supplies this documentation as an act of goodwill. Under no circumstances shall Empathy, or its employees, be responsible for any losses, or consequential losses, incurred in connection with its contents or use. Empathy reserves the right to revise this publication, or the product specification, at any time without notification.

2009 Empathy Systems All rights reserved

Empathy Systems 2009. All rights reserved

Page 2 of 29

January 2009

Eventra Java Recording API v1.0

"Building creative applications, delivering proven solutions" Eventra is designed and developed by Empathy, one of the industrys leading suppliers of voice and data technology solutions. It is part of a complete portfolio of CTI, call management and voice/data recording solutions, designed to help companies achieve their quality management goals, improve customer service and increase business efficiency.

Empathy places emphasis on delivering open, scaleable software solutions that integrate seamlessly with todays enterprise Microsoft Operating Systems and telecoms environments and has long-standing alliances with the worlds leading switch manufacturers. Empathy products are backed by a complete range of consultancy, bespoke development and pre- and post-sales support services. Our development expertise and the open, object-oriented nature of our products enable our applications to be customized to meet the exact requirements of our corporate customers and distribution partners. Our customer base is testament to the quality and reliability of our products and our support services. Our applications are as successful in the mission critical command and control environment, as they are in fast moving City dealing rooms or rapidly expanding call centres. Please visit the Empathy web site at http://www.empathy-systems.com/ or contact the marketing department on marketing@empathy-systems.com for information on our range of products.

Empathy Systems 2009. All rights reserved

Page 3 of 29

January 2009

Eventra Java Recording API Guide v1.0

Contents
Page Number INTRODUCTION ............................................................................................. 5 SYSTEM REQUIREMENTS ............................................................................ 5 NOTIFICATION EVENTS ................................................................................ 7 API FUNCTIONS ........................................................................................... 10 OPEN CONNECTION ....................................................................................... 12 open ......................................................................................................... 12 CLOSE CONNECTION ..................................................................................... 13 close ........................................................................................................ 13 GET RECORDING EVENT ................................................................................ 14 getRecordingEvent .................................................................................. 14 START RECORDING ....................................................................................... 15 startRecording.......................................................................................... 15 STOP RECORDING ........................................................................................ 17 stopRecording .......................................................................................... 17 stopRecordingDiscard .............................................................................. 18 TAG CALL ..................................................................................................... 19 tagCall ...................................................................................................... 19 tagCurrentCall .......................................................................................... 20 tagFinishedCall ........................................................................................ 21 TRANSFER CALL ............................................................................................ 22 callTransferred ......................................................................................... 22 PCIDSS ...................................................................................................... 23 muteCall ................................................................................................... 23 unMuteCall ............................................................................................... 24 pauseCall ................................................................................................. 25 restartCall................................................................................................. 26 APPENDIX A EXAMPLE ............................................................................ 27

Empathy Systems 2009. All rights reserved

Page 4 of 29

January 2009

Eventra Java Recording API Guide v1.0

Introduction
This document describes the Eventra Java Recording API that allows external applications to control recording through a Java Interface. This API is made up of a number of Java classes which use JNI (Java Native Interface) to call C++ language functions packaged in a DLL. This C++ DLL encapsulates all the Empathy framework communication and enables recording to be controlled by an external application with a few simple function calls. This API is designed to be used through a Java based application; the C++ DLL can be used direct if the calling application is C++ based. Another Guide is provided Eventra Recording API Guide for this purpose.

System Requirements
At present this API is supported on Microsoft Windows XP and Microsoft Windows 2003 Server. The system must be running a TCP/IP protocol stack on its network interface. The system must also be able to communicate with all the relevant Eventra components; this requires any intervening network routers to be multicastenabled. In order to use the API the application must include the following files: On the CLASSPATH: java-recording-api.jar Includes Java classes. which access the API using JNI. On the application PATH: JavaRecordingAPI.dll Includes JNI enabled C++ class which accesses the C++ API. ESapi.dll Includes C++ functions which provide recording functionality via the Eventra framework. framework.cfg Provides Configuration information that allows C++ API to communicate with Eventra Framework. This file should contain as a minimum: The location and port of the Eventra server, i.e.
[Framework] configDB address configDB port : 192.168.1.118 : 55000

CTI Provider section indicating which module to use, which should have a matching [nameComponent-Config] section on the server-side framework.cfg (where name is the module
Empathy Systems 2009. All rights reserved Page 5 of 29

January 2009

Eventra Java Recording API Guide v1.0

specified in the client framework.cfg), for each instance of the API that is to be run, it will specify which recorder/s it can talk to. e.g. (client-side)
[CTI Provider] module : CTIProvider1

(server-side)
[CTI Provider1Component-Config] noOfItems : 1 1: I_CONNECT, ALL, Recorder1

It is also recommended that the recorder is configured to send events to all clients. e.g. (server-side)
[Recorder] send events to all = Y

Empathy Systems 2009. All rights reserved

Page 6 of 29

January 2009

Eventra Java Recording API Guide v1.0

Notification Events
Communication between the client application and Eventra are asynchronous and completion codes of commands etc. are sent to the client as notification events. This API only supports the Recording Events returned by the Eventra framework. All event-based classes reside in the package com.tisl.eventra.recordingapi.event

Empathy Systems 2009. All rights reserved

Page 7 of 29

January 2009

Eventra Java Recording API Guide v1.0

Recording events are represented by the com.tisl.eventra.javarecordingapi.RecordingEvent class. This class is used by the client to pass information to and from the Framework. Each API method call will require different parameters to be set within this class and will also generate one or more Recording Events from the framework, each methods requirements are described later. There are more than one type of recording event, the type of recording event can be determined by using the getEvent() method on the RecordingEvent class, this will return an int which can be checked against the following constants defined in the RecordingAPI class:
// Recorder Events....... RECORD_STOP_SHORT=0x00010000 RECORD_STOP_VOX=0x00010001 RECORD_STOP_DTMF=0x00010002 RECORD_STOP_CTI=0x00010003 RECORD_HALT=0x00010004 RECORD_SHUTDOWN=0x00010005 RECORD_START_VOX=0x00010006 RECORD_START_DTMF=0x00010007 RECORD_START_CTI=0x00010008 RECORD_WAIT_VOX=0x00010009 RECORD_WAIT_DTMF=0x0001000A RECORD_WAIT_CTI=0x0001000B RECORD_FAIL_BAD_NAME=0x0001100C RECORD_NO_FREE_LICENCE=0x0001100D RECORDING_PROTECTED=0x0001000E RECORDING_UNPROTECTED=0x0001000F RECORD_START_FAILED=0x00011010 RECORD_STOP_FAILED=0x00011011 RECORD_TRANSFER=0x00010013 RECORD_HELD=0x00010016 RECORD_UNHELD=0x00010017 RECORD_CONFER=0x00010014 RECORD_CONFER_DROP=0x00010015 RECORD_TAGG_SUCCESS=0x00010012 RECORD_TAGG_FAIL=0x00011012 RECORD_MUTED=0x00010018

Empathy Systems 2009. All rights reserved

Page 8 of 29

January 2009

Eventra Java Recording API Guide v1.0

RECORD_UNMUTED=0x00010019 RECORD_PAUSED=0x0001001A RECORD_UNPAUSED=0x0001001B RECORD_MUTE_FAILED=0x00010028 RECORD_UNMUTE_FAILED=0x00010029 RECORD_PAUSE_FAILED=0x0001002A RECORD_UNPAUSE_FAILED=0x0001002B

Empathy Systems 2009. All rights reserved

Page 9 of 29

January 2009

Eventra Java Recording API Guide v1.0

API Functions
All API functions are defined as static methods within com.tisl.eventra.recordingapi.RecordingAPI class.

Empathy Systems 2009. All rights reserved

Page 10 of 29

January 2009

Eventra Java Recording API Guide v1.0

All methods other than open, close and getRecordingEvent are Asynchronous (i.e. non-blocking). For Asynchronous method calls, if no exception is thrown and the method completes normally then this means that a request has been sent to Eventra it does not indicate that the request was successful. Notification Events will be generated by the Eventra Framework which will confirm the success/failure of requests made. It is the Clients responsibility to retrieve the events and inspect them to identify the outcome. The getRecordingEvent method allows the client to retrieve the next queued event. Eventra recording channels are identified by their trunk or extension number (depending on the recorder hardware configuration). This is the channel PBX_Ext value as displayed in the Eventra client channel configuration screen. It is this value which must be passed in the relevant API calls to identify the recording channel. If an API call is made for an invalid channel or for a channel which is not accessible for any reason then a RECORD_FAIL_BAD_NAME type event will be generated for that channel. Each API method is described in detail below:

Empathy Systems 2009. All rights reserved

Page 11 of 29

January 2009

Eventra Java Recording API Guide v1.0

Open Connection open Initializes the CTI connection to Eventra.


public RecordingAPIHandle open(String clientName)

Parameters
clientName String used to identify this client in logs etc.

Returns
RecordingAPIHandle Handle for use in all other API calls.

Throws
RecordingAPiException unexpected error thrown by API. ConnectionFailedException connection to Eventra could not be made. BadParameterException clientName not specified.

This must be the first call made to the Eventra Recording API. This function will allocate and initialize the resources required to maintain a client connection to Eventra. A network connection is also established at this point. Subsequent calls to the API should use the RecordingAPIHandle returned by this method. Note that this method is synchronous and will not return until all the necessary connections have been made. No notification events will be generated as a result of this request. Please Note. Due to a limitation of the underlying C++ API, only one handle can be held at any one time per application, This handle should be retrieved by using this method when the application starts and released by using the close method (described below) when the application exits, any attempt to open another connection within the same application instance may produce unexpected results.

Empathy Systems 2009. All rights reserved

Page 12 of 29

January 2009

Eventra Java Recording API Guide v1.0

Close Connection close Closes the CTI connection.


public void close(RecordingAPIHandle handle)

Parameters
handle Handle returned by previous call to open method.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle not specified.

This method must be called when an application no longer requires the services of the Eventra API connection. All other Eventra components will be informed that the application has shut down. Once this call has been made the handle is no longer valid and any further calls to the API will fail. No notification events will be generated as a result of this request.

Empathy Systems 2009. All rights reserved

Page 13 of 29

January 2009

Eventra Java Recording API Guide v1.0

Get Recording Event getRecordingEvent


public RecordingEvent getRecordingEvent(RecordingAPIHandle handle, int timeout)

Parameters
handle timeout Handle returned by previous call to open method. Number of seconds to wait for an event before returning. If no event occurs within this period then WaitTimeoutException is thrown.

Returns
RecordingEvent The recording event returned by the framework.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle not specified. WaitTimeoutException No event has occurred within the specified timeout.

This synchronous method will block until a recording event is received from Eventra or a network failure occurs. The RecordingEvent returned will contain details of the generated event. The event attribute on the RecordingEvent should be matched to one of the recording event constants defined in the RecordingAPI class (e.g. RECORD_*) to determine the type of recording event that has been returned. The API has a maximum event queue size (currently 100). If the queue reaches the maximum -because the getRecordingEvent function has not been called often enough, then the oldest event on the queue will be discarded. See the Notification Events section above for more details on handling events and the event classes.

Empathy Systems 2009. All rights reserved

Page 14 of 29

January 2009

Eventra Java Recording API Guide v1.0

Start Recording startRecording Note that recording in Eventra is ultimately controlled by recording policies which specify the criteria which a call must satisfy for it to be recorded. Therefore even if an API startRecording request is successfully sent, the recording will be not be made if the call information does not satisfy an active recording policy.
public void startRecording (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle Handle returned by previous call to open method. evt RecordingEvent Containing the information needed to start a recording.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException no handle or insufficient event details specified to start a recording. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to start a recording on a particular Eventra channel as specified in the lineName attribute of the passed evt parameter. All information specified in the evt parameter will be tagged to the recording when it is inserted into the database. Possible notification events generated by this request include: RECORD_START_CTI RECORD_FAIL_BAD_NAME RECORD_FAIL_HARDWARE Recording has started Start recording failed because of an invalid channel name Start recording failed because channel hardware is faulty.

In addition, these RECORD_STOP events could occur any time after a recording has been started RECORD_STOP_CTI Recording has been stopped by an external stopRecording API call.

Empathy Systems 2009. All rights reserved

Page 15 of 29

January 2009

Eventra Java Recording API Guide v1.0

RECORD_STOP_VOX RECORD_STOP_DTMF RECORD_STOP_SHORT

Recording stopped by energy detection on a channel e.g. no voice detected. Recording stopped due to detection of a DTMF abort code. Recording discarded because it is less than the minimum allowed recording duration.

Empathy Systems 2009. All rights reserved

Page 16 of 29

January 2009

Eventra Java Recording API Guide v1.0

Stop Recording stopRecording Sends a request to stop a recording on a specified channel


public stopRecording(RecordingAPIHandle handle, String channel)

Parameters
handle channel Handle returned by previous call to open method. Name of recording channel to stop recording

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or channel not specified. ConnectionFailedException connection to Eventra could not be made.

Stops a recording on the specified Eventra channel. The recording will be saved and added to the Eventra database along with any tag information already provided (e.g. in startRecording or with tagCurrentCall methods). Possible events generated by this request, include: RECORD_STOP_CTI RECORD_FAIL_BAD_NAME RECORD_STOP_FAILED RECORD_STOP_SHORT Recording has stopped Request failed because of an invalid channel name Stop recording failed as channel is not recording. Recording has stopped but too short to store in DB.

Empathy Systems 2009. All rights reserved

Page 17 of 29

January 2009

Eventra Java Recording API Guide v1.0

stopRecordingDiscard
public void stopRecordingDiscard(RecordingAPIHandle handle, String channel)

Parameters
handle channel Handle returned by previous call to open method. Name of recording channel to stop recording

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or channel not specified. ConnectionFailedException connection to Eventra could not be made.

Stops a recording on the specified Eventra channel. The recording will be discarded and will not be added to the database. Possible events generated by this request, include: RECORD_STOP_DISCARD RECORD_FAIL_BAD_NAME RECORD_STOP_FAILED RECORD_STOP_SHORT Recording has stopped & been discarded. Request failed because of an invalid channel name Stop recording failed as channel is not recording Recording has stopped but too short to store in DB.

Empathy Systems 2009. All rights reserved

Page 18 of 29

January 2009

Eventra Java Recording API Guide v1.0

Tag Call Sends a request to add information to a recording. tagCall


public void tagCall (RecordingAPiHandle handle, String channel, String digits, String campaign, String host)

Parameters
handle channel digits campaign Handle returned by previous call to open method. Name of channel to tag recording on. Digits to associate with the call Campaign identifier, typically this will be the DDI digits of an incoming call Any text information to add to the call

host

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or channel not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to tag information to a recording in progress on the specified Eventra channel. If the specified channel is not being recorded then recording will be started on that channel. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_START_CTI Request failed because of an invalid channel name Recording tagged.

Empathy Systems 2009. All rights reserved

Page 19 of 29

January 2009

Eventra Java Recording API Guide v1.0

tagCurrentCall
public void tagCurrentCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. The recording event which contains the call tag info to be applied to the current call.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or channel not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to tag information to a recording in progress on the specified Eventra channel. The information will be applied to the call currently recording on the lineName attribute specified in RecordingEvent. Any non-blank attributes in the event will over-write any existing values stored by Eventra for that call. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_START_CTI Request failed because of an invalid channel name Recording tagged.

Empathy Systems 2009. All rights reserved

Page 20 of 29

January 2009

Eventra Java Recording API Guide v1.0

tagFinishedCall
public void tagFinishedCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. The recording event which contains the call tag info to be applied to the finished call.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or channel not specified. ConnectionFailedException connection to Eventra could not be made.

This function is used to add call information to the database entry for a previously recorded call. The call to be tagged must be specified by the lineName (channel) and dateTime (start date/time) attributes passed in the RecordingEvent class. Any non-blank fields in the RecordingEvent will over-write any existing values for that call. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME Request failed because of an invalid channel name

Empathy Systems 2009. All rights reserved

Page 21 of 29

January 2009

Eventra Java Recording API Guide v1.0

Transfer Call callTransferred


public void callTransferred (RecordingAPIHandle handle, RecordingEvent evt, String fromExt, String fromAgent)

Parameters
handle evt Handle returned by previous call to open method. The recording event which contains the information for the call to be transferred to. Extension number of the call to be transferred. Agent ID. of the call to be transferred.

fromExt fromAgent

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or evt and/or fromExt and/or fromAgent not specified. ConnectionFailedException connection to Eventra could not be made.

This function notifies Eventra that a call has been transferred from one extension to another. If the call is being recorded the recording will be stopped. A new recording will be started for the transferred call. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_STOP_CTI RECORD_START_CTI Request failed because of an invalid channel name Recording has stopped for call being transferred. Recording has started for new transferred call.

Empathy Systems 2009. All rights reserved

Page 22 of 29

January 2009

Eventra Java Recording API Guide v1.0

PCIDSS PCI DSS is a new directive from Barclaycard that is being adopted worldwide. It states that the 3 digit security code cannot be stored anywhere. To facilitate this it is possible to mute or pause a call. If the call is muted then it will be tagged with a PCIDSS Mute category for the duration of the call or if the call is subsequently un-muted. This category will prevent the tagged period of the call being listened to by a user, Privileged users with supervisor rights will be able to temporarily un-mute the call but cannot remove the tag. If a call is paused, then it will be tagged with a PCIDSS Pause category for that period until the call is subsequently restarted or the duration of the call. In this instance the paused section of the call will not be available to any user.

muteCall
public void muteCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. Identifies the call to be muted using the lineName and extension attributes.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or lineName and ext not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to mute a recording in progress. The mute will be applied to the call currently identified by the specified lineName and extension. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_MUTED RECORD_MUTE_FAILED Request failed because of an invalid channel name Recording muted. Mute on Recording has failed.

Empathy Systems 2009. All rights reserved

Page 23 of 29

January 2009

Eventra Java Recording API Guide v1.0

unMuteCall
public void unMuteCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. Identifies the call to be un-muted using the lineName and extension attributes.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or linename and ext not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to un-mute a recording in progress which has been previously muted. The un-mute will be applied to the call identified by the specified lineName and extension. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_UNMUTED RECORD_UNMUTE_FAILED Request failed because of an invalid channel name Recording un-muted. Un-Mute on Recording has failed

Empathy Systems 2009. All rights reserved

Page 24 of 29

January 2009

Eventra Java Recording API Guide v1.0

pauseCall
public void pauseCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. Identifies the call to be paused using the lineName and extension attributes.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or linename and ext not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to pause a recording in progress. The pause will be applied to the call identified by the specified lineName and extension. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_PAUSED RECORD_PAUSE_FAILED Request failed because of an invalid channel name Recording Paused. Pause on Recording has failed

Empathy Systems 2009. All rights reserved

Page 25 of 29

January 2009

Eventra Java Recording API Guide v1.0

restartCall
public void restartCall (RecordingAPIHandle handle, RecordingEvent evt)

Parameters
handle evt Handle returned by previous call to open method. Identifies the call to be restarted using the lineName and extension attributes.

Throws
RecordingAPiException unexpected error thrown by API. BadHandleException Invalid handle (e.g. open not yet called, or handle already closed). BadParameterException handle and/or linename and ext not specified. ConnectionFailedException connection to Eventra could not be made.

Initiates a request to restart a recording in progress which has been previously paused. The restart will be applied to the call identified by the specified lineName and extension. Possible events generated by this request, include: RECORD_FAIL_BAD_NAME RECORD_UNPAUSED RECORD_UNPAUSE_FAILED Request failed because of an invalid channel name Recording Restarted. Restart on Recording has failed

Empathy Systems 2009. All rights reserved

Page 26 of 29

January 2009

Eventra Java Recording API Guide v1.0

Appendix A Example
An example of starting and stopping a recording:
import import import import com.tisl.eventra.recordingapi.RecordingAPI; com.tisl.eventra.recordingapi.RecordingAPIHandle; com.tisl.eventra.recordingapi.event.RecordingEvent; com.tisl.eventra.recordingapi.exception.*;

public class ExampleStartAndStopRecording { // default private constructor. private ExampleStartAndStopRecording() { } public static void main(String []args) { RecordingAPIHandle apiHandle=null; int timeout=30; // event timeout. System.out.println("started ExampleStartAndStopRecording ..."); // open a connection to Recording API. try { apiHandle = RecordingAPI.open("example client"); try { // setup the call info and start recording. RecordingEvent callInfo = new RecordingEvent(); callInfo.setLineName("4101"); callInfo.setExt("4101"); callInfo.setAgent("5422"); callInfo.setDialledDigits("01883 343009"); callInfo.setDirection(RecordingAPI.CALL_DIRECTION_INBOUND); callInfo.setHost("api test call"); RecordingAPI.startRecording(apiHandle, callInfo); /* get next recording event to confirm start, timeout after 30 seconds. */ RecordingEvent recEvt = RecordingAPI.getRecordingEvent(apiHandle, timeout); if (recEvt!=null && recEvt.getEvent()==RecordingAPI.RECORD_START_CTI) { System.out.println("Started recording partcallid="+recEvt.getAppPartCallId()+" on "+recEvt.getLineName()); // now stop recording. try { RecordingAPI.stopRecording(apiHandle, recEvt.getLineName()); // get event to confirm stop. RecordingEvent recEvt2= RecordingAPI.getRecordingEvent(apiHandle,timeout); if (recEvt2!=null && recEvt2.getEvent()==RecordingAPI.RECORD_STOP_CTI) { System.out.println("Stopped recording partcallid="+recEvt2.getAppPartCallId()+" on "+recEvt2.getLineName()); } else {

Empathy Systems 2009. All rights reserved

Page 27 of 29

January 2009

Eventra Java Recording API Guide v1.0


System.out.println("Stop failed, expected event not returned."); } } catch (RecordingAPIException e) { System.out.println("Stop failed: "+e); } } else { System.out.println("Start failed, expected event not returned."); } } catch (RecordingAPIException e) { System.out.println(" failed to start a recording: "+e); } } catch (RecordingAPIException e) { System.out.println("Failed to connect to Eventra Recording API: "+e); } finally { // ensure connection is closed on exit. if (apiHandle!=null) { try { RecordingAPI.close(apiHandle); } catch (RecordingAPIException e) { System.out.println("failed to close API connection: "+e); } } } System.out.println("completed ExampleStartAndStopRecording."); } }

Empathy Systems 2009. All rights reserved

Page 28 of 29

January 2009

Potrebbero piacerti anche