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 initiatively submit an http request to BTT delivery report handler which handles the DLR status of message.
Following is the delivery report handler configuration:
ParameterNames Configuration:
Standard DLR status code:
Following is an example for delivery report handler configuration in application/x-www-form-urlencoded type:
http://www.ozekisms.com/proc.php?reporttype=deliveredtonetwork&msgid=$messageid
<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"/>
Following is an example for delivery report handler configuration in xml/text type:
<acceptreport> <statuscode>StatusA</statuscode> <Contenido>Message accepted for delivery</Contenido> <IdTransaccion>ERFAV23D</IdTransaccion> </acceptreport>
<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.
<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>