Tutorial 3 C - Detect Incoming Calls and Retrieve Information
Step 1: 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
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. B. We instantiate the contactService. C. We pass the new contactService object into the Consumer2Impl class D. We subscribe for Ringing Terminal Connection events
[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. B. In the switch, we catch all Terminal Connection State Events and pass them to the method printTerminalConnectionStateEventTypeDetails() C. In the method printTerminalConnectionStateEventTypeDetails(), we print out the appropriate details |
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
|