|
Hacking the source problem.
Hello, I am trying to change a really simple function into kannel gw/smsc/smsc_smpp.c But I got some problem, if someone can help me!
It's concerning the validity and deferred time. I want instead of +MIN put
the unix timestamp.
The problem I have, I modified gw/smsc/smsc_smpp.c like this:
//validity = msg->sms.validity >= 0 ?
msg->sms.validity : smpp->validityperiod;
if (msg->sms.validity >= 0) { struct tm tm = gw_gmtime(msg->sms.validity); pdu->u.submit_sm.validity_period = octstr_format("%02d%02d%02d%02d%02d%02d000+", tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); } if (msg->sms.deferred >= 0)
{
struct tm tm = gw_gmtime(msg->sms.deferred); pdu->u.submit_sm.schedule_delivery_time = octstr_format("%02d%02d%02d%02d%02d%02d000+", tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); } But strange result when:
1. When I send via cgi-bin/sendsens with validity=1141776000 (for 8
March 2006 00:00) i got this
2006-03-07 22:14:21 [19966] [6] DEBUG: schedule_delivery_time:
NULL
2006-03-07 22:14:21 [19966] [6] DEBUG: validity_period: "380119031407000+" 2. When I send with the same validity (validity=1141776000 ) and
put any deferred time, i got this:
2006-03-07 22:19:57 [22387] [6] DEBUG: schedule_delivery_time:
"380119031407000+"
2006-03-07 22:19:57 [22387] [6] DEBUG: validity_period: "060308000000000+" So... You can see my validity become valid, but this is my
schedule_delivery become invalid right now.
Any idea to fix this ?
Regards,
Nikos
|
