SMS gateway configuration
An SMS gateway, or SMS aggregator, is a third-party entity used to forward SMS notification messages to a destination mobile phone number. IBM MobileFirst Platform Foundation routes the SMS notification messages through the SMS gateway.
To send SMS notifications from IBM MobileFirst Platform Foundation, one or more SMS gateways must be configured in the SMSConfig.xml file, which is in the /server/conf folder of the project. To configure an SMS gateway, we must set the values of the following elements, subelements, and attributes in the SMSConfig.xml file. The MobileFirst Server must be restarted when any changes are made in the SMSConfig.xml file.
Element Element Value gateway Mandatory. The <gateway> element is the root element of the SMS gateway definition. It includes 6 attributes:
- hostname
- id
- port
- programName
- toParamName
- textParamName
These attributes are described in Table 2
parameter Optional. The <parameter> subelement is dependent on the SMS gateway. Each SMS gateway may have its own set of parameters. The number of <parameter> subelements is dependent on SMS gateway-specific parameters. If an SMS gateway requires the user name and password to be set, then these parameters can be defined as <parameter> subelements. Each <parameter> subelement has the following attributes:
- name
- value
Attribute Attribute Value hostname Mandatory. The host name of the configured SMS gateway. id Mandatory. A unique ID that identifies the SMS gateway. Application developers specify the ID in the application descriptor file, application-descriptor.xml, when they develop an application. port Optional. The port number of the SMS gateway. Default is 80. programName Optional. The name of the program that the SMS gateway expects. For example, if the SMS gateway expects the following URI: http://host:port/sendsms
then programName="sendsms"
toParamName Optional. The name used by the SMS gateway to specify the destination mobile phone number. Default is to. The destination mobile phone number is sent as a name-value pair when SMS notifications are sent; that is, toParamName=destination mobile phone number. textParamName Optional. The name used by the SMS gateway to specify the SMS message text. Default is text. If the SMS gateway expects an HTTP post in the following format to forward SMS messages to a mobile device:
http://myhost:13011/cgi-bin/sendsms?to=destination mobile phone number&text=message text&username=fcsuser&password=fcspass
The SMSConfig.xml file is configured as follows:
<?xml version="1.0" encoding="UTF-8"?> <sms:config xmlns:sms="http://www.worklight.com/sms/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <gateway hostname="myhost" id="kannelgw" port="13011" programName="cgi-bin/sendsms" toParamName="to" textParamName="text"> <parameter name = "username" value = "fcsuser" /> <parameter name = "password" value = "fcspass" /> </gateway> </sms:config>
Parent topic: Application server-side configuration parameters