Hi,
I just want to write down our solution:
I sent the question about the problem to our sms provider, which told me
that if i want to pair the sent sm with delivery report than the key is not
just the FID (which is just a timestamp), but the FID+destination.
So we had to change the code of kannel. We using mysql dlr database, so we
just changed gw/dlr_mysql.c at 3 places:
static struct dlr_entry* dlr_mysql_get(const Octstr *smsc, const Octstr *ts,
const Octstr *dst)
{
.
sql = octstr_format("SELECT %s, %s, %s, %s, %s, %s FROM %s WHERE %s='%s'
AND %s='%s' AND %s='%s';",
octstr_get_cstr(fields->field_mask),
octstr_get_cstr(fields->field_serv),
octstr_get_cstr(fields->field_url),
octstr_get_cstr(fields->field_src),
octstr_get_cstr(fields->field_dst),
octstr_get_cstr(fields->field_boxc),
octstr_get_cstr(fields->table),
octstr_get_cstr(fields->field_smsc),
octstr_get_cstr(smsc),
octstr_get_cstr(fields->field_ts), octstr_get_cstr(ts),
octstr_get_cstr(fields->field_dst),
octstr_get_cstr(dst));
.
}
static void dlr_mysql_remove(const Octstr *smsc, const Octstr *ts, const
Octstr *dst)
{
.
sql = octstr_format("DELETE FROM %s WHERE %s='%s' AND %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), octstr_get_cstr(ts),
octstr_get_cstr(fields->field_dst),
octstr_get_cstr(dst));
.
}
static void dlr_mysql_update(const Octstr *smsc, const Octstr *ts, const
Octstr *dst, int status)
{
.
sql = octstr_format("UPDATE %s SET %s=%d WHERE %s='%s' AND %s='%s' AND
%s='%s' LIMIT 1;",
octstr_get_cstr(fields->table),
octstr_get_cstr(fields->field_status), status,
octstr_get_cstr(fields->field_smsc),
octstr_get_cstr(smsc),
octstr_get_cstr(fields->field_ts),
octstr_get_cstr(ts),
octstr_get_cstr(fields->field_dst),
octstr_get_cstr(dst));
.
}
If we send more SMs to one destination in one sec, than the provider shifts
FID (timestamp at theire side), so even this case the FID+destination will
be unique.
Bye!
--
View this message in context:
http://old.nabble.com/Duplicated-FID-%28foreign_id%29-tp27853586p27874752.html
Sent from the Kannel - User mailing list archive at Nabble.com.