For SMS protocols like SMPP, CIMD2 and UCP delivery reports will normally be received from the remote end (operator or provider) when a message has reached its final status, delivery or failed.
However, when using “non-SMS” protocols such as HTTP or SMTP for delivery, or more proprietary delivery methods via EBE, the delivery reports need to be generated in some other way.
Configuring the connector
The configuration option DLR_SUPPORT indicates whether delivery reports are expected to be received for messages sent via the connector and by default it is set to 1 for SMPP, CIMD2 and UCP connectors.
Protocols EBE, HTTP, SMTP and MGP on the other hand have DLR_SUPPORT=0 by default, meaning EMG will generate a delivery report immediately after delivery. The status of the delivery report will be delivered or failed depending whether sending the message was succesful.
If you have a custom delivery method, for example using a EBE connector, and you would like to inject your own delivery reports to EMG at a later point in time you would set DLR_SUPPORT=1 for the EBE connector. You also need to set the keyword NODLR for the connector.
Sample connector config:
CONNECTOR ebe-customdelivery < PROTOCOL=EBE TYPE=OUTGOING ADDRESS=/home/emg/etc/ebe-customdelivery.pl INSTANCES=1 DLR_SUPPORT=1 NODLR >
Injecting the delivery report
The delivery report can be injected to EMG using any protocol that uses MGP options, for example HTTP or MGP. The command-line utility “emgsend” uses the MGP protocol to communicate with EMG and can thereby also be used for DLR injection.
The message options needed for a delivery report are:
|MSGTYPE||M||5 – Specifies message is a delivery report|
|ORIGID||M||The SMSC message id for the original message|
|MESSAGESTATE||M||DELIVERED or FAILED|
|SOURCEADDR||O||Source address / sender|
|DESTADDR||O||Destination address / recipient|
M = Mandatory, O = Optional
When the delivery report has been received EMG will perform a lookup in the open delivery report database and try to find an entry based on the value of the ORIGID parameter.
In the open DLR entry EMG will find information about which user sent the original message, the original source and destination addresses etc. EMG will then route and format the final delivery report to the client based on that information. Using the same mechanisms that would be used with any other “normal” delivery report.
Connectors used to inject delivery reports must have keyword ALLOW_INJECT_DLR.
It is recommended not to use the same incoming connector for injecting delivery reports that is used to send messages.
Injecting a delivery report using emgsend
emgsend -o MSGTYPE=5 -o ORIGID=130456 -o MESSAGESTATE=DELIVERED -o SOURCEADDR=46123456 46654321 "dummy text"
Injecting a delivery report using a http get request
We anticipate that EMG server has an incoming http connector configured to listen on port 8080.
Sample entry in server.cfg to serve incoming http requests with DLRs on port 8080:
CONNECTOR http-dlr-in < ADDRESS=0.0.0.0:8080 INSTANCES=5 PROTOCOL=HTTP TYPE=INCOMING ALLOW_INJECT_DLR=1 # Authenticate users via database USERDB=emg # Authenticate users via file #USERS=users >