Search code examples
kannel

Get ID DLR in Kannel


I developed an application that uses the Kannel to send SMS to a SMSC via SMPP. I send for Kannel sendSms using http and get a status update and sms responses via DLR-URL. But I'm not knowing capture an ID for this message, I can not identify it on my system.

Is there any parameter that Kannel send the DLR-URL that identifies the message? Or, you could spend a parameter customized by sendSms and then capture it in DLR-URL?


Solution

  • You can add a parameter to your DLR URL with the value %F - that will be set to the SMSC's ID. However, that only gets you the SMSC ID but doesn't solve the problem of finding the message on your side.

    Another thing you can do is to create a unique DLR URL for each message you send - you can include the respective message ID from your database directly in the URL. For example, if the message has an ID of 123456789 in your database, and it will have an ID of 987654321 on the SMSC, it would look like this:

    • you set the dlr-url to the message with the ID 123456789:

      http://example.com/dlr-url/?my_id=123456789&smsc_id=%F&dlr=%d
      
    • when the time comes, you receive a request similar to this:

      http://example.com/dlr-url/?my_id=123456789&smsc_id=987654321&dlr=1