The Metaswitch Call Notification API is a prototype call notification API based on a subset of the OMA Call Notification API. In particular the Metaswitch Call Notification API implements call event and call direction notifications with a minor addition to support annoucements.
See: {introduction-to-rest-and-openapi} for an introduction to REST (REpresentational State Transfer) APIs. |
Capabilities of the Call Notification API
The SIP AS (MSW-CN client), in the following diagram, receives a SIP message from the S-CSCF and determines if a call event or call direction should be generated (in terms of call leg, point-in-call and so on), The MSW-CN server sends a notification request to an MSW-CN server if a call event or call direction is required.
MSW-CN client MSW-CN server Notification |
There are two types of notification made by an MSW-CN client to an MSW-CN server.
-
Call Event: For call event notifications
-
An MSW-CN client notifies an MSW-CN server of events on a call/session.
Call processing continues.
This is analogous to an SSF sending event-reports, armed with notify-&-continue, to an SCF
-
-
Call Direction: For call direction notifications, where the client waits for instructions in the notification response.
-
An MSW-CN client notifies an MSW-CN server of events on a call/session.
The MSW-CN client blocks ongoing call processing and waits for instructions from the MSW-CN server (in the response to the notification).
This is analogous to an SSF sending event-reports, that had been armed with suspend, to an SCF where the BCSM blocks waiting-for-instructions.
-
The {arch-rest-api-framework } generates an OpenAPI specification description of MSW-CN into Resource Adaptor Type that Rhino applications use.
The API definition is: msw-call-notification-rest-api/msw-call-notification-api/src/api.yaml .
|
The following sections illustrate aspects of the MSW-CN API and how it is realized in Java va the REST API framework.
Call Event and Call Direction Notifications
The YAML description below shows that an HTTP POST request, with a request URL including /callevent/notification
corresponds to a call event notification.
The body of the request is a CallEventNotification
JSON object.
A 200 OK
response indicates the request was received.
Any other response corresponds to an error.
/callevent/notification:
post:
summary: A new Call Event notification
operationId: callEventNotification
tags:
- notification
requestBody:
required: true
description: call event notification
content:
application/json:
schema:
$ref: "#/components/schemas/CallEventNotification"
responses:
'204':
description: |
The 204 No Content HTTP status code is returned if the data was received successfully
default:
description: unexpected error
The YAML description below shows that an HTTP POST request, with a request URL including /calldirection/notification
corresponds to a call direction notification.
The body of the request is a CallEventNotification
JSON object.
A 200 OK
response indicates the request was received successfully. The body of the response is a Action
JSON object.
Any other response corresponds to an error.
/calldirection/notification:
post:
summary: A new Call Direction notification
operationId: callDirectionNotification
tags:
- notification
requestBody:
required: true
description: call direction notification
content:
application/json:
schema:
$ref: "#/components/schemas/CallEventNotification"
responses:
'200':
description: |
The 200 OK HTTP status code is returned if the data was received successfully.
The response body contains the request 'Action to take'
content:
application/json:
schema:
$ref: '#/components/schemas/Action'
default:
description: unexpected error
The REST API framework generates a number of Java interfaces, enums and classes from the YAML specification.
For example, an application uses the NotificationApi
below to create Call Direction and Call Event notification requests.
package com.opencloud.openapi.demo.msw_cn.api;
import com.opencloud.slee.rest.common.*;
import com.opencloud.openapi.demo.msw_cn.model.*;
public interface NotificationApi {
// Create a RestRequestBuilder for request: CallDirectionNotification
RestRequestBuilder createCallDirectionNotificationRequest(
CallEventNotification callEventNotification);
// Create a RestRequestBuilder for request: CallEventNotification
RestRequestBuilder createCallEventNotificationRequest(
CallEventNotification callEventNotification);
// Send a request
OutgoingRestActivity sendRequest(
RestRequestBuilder requestBuilder) throws IOException;
}
A concrete example showing how the MSW-CN API can be used can be seen in See: Sending CallDirection and CallEvent notification requests for a code excerpt showing sending a Call Direction request |
When Notifications can be Sent
Notifications are sent at certain points in the basic call model. These are:
|
YAML CallEvents Enum
YAML CallNotificationTypes Enum
YAML AddressDirection Enum
|
Actions Available in a Call Direction Response
A Call Direction response contains an Action object in the response body. The action describes the actionToPerform
.
|
YAML Action Component
YAML ActionValues Enum
|