Skip Headers
Oracle® Communications Services Gatekeeper RESTful Application Developer's Guide
Release 5.0

Part Number E16621-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

4 Call Notification

This chapter describes the operations in the Call Notification interface of the RESTful Web Services provided in Oracle Communications Services Gatekeeper.

About the Call Notification Interface

Applications use the RESTful Call Notification interface to set up and remove call notifications which inform the application about the particular state of a call (such as busy, unreachable, and so on).

Additionally, applications use this interface to set up and remove call direction notifications (which require the application to provide further directions on handling a call that is in a particular state).

For such operations, the application client subscribes to and uses the Bayeux channel to which Services Gatekeeper is subscribed. The application provides the Bayeux channel name as the location for Services Gatekeeper to publish the notifications that the application client requires. See "Notifications and Publish/Subscribe".

REST Service Descriptions Available at Run-time

When the Administration Server for your Services Gatekeeper domain is in the running state, the REST service descriptions of these operations can be found at

http://host:port/rest/call_notification/index.html

where host and port are the host name and port of the machine on which Services Gatekeeper is installed.

Common Data

The details of a call event about which the application receives information are identical whether the called party was busy Busy, not reachable NotReachable, did not answer NoAnswer, and a call was being attempted CalledNumber.

These details are provided to the application in a JSON object which contains the following parameters:

  • calledParty. String. Required. The address (URI) of the party to whom the call is made.

  • callingParty. String. Required. The address (URI) of the party making the call.

  • correlator. String. Required. The correlator used to identify the notification and provided in the Start Call Notification request.

  • callingPartyName. String. Optional. The name of the party making the call.

These details are specified in the following structure:

{
  "calledParty": "URI",
  "callingParty": "URI",
  "correlator": "String",
  "callingPartyName": "String"
}}

You will find this object in the following operations:


Start Call Notification

The Start Call Notification operation sets up call notifications to a specified endpoint address for call events associated with the addresses specified in the request.

To set up a call notification, provide the SIP-formatted URI of the addresses for which the application must receive notifications, the criteria that will trigger notifications, and a reference object for the delivery of the notifications. The criteria can be one or more of four possible call events (Busy, NotReachable, NoAnswer, and CalledNumber). If you do not specify any value for criteria, each of the four call events will trigger a notification.

The reference object (also a JSON object) contains the correlator for the notification, the endpoint address to which the notifications must be sent and, optionally, the interface name (a string to identify the notification).

If the Start Call Notification request is successful:

When the application receives such a response, it must access the endpoint address to retrieve the specific call event notifications.

Authorization

Basic

HTTP Method

PUT

URI

http://host:port/rest/call_notification/call_notification

where host and port are the host name and port of the machine on which Services Gatekeeper is installed.

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

The request body for Start Call Notification accepts the following parameters:

The request body for this operation is represented by the following JSON structure, where the value part of each name/value pair indicates its data type:

{
  "addresses": ["String"],
  "reference": {
    "correlator": "String",
    "endpoint": "URI",
    "interfaceName": "String"
  },
  "criteria": ["Busy|NotReachable|NoAnswer|CalledNumber"]
}

Response Header

The Location header field contains the URI of the publish/subscribe server as:

http://host:port/rest/call_notification/notifications

If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

There is no response body. The appropriate notifications (described below) are sent to the endpoint address provided by the application in the request body of this operation.

Notification Data Object Delivered to Bayeux Channel Name

Services Gatekeeper delivers the appropriate notification for each of the following call events:


Stop Call Notification

The Stop Call Notification operation generates a request that terminates a previously set up call notification.

To stop a previously set up call notification, use the appropriate correlator in the DELETE method for this operation. This correlater should have been specified earlier in the request body of the Start Call Notification operation.

There is no request or response body for the Stop Call Notification operation. If the request fails, the body of the error response will contain the identifier for the notification and the type of exception.

Authorization

Basic

HTTP Method

DELETE

URI

http://host:port/rest/call_notification/call_notification/${correlator}

where:

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

There is no request body.

Response Header

Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

There is no response body.


Start Call Direction Notification

The Start Call Direction Notification operation initiates notifications to a specified endpoint for call events associated with the addresses specified in the request. The notifications provided by Services Gatekeeper will contain the information necessary for the application to provide instructions on directing the call.

To set up a call direction notification, provide the SIP-formatted URI of the addresses for which the application must receive notifications, the criteria that will trigger notifications, and a reference object for the delivery of the notifications. The criteria can be one more of four possible call events (Busy, NotReachable, NoAnswer, and CalledNumber. If you do not specify any value for criteria, each of the four call events will trigger a notification.

The reference object (also a JSON object) contains the correlator for the notification, the endpoint address (a specific Bayeux channel name) to which the call direction notifications must be sent and, optionally, the interface name (a string to identify the notification).

If the Start Call Direction Notification request is successful:

When it receives such a response, the application:

  1. Retrieves the notification data object from the endpoint address. See "Notification Data Object Requesting Instruction from Application".

  2. Sets up a data object with instructions on how the call must be handled (and charged); and an address to which the call must now be routed. See "Call-Handling Instructions".

  3. Publishes this data object to the reply-to private channel address it received. See "Application's Call-Handling Response to Services Gatekeeper".

Authorization

Basic

HTTP Method

PUT

URI

http://host:port/rest/call_notification/call_direction

where host and port are the host name and port of the machine on which Services Gatekeeper is installed.

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

The request body for the Start Call Direction Notification accepts the following parameters:

The request body for this operation is represented by the following JSON structure, where the value part of each name/value pair indicates its data type:

{
  "addresses": ["String"],
  "reference": {
    "correlator": "String",
    "endpoint": "URI",
    "interfaceName": "String"
  },
  "criteria": ["Busy|NotReachable|NoAnswer|CalledNumber"]
}

Response Header

The Location header in the response displays the URI of the publish/subscribe server:

http://host:port/rest/call_notification/notifications

The application must access this location to retrieve the notification or delivery status information about the request.

If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

There is no response body.

The endpoint address holds the appropriate notification data object containing information on the type of call event when there is a match for the criteria value specified in the request body of this operation.

Notification Data Object Requesting Instruction from Application

When the application needs to take further action on a call event, Services Gatekeeper provides the application with a corresponding notification data object for the application to act upon.

It places this notification data object at the endpoint address mentioned above. The notification data object is a nested JSON object containing the following parameters:

Call-Handling Instructions

Whether the call event is Busy, NotReachable, NoAnswer or CalledNumber, the application needs to specify the following:

Application's Call-Handling Response to Services Gatekeeper

The application sends the appropriate instruction (described in the previous section) as the response to the reply-to address it had retrieved earlier from the endpoint address. See "Notification Data Object Requesting Instruction from Application".

The possible responses that the application provides to Services Gatekeeper are:


Stop Call Direction Notification

The Stop Call Direction Notification operation terminates a previously set up call direction notification.

To stop a previously set-up call direction notification, use the appropriate correlator in the DELETE request for this operation. This correlater should have been specified earlier in the request body of the Start Call Direction Notification operation.

There is no request or response body for the Stop Call Direction Notification operation. If the request fails, the body of the error response will contain the identifier for the notification and the type of exception.

Authorization

Basic

HTTP Method

DELETE

URI

http://host:port/rest/call_notification/call_direction/${correlator}

where:

Request Body

There is no request body.

Response Header

Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

There is no response body.