SMS Incoming Messages

From Triangle Wiki

Jump to: navigation, search

Contents

Introduction

MO (Mobile Originated) messages are any messages that are sent from a customers handset or indeed pushed into the API service by a client. MOs are usually messages from customers asking for a service to be activated or for a service to be stopped.

If you are running the Triangle chat product and the client is subscribed to a chat service then the message will always be pushed into the correct chat service.

API

The API script is located at http://incoming.triangle-solutions.com/ simply POST the variables and values or send a urlencoded XML string wrapped in the variable XMLDATA to the address. You must supply the server IP address to Triangle to secure the transaction to the server.

XML over HTTP API

In some circumstances a client may wish to mimic the incoming message of a customer. Such examples include customers signing up for a service via a website or IVR system. this is possible by using the SMS Centre Incoming API as described below.

In this case the client needs to send an XML string into the incoming script for processing. The customer will then be signed up to the service and all actions will be taken as per any usual gateway initiated incoming message.

POST over HTTP API

In this case the client needs to send an HTTP POST string into the incoming script for processing. The customer will then be signed up to the service and all actions will be taken as per any usual gateway initiated incoming message.

POST

XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<ResponseService>
 <Header>
  <Partner>[USERNAME]]</Partner>
  <Password>[PASSWORD]]</Password>
  <Company></Company>
 </Header>
 <ResponseList>
  <Response>
   <TransactionID>[YOUR REF]]</TransactionID>
   <OriginatingNumber>[CUSTOMER CLI]]</OriginatingNumber>
   <Time>[YYYMMDDHHII]]</Time>
   <Data>[MESSAGE / KEYWORD]]</Data>
   <Destination></Destination>
   <Operator>[CUSTOMER NETWORK]]</Operator>
  </Response>
 </ResponseList>
</ResponseService>

The [MESSAGE / KEYWORD] element simply needs to be the keyword of the service you wish to emulate, the system will then process the message and send out the actions assigned to the service the keyword is associated too.

Please ignore the contents of some tags, they are required in the XML but no data needs inputting for this API service.

Response

The script will only return back the following:

  • SUCCESS - Means the XML has been inserted into the incoming buffer and awaits processing.
  • FAILED - The script failed to insert due to missing parameters or other issues.

To get a full error log please append the echo=HTML to the call, this will tell the script to print out some helpful debugging information. Please switch this off when testing has been completed.

Process Of Incoming SMS Messages Within The System

Every incoming message follows the following process.

  • Message from any provider comes into the Incoming script, this script takes the data provided by many providers and standardises this. It then saves the message into the incoming pending table. At the moment it accepts; XML, POST and GET data. Standardisation is also done on the network identifiers which vary greatly between different gateways and providers.
  • A cron script periodically parses the pending table and searches on message that are Active, and sorts them via a priority element. This cron script then ascertains the short code, service and finally the keyword the incoming message belongs to. It then activates any actions associated to the service and processes them.

External Links

Incoming API Script

Personal tools