Using two-way SMS communication
SMS two-way communication enables communication between a mobile phone and the MobileFirst Server, over an SMS channel. SMS messages that originate from the mobile device can be sent to the MobileFirst Server through an external SMS gateway. The MobileFirst Server can then send a response message back to the originating mobile device.
Before you begin
About this task
http://hostname:port/context/receiveSMS
The SMS messages that are sent from mobile phones are forwarded to an adapter procedure on the MobileFirst Server, which is configured by the developer. The adapter procedure can include the logic to process the request, or the procedure can forward the request to a back-end system for processing. The response is returned by using the MobileFirst notification framework. For more information, see Push notification.
The two-way SMS architecture is summarized in the following figure:
- The adapter registers SMS event handlers on the MobileFirst Server.
- SMS messages are sent from mobile devices to the SMS gateway, which is configured with an SMS servlet of MobileFirst Server.
- The SMS gateway forwards SMS messages to a configured MobileFirst URL.
- An SMS servlet on MobileFirst Server matches the parameters with filters that are defined in SMS event handlers, and calls an adapter callback procedure.
- The adapter processes SMS messages and sends an SMS message to the mobile device by using the SMS API.
You use a series of server API methods to send and receive SMS messages:
- WL.Server.createSMSEventHandler
- Create an SMS event handler.
- WL.Server.setEventHandlers
- Set event handlers to implement callbacks for received events.
- WL.Server.subscribeSMS
- Subscribe a phone number to the specified event source.
- WL.Server.unsubscribeSMS
- Unsubscribe the phone number from the specified event source.
- WL.Server.getSMSSubscription
- Return an SMS subscription object for a phone number.