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

6 Multimedia Messaging

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

About the Multimedia Messaging Interface

Applications use the RESTful Multimedia Messaging interface to send a multimedia message (MMS) and to fetch information on MMSs that have been received for the applications and stored on Services Gatekeeper.

They use the interface to fetch those messages, get delivery status on sent messages, and start and stop a notification.

The actual message is sent as an attachment. See "Headers for Multipart Messages with Attachments" for more information.

In order for an application to be informed of an MMS that has been received for a party or a delivery receipt for a message sent, the application includes an application endpoint address for such delivery notifications in the body of the request message. This address resides on a publish/subscribe server. For more information, 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/multimedia_messaging/index.html

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


Send Message

The Send Message operation delivers a multimedia message.

To send a multimedia (MMS) message, provide the SIP-formatted URI of the addresses which the must receive the message in the request body. If there is to be a charge for the messaging, the request body should contain the required charging object. If the sender requires a delivery receipt, specify the required parameters for the receipt and the SIP formatted URI address of the sender. Also, a priority value, and a subject line can be provided in the request body.

If the Send Message operation successful, the response header will contain the URI of the pub-sub server and the request identifier which is also provided in the response body for this operation.

Authorization

Basic

HTTP Method

POST

URI

http://host:port/rest/multimedia_messaging/messages

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

Request Header

The request headers depend on the type of message:

See Example 6-1 for a listing of both types of headers.

Message Part Content

The Message Part Content for the Send Message operation accepts the following parameters:

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

{
  "addresses": ["URI"],
  "charging": {
    "description": "String",
    "amount": "BigDecimal",
    "code": "String",
    "currency": "String"
  },
  "priority": "Default|Low|Normal|High",
  "receiptRequest": {
    "correlator": "String",
    "endpoint": "URI",
    "interfaceName": "String"
  },
  "senderAddress": "String",
  "subject": "String"
}

Response Header

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

http://host:port/rest/multimedia_messaging/delivery_status/result

where, result is the string identifier for the request that is returned in the response body.

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

The body of the response contains the request identifier returned in the Location header field of the response message as value for result.

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

{"result": "String"}

Examples

Example 6-1 Send Message Requests

This section contains two examples. The first example shows a POST method with a message.

POST /rest/multimedia_messaging/messages HTTP/1.1
X-Session-ID: app:-7603991555266551180
Authorization: Basic ZG9tY1uX3VzZXI6ZG9tYWluX3VzZXI=
X-Param-Keys:
X-Param-Values:
User-Agent: Jakarta Commons-HttpClient/3.0
Host: localhost:8001
Content-Length: 253
Content-Type: application/json

{
  "addresses":["tel:8765","tel:7654","tel:6543"],
  "subject":"Meeting starts at 2 p.m.",
  "priority":null,
  "senderAddress":"tel:1234",
  "charging":null
  "receiptRequest":
         {
           "correlator":"981234",
           "endpoint":"http://10.182.100.229:13444/jaxws/MessageNotification",
           "interfaceName":"interfaceName",
         }
 }

The second example shows a POST method with a multipart message. Note the use of header fields to describe the content and the boundary attribute to distinguish the message parts.

POST /rest/multimedia_messaging/messages HTTP/1.1
X-Session-ID: app: -123456789012346789
Authorization: Basic ZG9tY1uX3VzZXI6ZG9tYWluX3VzZXI=
X-Param-Keys:
X-Param-Values:
User-Agent: Jakarta Commons-HttpClient/3.0
Host: localhost:8001
Content-Length: 1215
Content-Type: multipart/form-data; boundary=kboiiFPAakDPYKeY7hBAW9I5c0rT48

--kboiiFPAakDPYKeY7hBAW9I5c0rT48
Content-Disposition: form-data; name="messagePart"
Content-Type: application/json; charset=US-ASCII
Content-Transfer-Encoding: 8bit

{
  "addresses":["tel:8765","tel:7654","tel:6543"],
  "subject":"Hello World",
  "priority":null,
  "senderAddress":"tel:1234",
  "charging":null,
  "receiptRequest":
         {
           "correlator":"981234",
           "endpoint":"http://10.182.100.229:13444/jaxws/MessageNotification",
           "interfaceName":"interfaceName"
         }
 }
--kboiiFPAakDPYKeY7hBAW9I5c0rT48
Content-Disposition: form-data; name="Attachment-txt-1"
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit

Oracle Communications Services Gatekeeper is a powerful, flexible, secure interface which provides a simple way for application developers to include telephony-based functionality in their software applications and guarantee the security, stability, and performance required by network operators and demanded by their subscribers.
--kboiiFPAakDPYKeY7hBAW9I5c0rT48

Get Received Messages

The Get Received Messages operation retrieves an array of network-triggered messages that have arrived at Services Gatekeeper.

The request body for Get Received Messages contains the registration identifier necessary to retrieve the required MMSs intended for the application and, optionally, it may also contain a priority for the retrieval. The registration identifier should have been set up with the off-line provisioning step completed earlier.

If the Get Received Messages operation is successful, the response body will contain the data about the message. If the content of the message is pure ASCII, the response body contains the message. Otherwise the response body contains an identifier that is used to fetch the actual message.

Authorization

Basic

HTTP Method

POST

URI

http://host:port/rest/multimedia_messaging/receive-messages

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 Get Received Messages operation accepts the following parameters:

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

{
  "registrationIdentifier": "String",
  "priority": "Default|Low|Normal|High"
}

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

The response body contains an array of structures as the value for result. Each element in the array contains values for the following parameters.

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

{"result": [{
  "messageServiceActivationNumber": "String",
  "priority": "Default|Low|Normal|High",
  "senderAddress": "URI",
  "dateTime": "Calendar",
  "message": "String",
  "messageIdentifier": "String",
  "subject": "String"
}]}

Get Message

The Get Message operation fetches a network-triggered message for the application from Services Gatekeeper.

To get a message, provide the appropriate message identifier in the URI for the GET method.

The actual message is returned as an attachment.

Authorization

Basic

HTTP Method

GET

URI

http://host:port/rest/multimedia_messaging/message/${messageRefIdentifier}

where:

Request Header

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

Request Body

There is no request body.

Response Header

The MIME-type for the Content-Type header field is multipart/mixed.

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.


Get Message Delivery Status

The Get Message Delivery Status operation retrieves the delivery status of a previously sent message.

This operation is valid only if the correlator callback reference was not defined in the receiptRequest attribute of the initial request to send the MMS message. In such a scenario, Services Gatekeeper stores the delivery status for a configurable period of time. (If the callback reference correlator is defined in the receiptRequest attribute of the initial request to send the MMS message, Services Gatekeeper will invoke the Notify Message Delivery Receipt operation and discard the delivery status information.)

The request header for the Get Message Delivery Status operation contains the request identifier from result object of the initial request.

If the Get Message Delivery Status operation is successful, the response body will contain the SIP-formatted URI from the address field in the Send Message request and corresponding delivery status for the message.

Authorization

Basic

HTTP Method

GET

URI

http://host:port/rest/multimedia_messaging/delivery_status/${requestIdentifier}

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

The response body contains an array of structures as the value for result. Each element in the array contains values for the following parameters.

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

{"result": [{
  "address": "URI",
  "deliveryStatus": "DeliveredToTerminal|DeliveryUncertain|DeliveryImpossible|MessageWaiting|DeliveredToNetwork|DeliveryNotificationNotSupported"
}]}

Start Message Notification

The Start Message Notification operation starts a notification for the application.

To set up a multimedia message notification, provide the criteria which will trigger notifications and a reference object for the delivery of the notifications. The criteria can be a string which, when matched, could be the notification of an MMS received or of a delivery receipt. 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 Message 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/multimedia_messaging/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 is a nested JSON object containing the following parameters:

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

{
  "messageServiceActivationNumber": "URI",
  "reference": {
    "correlator": "String",
    "endpoint": "URI",
    "interfaceName": "String"
  },
  "criteria": "String"
}

Response Header

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

http://host:port/rest/multimedia_messaging/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 for Message Reception (notifyMessageReception)

When a multimedia message is successfully retrieved by the called party and the value for criteria in the request body is notifyMessageReception, Services Gatekeeper sends a nested JSON data object to the endpoint address.

This nested JSON object contains the following as the value of the attribute name notifyMessageReception:

The notification data object delivered to the endpoint address when the criteria is notifyMessageReception is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:

{"notifyMessageReception": {
  "correlator": "String",
  "message": {
    "messageServiceActivationNumber": "String",
    "priority": "Default|Low|Normal|High",
    "senderAddress": "URI",
    "dateTime": "Calendar",
    "message": "String",
    "messageIdentifier": "String",
    "subject": "String"
  }
}}

Notification Data Object for MMS Delivery Receipt (notifyMessageDeliveryReceipt)

When a multimedia message is successfully retrieved by the called party and the value for criteria in the request body is notifyMessageDeliveryReceipt, Services Gatekeeper sends a nested JSON data object to the endpoint address.

This nested JSON object contains the following as the value of the attribute name notifyMessageDeliveryReceipt:

The notification data object delivered to the endpoint address when the criteria is notifyMessageDeliveryRecipt is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:

{"notifyMessageDeliveryReceipt": {
  "correlator": "String",
  "deliveryStatus": {
    "address": "URI",
    "deliveryStatus": "DeliveredToTerminal|DeliveryUncertain|DeliveryImpossible|MessageWaiting|DeliveredToNetwork|DeliveryNotificationNotSupported"
  }
}}

Stop Message Notification

The Stop Message Notification operation terminates a previously set up multimedia message notification for the application.

To stop a previously set up MMS notification, provide the correlator for the notification passed earlier in the Start Message Notification request.

There is no request or response body for the Stop Message 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/multimedia_messaging/notification/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.

Examples

Example 6-2 Stop Message Notification Request

DELETE /rest/multimedia_messaging/notification/6789 HTTP/1.1
X-Session-ID: app:4130997928482260925
Authorization: Basic ZG9tYWluX3VzZXI6ZG9tYWluX3VzZXI=
X-Param-Keys:
X-Param-Values:
User-Agent: Jakarta Commons-HttpClient/3.0
Host:10.182.100.218.8002

Example 6-3 Stop Message Notification Response

HTTP/1.1 204 No Content
Connection: close
Date: Thu, 04 Nov 2101 09:59:05 GMT
Content-Length: 0
X-Plugin-Param-Keys:
X-Plugin-Param-Values:
X-Powered-By: Servlet/2.5 JSP/2.1