Runtime tools : 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:
 
Parameter
Description
Mandatory
xmlHTTP
DLR Handler supports two HTTP content types from SMS gateway: application/x-www-form-url and xml/text. If the xmlHttp is set as "true", it will use xml/text; if xmlHttp is set as "false", it will use application/x-www-form-urlencoded. The default value is "false".
N
parameterNames
parameterNamesdefintion used to parse the DLR data from the gateway. Refer to the table "parameterNames configuration" for more details.
Y
dlrStore
The implementation class to handle how to store the DLR information. The default class is com.ibm.btt.channel. sms.dlr.DLRMemoryStore, which stores the DLR status information in memory.
Y
statusCodeConverter
The map definition used to convert the status code from the gateways specific to the standard status code. The key is the gateway's code, the value is the standard code. Refer to the table "Standard DLR status code" for more details.
Y
ParameterNames Configuration:
 
Parameter
Description
Mandatory
statusParamName
Parameter name of status code of the report
Y
toParamName
Parameter name of phone number to which message is sent.
N
messagelDParamName
Parameter name of message ID
Y
Standard DLR status code:
 
Parameter
Description
Value
DLR_SUBMIT_ TO_SMSGW
The SMS has been submitted to SMS Gateway
0
DLR_SUCCESS
The SMS has been received by the phone
1
DLR_FAILURE
The delivery is failure or rejected by SMS Gateway
2
DLR_MESSAGE_BUFFERED
The SMS has been submitted, SMS Gateway has buffered the message for the phone that is not reachable (for example, phone power off). Note that some gateway or SMSC do not support this status.
4
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>
Go up to
SMS channel driver