Inbound Message Handler handles the incoming message from gateway, then decodes and transforms the message information into the UNICOM® Digital Transformation Toolkit (UDTT™) Channel Context which is shared within channel handler. It supports multiple Inbound Handler instances of same Handler class for different SMS gateways, and each Inbound Handler has independent configuration for different gateway species. Following is the Inbound Message Handler configuration:
Parameter names configuration
Example for Inbound Message Handler configuration in application/x-www-form-urlencoded type
Example of HTTP content in application/www-form-urlencoded type:
Note In the xml/text type, the value xmlHttp is set to true, and the value presentationHandler is set as the extension presentation handler implementation class. In this example, the implementation class is com.ibm.btt.test.MovilgatePresentationHandler (see Presentation handler). Inbound Message Handler is implemented as a Servlet that will be called by SMS gateway when new message arrived.
The URL parameter of the Servlet is set in the SMS gateway configuration as shown in the following example:
Note The value of the field in parameterNames should be mapped correctly with the inbound servlet URL parameter name of the SMS gateway.
The Inbound Message Handler Servlet should be configured in file web.xml of the web project. The Inbound Handler configuration file is set as servlet init-param configFile, and the Id is set as servlet init-param inboundConfigID. For example:
<servlet> <servlet-name>FormInboundMessageHandler</servlet-name> <servlet-class>com.ibm.btt.channel.sms.inbound.BTTInboundMessageHandler</servlet-class> <init-param> <description> Configuration File path</description> <param-name>configFile</param-name> <param-value>jar:///com/ibm/btt/test/SMSHandlerConfig.xml</param-value> </init-param> <init-param> <description> ID of Inbound handler configuration defined config file </description> <param-name>inboundConfigID</param-name> <param-value>formInbound</param-value> </init-param> </servlet><servlet-mapping> <servlet-name>FormInboundMessageHandler</servlet-name> <url-pattern>/FormInboundMessageHandler</url-pattern> </servlet-mapping>