Cezary,

This is a slightly different issue, Sunil just wanted to know how to tie together DLRs and the original messages sent. The method I gave does this. What you are talking about is getting the actual ID generated by the SMSC.

It is something that would be very nice to get, but I don't think all the developers believe it is right to do as not all the SMSCs are capable of returning an ID, so it breaks the abstraction.

Ben

On 9 Oct 2006, at 10:49, Cezary Siwek wrote:

Ben Suffolk wrote:
Sunil,

The way it works is you specify a URL with each message that you send, and you give a different uid with each URL. When the DLR is received the URL that you specified is called. So you get the uid that you set with the message. In addition you get any other variables you requested, such as the status of the DLR with status= %d Have a look in the manual under table 6-9 for a list of other variables you can include in your DLR :-

http://www.kannel.org/download/1.4.1/userguide-1.4.1/ userguide.html#AEN3463

Just noticed in my original post I missed out a ? between the php and the status, so it should have been http://localhost/dlr.php? status=%d&uid=1234
The problem still remain because kannel gives different sms-id for each http request. e.g if you get status 4 first and then status 1 - these two requests has different sms-id (%I) .
Internal kannel DLR use TS and SMSC to determine specific message:

static void dlr_mysql_remove(const Octstr *smsc, const Octstr *ts, const Octstr *dst)

{
  Octstr *sql;

  debug("dlr.mysql", 0, "removing DLR from database");
sql = octstr_format("DELETE FROM %s WHERE %s='%s' AND %s='%s' LIMIT 1;", octstr_get_cstr(fields->table), octstr_get_cstr(fields->field_smsc), octstr_get_cstr(smsc), octstr_get_cstr(fields- >field_ts), );


  mysql_update(sql);

  octstr_destroy(sql);
}

variable name is TS but it doesn't looks like Timestamp
Question is : how we can be 100% sure which dlr-url http request correspond to which SMS ? Is it possible to use internal message ts value (octstr_get_cstr (ts)) instead of current Timestamp (%T) ? Regards
Cezary Siwek




Reply via email to