How does SMS Gateway Services work?

Use SMS Gateway Services to forward all incoming SMS messages directly to your web server in near real-time.

When the SMS Business Partner receives incoming SMS messages, the Business Partner forwards all incoming SMS messages directly to your web server.

Before you can use this service, it must be provisioned for your Acoustic Campaign organization. You can request SMS Gateway Services by submitting a provisioning ticket to the Provisioning team.

For added security, you can add firewall rules to only allow traffic from the following IP addresses: 208.71.240.0/21.

Dedicated code (short or long code)

If you are using a dedicated short or long code, the service posts all incoming messages to your web server. This option not available for shared codes.
  • Name of your Acoustic Campaign organization (org)
  • Code type: short or long code
  • URL for your web server: The gateway must be publicly accessible. Make sure that the required firewall setting is updated to allow traffic to be received.

Dedicated OR shared code (short or long code)

For incoming messages, only messages that match the specific keywords are auto-forwarded.

  • Name of your Acoustic Campaign organization (org)
  • Code type: short or long code
  • Keyword(s): used for various SMS programs, such as Text to Join, Text for information, etc.
  • URL for your web server: the gateway must be publicly accessible. Make sure that the required firewall setting is updated to allow traffic to be received.

Sample MO SMS post and HTTPS POST parameters

This is an example of a mobile originating (MO) post that you might expect to receive directly from the SMS partner's gateway, in near real-time, when the SMS message is received from the end user.

device_address=1447ß7665544&inbound_address=26161&router=cingular&carrier=cingular&channel=sms&message_orig=Hello+from+SMPPSim&message=Hello+from+SMPPSim&message_id=148929155953&message_subid=0&status=Processing&status_code=10&a2w_mo_ref_id=148929155953&country_code=1

The SMS Business Partner performs an HTTPS POST back to the client. The following fields are provided as part of the payload:

Table 1. Message Notification Contents. The MO messages are form-encoded and are delivered to your URL as an HTTP POST (just as an HTML form submission would be). The following post parameters are sent:
Key Description
attachment An mGage-assigned ID that is given to the attachment sent by the end user. Use this ID.
carrier Carrier from which the subscriber MO originated.
channel Channel that is used that is for SMS message delivery.
device_address Mobile number of the wireless device that is sending the message.
inbound_address A source address that is hosted by mGage systems and registered with the carrier to which a subscriber sends a subscriber MO.
message SMS message body content that the recipient receives. mGage might strip some unnecessary characters from the original message.
message_id An mGage-assigned message ID that is given to a message when the SMS MO is received from the carrier.
message_orig SMS message body content as originally sent by the subscriber from their mobile device.
mmsID mGage-assigned message ID that is given to a message when the MMS MO is received from the carrier.
router Value that identifies the mGage router through which the message was submitted.
status This parameter is empty.
status_code This parameter is empty.

Sample code to process incoming MO SMS: Receiving a message or status notification

The following example uses the CGI module to extract components of a MO or status notification and write the values to the log file called "DirectTEXTReceived.text".

#
#Example of processing mGage DirectTEXT MO/status notifications with Perl.
#
use strict;
use CGI;
# Load POST data into a new CGI object
my $query = new CGI;
# Extract values and create timestamped output line
my $output;
$output = scalar(localtime(time)) . " -- ";
$output .= "Carrier: " . $query->param('carrier') . "; ";
$output .= "Channel: " . $query->param('channel') . "; ";
$output .= "Device address: " . $query->param('device_address') . "\n";
# Write output to file
open(FILEH, ">>DirectTextReceived.txt") || die("Cannot open log file: $!\n");
print(FILEH $output);
close(FILEH);

Processing incoming messages that fail to post

When an attempt to post incoming SMS messages to the client's web server fails, the SMS gateway retries to post this message. The gateway retries at the following intervals (in minutes): 1, 5, 10, 60,120, 360, 720

Thereafter, the gateway stops doing retry for this message and permanently deletes it from its queue for the posting to the client's web server.