DLR extravaganza

NOTE: This patch was superseded by another one I’ve wrote that adds smsc-admin-id instead. The smsc-admin-id patch was already commited to CVS so the use of the smsc-dlr-alias is now officially deprecated.

A problem you may have faced with dlrs on Kannel: If you’re using dlrs and have more than one bind to a given carrier, you need to name them all the same. Otherwise, if the dlr come back over a different bind than the one you’ve used to send the MT message in the first place, Kannel won’t be able to match them, since they won’t share the same “smsc” field.

This is usually OK. However, you lose the ability to control the binds independently: you cannot shutdown a single bind, for example. The problem worsens yet more if your binds are to different data centers (some carriers have redundant SMSC’s on geographycally distant places).

That’s why I’ve created this patch that adds a new configuration option to SMSC groups:

smsc-dlr-alias

Using this parameter, you can define an alias to use when storing dlrs, so they will match despite being sent/received over different binds.

For example:

#carrier link 1
group                      = smsc
smsc                       = smpp
smsc-id                  = “link1”
smsc-dlr-alias     = “myalias”
allowed-smsc-id = “link1;mylink”
host                        = “1.1.1.1”
#carrier link 2
group                      = smsc
smsc                       = smpp
smsc-id                  = “link2”
smsc-dlr-alias     = “myalias”
allowed-smsc-id = “link2;mylink”
host                        = “1.1.1.1”

Using this configuration, you just have to use the “&smsc=mylink” parameter on your send-sms url. The dlr will be stored using the alias “myalias” no matter which of these 2 routes the message takes. When getting the response back, again, it will be matched against “myalias”.

Download the patch here.

Please try it and let me know what you think.

Regards,

Alex

Comments (5)

Bharat VasantJuly 15th, 2009 at 1:58 AM

Dear Alex:

I don’t know whether this is right place to ask this but I didn’t received any replies for my problem posted on Kannel users list.

I am adding DlrUrl in Send_sms table while sending SMS by inserting row to Send_sms table (sqlbox) as http://localhost/dlr.php?msgid=$uuid&status=%A

On receipt of DLR my PHP script is not updating the corresponding Msg Status. Where I can check whether Kannel/sqlbox is invoking Dlrurl or not ?

I have checked Apache Access log and found that Dlrurl is being invoked if I send message using http cgi (smsbox) but not being invoked if I send msg by inserting in send_sms table of sqlbox.

LukaszNovember 16th, 2009 at 11:24 AM

Hi Alex,

I was looking for a solution to solve the problem you have described above, the one with dlr coming back to a wrong bind when multiple connections are made to different data centers. I am using CVS version which already includes “smsc-admin-id”. However, this is not working as an alias and doesn’t solve the dlr lookup error (in database).

Does smsc-admin-id works the same like smsc-dlr-alias in terms of searching by dlr using alias instead of smsc or did you remove that functionality before committing smsc-admin-id? Should i use your old patch to solve this problem?

Thanks
Lukasz

alexNovember 20th, 2009 at 4:39 AM

smsc-admin-id it’s only used for administrative commands (start/stop smsc). It’s not involved on dlr matching at all.

Regards,

Alex

NickyDecember 28th, 2009 at 8:25 AM

Hello alex,

I am facing the same problem as put forward by bharat vasanth, please suggest what could be done to solve the problem.

Thanks.

alexDecember 28th, 2009 at 9:03 AM

Please post detailed information on Kannel’s users list, I (and probably others on the list) will try to address it there.