CCT Open Interfaces SDK

Tutorial 3 C - Detect Incoming Calls and Retrieve Information

1. Introduction. 1

2. Use Events to detect that an incoming call has arrived at a terminal and retrieve the calledAddress and callingAddress from the Contact Service. 2

Description of Tutorial 2

Notes about this tutorial 2

Step 1: Updating the local hosts file. 4

Step 2: Import the Source Code. 5

Step 3: Changes to the Source Code. 7

Step 4: Running the Sample Code. 11

Step 5: Looking at some of the TCP packets. 16

 

 

1. Introduction

The goal of this tutorial is to show how the client can extract information from events received and go on to query more information. In this tutorial, we will register for TerminalConnection RINGING events and when the client receives one of these events, we will extract the contact ID from the event received and use it to send a GetCallingAddressRequest and GetCalledAddressRequest to find out who made and received the call. Once again, we will look in detail at some of the XML packets that get sent and received.

 

 

2. Use Events to detect that an incoming call has arrived at a terminal and retrieve the calledAddress and callingAddress from the Contact Service

 

Description of Tutorial

 

This tutorial describes how to utilise the features provided by the SOA CCT Web Services. It demonstrates how to subscribe for TerminalConnection RINGING events and to retrieve the calledAddress and callingAddress from the Connection Service. We will also use a tool to capture TCP/IP packets and display what some of the specific XML packages look like.

The main procedures of this tutorial are:

Step1: Updating the local hosts file  

Step 2: Import the Source Code  

Step 3: Changes to the Source Code  

Step 4: Running the Sample Code  

Step 5: Looking at some of the TCP packets

This tutorial utilises the Session service and Connection Service to demonstrate this functionality. We will use a program called soapUI to send and receive SOAP requests and responses.

Please download the source code here.

Notes about this tutorial

The SOA Web Services must be installed and running on an available server

You must determine exactly where or how you want to implement the example code shown in these tutorials in your own application.

To instigate events being received by the consumers, CCT Ref client can be used to login and logout agents, agents going ready/not ready, creating contacts, answer, hold and unhold those contacts.

This tutorial uses a program called soapUI 4.5.1 2.05 to send and receive SOAP requests and responses.

 

 

 

Step 1: Updating the local hosts file

 

1.      Open up the hosts file and map the host name of your server to an IP address

 

 

 

Step 2: Import the Source Code

 

To import the project zip file:

1.      Open Eclipse IDE

2.      Select File > Import > Existing Projects into workspace

3.      Select the project zip file

4.      Press the finish button

 

 

 

 

 

 

Step 3: Changes to the Source Code

 

[Refer to NotificationProducerSubscribe.java in the source of the sample project]

1.      NotificationProducerSubscribe.java

A.      We create a new contactService object.

Step3

B.      We instantiate the contactService.

Step3_2

C.      We pass the new contactService object into the Consumer2Impl class

Step3_3

D.     We subscribe for Ringing Terminal Connection events

Step3_4

 

[Refer to Consumer2Impl.java in the source of the sample project]

2.      Consumer2Impl.java

A.      We create a new ContactService object, and make it equals to the received ContactService object being passed into the constructer.

C2I

B.      In the switch, we catch all Terminal Connection State Events and pass them to the method printTerminalConnectionStateEventTypeDetails()

C2I_2

C.     In the method printTerminalConnectionStateEventTypeDetails(), we print out the appropriate details

C2I_3

 

 

 

Step 4: Running the Sample Code

 

1.      Start the SmartSniff program

Code sample: Here is a Sample of some of the TCP packages obtained

 

2.      Run the Sample Code. The main class to run is Sample.run.TestNotifications. Please make sure to update the variables at the top of the class.

 

3.      Here is a sample of the output of the program

 

4.      Wait for Agents to log in and originate calls to other agents. Any changes will be printed out to the console and recorded by SmartSniff

 

 

 

 

 

Step 5: Looking at some of the TCP packets

 

Code sample: GetCalledAddressRequest.xml

 

 

Code sample: GetCalledAddressResponse.xml

 

Code sample: GetCallingAddressRequest.xml

 

Code sample: GetCallingAddressResponse.xml