Runtime components : Channels components : SMS handler : SMS channel driver : Delivery report handler
  
Delivery report handler
Delivery report handler is a servlet that handles the message delivery report from SMS gateway. It supports multiple delivery report servlets with different configuration for different gateways.
When BTTOutboundMessageHandler handle the outbound HTTP response from gateway, it handles the initial delivery report at the first step. The initial delivery report only indicate whether the outbound message sending request is accepted or rejected by gateway at the gateway level. When the message is received by mobile phone, the gateway submits an http request to the UDTT delivery report handler which handles the DLR status of message.
Following is the delivery report handler configuration:
This graphic is described in the surrounding text.
ParameterNames Configuration:
This graphic is described in the surrounding text.
Standard DLR status code:
This graphic is described in the surrounding text.
Note The value of the field in parameterNames should be mapped correctly with the keywords of the specific SMS gateway. Take statusParamName =" statuscode “in the example above in application/x-www-form-urlencoded type, the value of the field statusParamName is mapped with the keywords for the message data of the gateway.
Example 1
Following is an example for delivery report handler configuration in application/x-www-form-urlencoded type:
Example of delivery report HTTP content:
http://www.ozekisms.com/proc.php?reporttype=deliveredtonetwork&msgid=$messageid
Example of Delivery Report Handler Configuration:
<com.ibm.btt.channel.sms.config.DLRHandlerConfiguration
id="formDLR ">
<com.ibm.btt.channel.sms.config.ParameterNames
Injection="parameterNames" messageIDParamName="msgid"
statusParamName="reporttype"/>
<map Injection="statusCodeConverter">
<entry key="deliveredtonetwork" value="0"></entry>
<entry key="deliveredtohandset" value="1"></entry>
<entry key="deliverederror" value="2"></entry>
</map>
<ref Injection="dlrStore" refId="dlrMemoryStore"/>
</com.ibm.btt.channel.sms.config.DLRHandlerConfiguration><com.ibm.btt.channel.sms.dlr.DLRMemoryStore
id="dlrMemoryStore"/>
Example 2
Following is an example for delivery report handler configuration in xml/text type:
Example of delivery report HTTP content:
<acceptreport> <statuscode>StatusA</statuscode>
<Contenido>Message accepted for delivery</Contenido>
<IdTransaccion>ERFAV23D</IdTransaccion>
</acceptreport>
Example of delivery report handler configuration:
<com.ibm.btt.channel.sms.config.DLRHandlerConfiguration
id="xmlDLR" xmlHttp="true">
<com.ibm.btt.channel.sms.config.ParameterNames
Injection="parameterNames" messageIDParamName="IdTransaccion"
statusParamName="statuscode"/> <map Injection="statusCodeConverter">
<entry key="StatusA" value="0"></entry>
<entry key="StatusB" value="1"></entry>
<entry key="StatusC" value="2"></entry> </map>
<ref Injection="dlrStore" refId="dlrMemoryStore"/>
</com.ibm.btt.channel.sms.config.DLRHandlerConfiguration>
When Outbound Message Handler send message to gateway, it can register the URL of delivery report handler. When the message is delivered, the gateway will call back the URL of Delivery Report Handler to tell the status of message delivery. The URL of delivery report handler can be defined as self-defined parameters of outbound handler configuration.
The delivery report handler Servlet should be configured in file web.xml of the web project. The delivery report handler configuration file is set as servlet init-param configFile, and the Id is set as servlet init-param dlrConfigID. Example:
<servlet>
<servlet-name>BTTFormDeliveryReportHandler</servlet-name>
<servlet-class>com.ibm.btt.channel.sms.dlr.BTTDeliveryReportHandler</servlet-class>
<init-param>
<param-name>configFile</param-name>
<param-value>jar:///com/ibm/btt/test/SMSHandlerConfig.xml</param-value>
</init-param>
<init-param>
<param-name>dlrConfigID</param-name>
<param-value>fromDLR</param-value>
</init-param>
</servlet><servlet-mapping>
<servlet-name>BTTFormDeliveryReportHandler</servlet-name>
<url-pattern>/BTTFormDeliveryReportHandler</url-pattern>
</servlet-mapping>
See also
SMS channel driver