GTI Networks Messaging Gateway API

The GTI Messaging Gateway allows the UC platform of a GTI Networks Extend partner to act as the PSTN messaging (next hop) peer for the sending and receiving of SMS and MMS messages to and from a GTI Networks Extend subscriber/SIM.

  • The Messaging Gateway provides a simple, synchronous HTTPs POST-based API for sending and receiving methods, and also media handling methods for MMS messages.

  • The Messaging Gateway assumes that the partner has implemented appropriate interfaces to a PSTN carrier for the DIDs/numbers they intend to use with GTI Networks Extend SIMs and messaging.

    • Partners wishing to use the Messaging Gateway must therefore implement a two-sided process for messaging:

    • Partner to PSTN carrier interface (typically SMPP or HTTP) for subscriber DID’s

    • Partner to GTI Messaging Gateway interface for sending/receiving messages to/from these DID’s to/from SIM’s.

?⇒☁️ SMS/MMS Origination Message Flow

The following picture shows how an SMS/MMS message origination flows from the GTI Extend subscriber, through the GTI Networks Extend Platform and the UC Partner's UCaaS Platform, to route over the PSTN to the destination party.

☁️⇒? SMS/MMS Term Network Flow

The following picture shows how an SMS/MMS message termination flows from the PSTN, through the UC Partner's UCaaS Platform and the GTIGLOBAL Networks Extend Platform, to deliver to the GTI Extend's mobile device.

GTI Messaging Gateway - Configuration

The GTI Messaging Gateway is configured as part of the GTI Networks Extend platform. The Partner must implement an interface to the  GTI Provisioning API and manually configure the gateway using the GTI Networks Control Panel.

The configuration items include the following items that must be configured per GTI Messaging Gateway.

  • Primary URL - Required - The GTI Messaging Gateway uses this URL to send the HTTPS requests to the UCaaS Server. This URL is always the first option used to deliver an HTTPS Message.

  • Secondary URL - Optional - If the Primary Server returns an error. The GTI Messaging Gateway may try to deliver the message to the secondary server. See the section on Response Code Handling to understand when the secondary server is used.

  • Client Secret - Required - Any Request delivered to the GTI Messaging Gateway must contain an Bearer Authorization Header containing this token.

  • Security Token - Required - Any Request delivered to the UCaaS server must contain an Bearer Authorization Header containing this token.

? Store And Forward

In the case where a message fails to deliver to the UCaaS Server. The GTI Networks Extend platform will perform store and forward where the request is stored and delivered at a later time.

The GTI Networks Extend platform performs store and forward based on the error response received from the UCaaS server. Any response considered a temporary failure is processed by the store and forward service. Refer to the section on Error Responses for information on which responses are considered permanent or temporary.

A message that has been stored is tried again roughly every 30 seconds and will persist for 7 days, after which the message is discarded. These durations are controlled by GTI Networks and cannot be changed by a customer.

In order to maintain message order. After a subscriber’s message has been placed into the Store and Forward service. All future messages for this subscriber are automatically placed in the store. The messages are then delivered based on the re-try timer (no less than 30 seconds) and delivered based on the order placed in the store service.

?‍?‍? Group Messaging

Group Messaging (also called Group MMS) is just an MMS message that contains more than one recipient. Group Messaging is supported by the GTI Messaging Gateway. Each recipient's E.164 number is contained in the list of TO users. Group messages use the message type mms in.

Group Messaging Originations

When a subscriber originates a group message, the GTI Messaging Gateway delivers a single message event, with "type" = "mms", to the UCaaS Platform. The To field contains the E.164 number of each participant that needs to receive the message. The From and Owner fields contain the E.164 number of the subscriber that has originated this message.

Group Messaging Terminations

When a 3rd party generates a group message, the UCaaS Server is expected to send a message to the GTI Messaging Gateway for each GTI Subscriber (SIM) that is part of the group. The To field contains the E.164 number of each participant that needs to receive the message. The Owner field contains the E.164 number of the subscriber that receives this message.

? Emojis

Emojis and extended characters are supported. These will be encoded as UTF-8. There may be limitations on how these are rendered based on the handset.

⚙️ SMS Messages with binary UDH data

User data header (UDH) is a binary structure that may be present at the start of a short message in an SMS. It does not contain text but defines how to process the message. Generally, the UDH is either used in combination with binary content known as smart messaging for ringtones, operator logos, WAP Push and vCards, or it is used for concatenated SMS.

Binary UDH messages are not supported using the GTI Messaging Gateway interface.

The GTI Networks Extend platform handles all SMS concatentation and fragmentation operations required for long message handling. As such, the UCaaS Server does not have to deal with handling message fragmentation/ordering/re-assembly operations for long SMS messages.

Message Concatentation during SMS Originations

When a mobile sends a message that exceeds the limit of a single SMS message (160 characters for traditional text only characters, or 70 characters if extended characters, like emoji, are used), the message is received by the GTI Networks Extend platform as a series of message fragments, with binary UDH information included that allows the platform to process the fragments in the correct order. Once all the fragments are received, the GTI Networks Extend platform combines them into a single message event. This single message event is then POST-ed by the GTI Messaging Gateway interface to the UCaaS server. No fragment identifcation information is included the POST-ed origination message.

Message Fragmentation during SMS Terminations

Like SMS originations, fragment identification information is not supported over the GTI Messaging Gateway interface during SMS terminations. A POST-ed message event from the UCaaS must contain the entire content for that message event. The GTI Messaging Gateway interface does not process fragment identification information, nor will it re-order fragments into sequential order during delivery, from the UCaaS server.

The GTI Networks Extend platform will automatically fragment a "long" message event and send all pieces to the mobile. The mobile device will re-assemble the pieces in the proper order and present the "long" message to mobile as a single SMS event.

Data-only Messaging Services

Some mobile messaging applications do not rely on SMS or MMS to transmit their messaging data. These are sometimes called data-only messaging services. A few examples of these types of data-only messaging services are:

  • Apple's iMessage service

  • Android's RCS service

  • WhatsApp

  • Facebook Messenger

These types of client application messaging services are not seen by the GTI Networks Extend platform's messaging infrastructure, and as such, are not supported by the GTI Messaging Gateway interface.

? Security

All messages sent to/received by the GTI Messaging Gateway use HTTPS, which are transmitted using TLS encryption. HTTPS requires that the customer provide a proper valid public SSL certificate, issued by CA, to GTI Networks support so it can be loaded onto the GTI Networks Extend platform servers.

The UC Partner must provide GTI Networks support with a complete list of IP addresses that UCaaS platform will use to communicate with GTI Messaging Gateway interface. GTI Networks support will add those IP addresses to the appropriate firewall ACL rules to enable successful network connectivity between the GTI Messaging Gateway and the UCaaS platform servers.

? Authentication

Bearer authentication is an HTTP authentication scheme that involves security tokens called bearer tokens. These tokens are to be included in every request as part of the Authentication Header. These tokens are data filled against the provisioning GTI Messaging Gateway. There is one token to be used when messages are sent to the UCaaS server and a separate token used when sent to the GTI Messaging Gateway.

Any message that is received for a subscriber that does not have a valid token receives a 401 Unauthorized response.

  • Missing Authorization Header

  • Received token Does not match the provisioned token

  • Header is in the incorrect format.

? Media Messages

Media images (an MMS message) are encoded as base64 and contained in the JSON message body with the following limitations.

  • 1 MB Limit

  • Images, videos, audio, docs, and vcard are all supported by the API.

    • Supported MMS file types are:

      • Application: json, ogg, pdf, rtf, zip, x-tar, xml, gzip, x-bzip2, x-gzip, smil

      • Text: plain, javascript, css, csv, cal, html, vcard, x-vcard, vnd.wap.wml, rtf, xml

      • Audio: mp4, mpeg, ogg, flac, wav, amr, 3gpp

      • Image: bmp, gif, jpeg, png, svg+xml, tiff, webp, x-icon

      • Video: mp4, mpeg, ogg, quicktime, webm, x-ms-wmv, x-flv

        NOTE: There may be limitations on how individual file types are rendered based on the handset.

? Transmission Rates

The API is restricted to 1 message per second.

⛔️ Restrictions and Limitations

  • GTI Networks Extend platform system messages and other binary SMS messages are not supported over the GTI Messaging Gateway interface. This includes the following types of messages:

    • Message Waiting Indication (MWI) messages,

    • Over-the-air SIM configuration messages

    • iMessage/FaceTime/iCloud activation messaging

    • other binary UDH messaging

  • API is restricted to 1 message per second.

  • DLR reports are not provided.

  • 1MB limit for base64 encoding data.

  • There may be limitations as to how Emojis and media attachments (images, pdf, etc.) are rendered on any particular handset.

  • For Message Originations:

    • All numbers in the From, and Owner must be in the e.164 format.

    • The To field can be:

      • e.164 format

      • SMS shortcode (5 or 6 digits)

  • For Message Terminations:

    • All numbers in the To and Owner must be in the e.164 formart

    • The From field can be:

      • e.164 format

      • up to 11 alphanumeric characters (including the space character) and must start with an alpha character

      • SMS shortcode (5 or 6 digits)

POSTMessage Origination

<your UCaaS message receive URL>

This command documents examples of messages sent to the receive URL of your UCass server from the GTI Messaging Gateway when a GTI Networks Extend subscriber originates a message from their device.

JSON Field Definitions

Parameter Requirement Type Description
type required String Identifies the type of message:
"sms" or "mms"
domain optional String For an origination the value is always delivered and is based on the SIP domain assigned to the subscriber.
direction required String "orig" - Identifies the message direction is an origination.
message required Object Object defining the message

Message JSON Object

 
Parameter Requirement Type Description
id required String UUID identifier that unique identities this message
text optional String The text data of the SMS/MMS message.
subject optional String For "mms" messages only. The subject text for the MMS.
to required String Array Object The e.164 number (or numbers) the message is sent to.
For SMS messages this list can only contain one e.164 number.
For non group-MMS messages this list only contains a single e.164 number. For group MMS messages this list contains the e.164 numbers for all participants in the group.
from required String The E164 number the message was sent from
owner required String The E164 number assigned to the subscriber associated with this message.
For origination messages this would always match the from field.
media optional Object Object for MMS

Media JSON Object

Parameter Requirement Type Description
mimeType Required if data is included. String Defines the content of the data. Such as image/jpeg
fileName Required if data is included. String Identifies the data object
data Required String Data that is formatted as either text or base64
encoding Required if a base64 image is included.   Defines the encoding format of the data

Response Code handling

The GTI Networks Messaging Gateway will handle response codes from the delivery of message originations to the UCass platform as follows:

Handling of Status Codes

 
Field Status Codes Description Store and Forward Secondary URL(if provisioned)
  200-299 Successful Response No No
  300-399 Redirection Response No No
  401 Unauthorized 407 Proxy Authentication Required Indicates the authorization token is invalid. Yes No
  408 Request TimeOut Yes Yes
  429 To Many Requests Yes Yes
  480 Temporarily Unavailable Yes Yes
  481 Call or Transaction Does not Exist Yes Yes
  4xx (All Other Responses) Permanent Failures No No
  500 and Greater Server Internal Error Yes Yes
HEADERS
Authorization

Bearer 123456

Contains the provisioned Security Token

Content-Type

application/json;charset=UTF-8

User-Agent

mobileuc/2.0

GTI Networks sends : mobileuc/v2.0

Accept

application/json

Bodyraw (json)
 
json
 
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "direction": {
      "type": "string"
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "to": {
          "type": "array",
          "items": [
            {
              "type": "string"
            }
          ]
        },
        "from": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "media": {
          "type": "array",
          "items": [
            {
              "type": "object",
              "properties": {
                "mimeType": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "encoding": {
                  "type": "string"
                },
                "data": {
                  "type": "string"
                }
              },
              "required": [
                "mimeType",
                "fileName",
                "data"
              ]
            }
          ]
        }
      },
      "required": [
        "id",
        "to",
        "from",
        "owner"
      ]
    }
  },
  "required": [
    "type",
    "direction",
    "message"
  ]
}
Example Request
 
curl
 
curl --location -g '{{UCassUrl}}' \
--header 'Authorization: Bearer 123456' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'User-Agent: mobileuc/2.0' \
--header 'Accept: application/json' \
--data '{
    "type" : "sms",
    "domain" : "domaintest.com",
    "direction" : "orig",
    "message" : {
        "id" : "b26d628f-2f4a-401b-85da-23f8e86ac79c",
        "text" : "A simple orig msg",
        "to" : [ "+19728972222" ],
        "from" : "+16822826124",
        "owner" : "+16822826124"
      }
}
'
Example Response
  •  
  •  
No response body
This request doesn't return any response body

POSTMessage Termination

https://<url-of-gti-messaging-gateway>:<port>/gtiMsgGateway/v2/message

This command is used by a UCass server to send a request for message delivery to the GTI Messaging Gateway for delivery to the device of a GTI Networks Extend subscriber.

JSON Field Definitions

Parameter Requirement Type Description
type required String Identifies the type of message:
"sms" or "mms"
domain optional String Identifies the subscriber's SIP domain. If the domain is not specific the owner information is used to derive the domain.
direction required String "term" - Identifies the message direction as a termination.
message required Object Object defining the message

Message JSON Object

 
Parameter Requirement Type Description
id required String UUID identifier that unique identities this message
text optional String The text data of the SMS/MMS message.
subject optional String Used to display the subject of the SMS/MMS
to required String Array Object The E164 number (or numbers) the message is sent to.
For group MMS messages all participants are shown in this list.
For non group messages this list only contains 1 number.
All SMS messages are expected to only have 1 number.
from required String The E164 number the message was sent from
owner required String The E164 number assigned to the subscriber associated with this message.
For termination messages this would always match one of the numbers in the to List.
media optional Object Object for MMS

Media JSON Object

Parameter Requirement Type Description
mimeType Required if data is included. String Defines the content of the data. Such as image/jpeg
fileName Required if data is included. String Identifies the data object
data Required String Data that is formatted as either text or base64
encoding Required if a base64 image is included.   Defines the encoding format of the data

SMS/MMS Termination Processing

The GTI Messaging Gateway determines if the received message is invalid. The following validation checks are provided and the error response generated.

 
Scenario Error Response
A message must have a subject, text or media Bad Request
Type field missing or not set to sms or mms Bad Request
Direction field missing or not set to orig or term Bad Request
Missing Message Object Bad Request
Message:Owner missing or does not match a number in the to list Bad Request
When a base64 data is included and the mimeType or filename is empty Bad Request
A subscriber cannot be identified based on the owner Not Found
The identified subscriber cannot be associated with GTI Messaging Gateway. Method Not Allowed
The identified subscriber does not messaging enabled on the SIM Method Not Allowed
Missing Authorization Header Unauthorized
Authorization Header does not start with “Bearer “ Unauthorized
Authorization token does not match the associated token defined in the GTI Messaging Gateway. Unauthorized

If the incoming request is rejected due to invalid data or invalid json. A json body may be added to the response to include a description as to why the message was not processed. This response body is optional and only included for certain error conditions. The response body has the following format.

json
 
{
    "status"          : 404,
    "error"           : "error string"           
 }
Parameter Requirement Type Description
status required integer Http Response status code
error required String Description of the error
HEADERS
Authorization

Bearer Auth-Schema Token

Contains the provisioned Security Token

Content-Type

application/json;charset=UTF-8

User-Agent

<identity of the application>

GTI Networks sends : mobileuc/v2.0

Accept

application/json

Bodyraw (json)
 
json
 
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "direction": {
      "type": "string"
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "to": {
          "type": "array",
          "items": [
            {
              "type": "string"
            }
          ]
        },
        "from": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "media": {
          "type": "array",
          "items": [
            {
              "type": "object",
              "properties": {
                "mimeType": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "encoding": {
                  "type": "string"
                },
                "data": {
                  "type": "string"
                }
              },
              "required": [
                "mimeType",
                "fileName",
                "data"
              ]
            }
          ]
        }
      },
      "required": [
        "id",
        "to",
        "from",
        "owner"
      ]
    }
  },
  "required": [
    "type",
    "direction",
    "message"
  ]
}
Example Request
 
curl
 
curl --location -g '{{url}}/tangoMsgGateway/v2/message' \
--header 'Authorization: Bearer 654321' \
--header 'User-Agent: messagesim/1.0' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Accept: application/json' \
--data '{
   "type" : "sms",
   "domain" : "domaintest.com",
   "direction" : "term",
   "message" : {
       "id" : "b26d628f-2f4a-401b-85da-23f8e86ac80d",
       "text" : "A simple term msg",
       "to" : ["+16822826124"],
       "from" : "+19728972222",
       "owner" : "+16822826124"
   }
}'
200 OK
Example Response