Re: timestamps with emi2

2002-01-26 Thread Stipe Tolj

Angel Fradejas wrote:
> 
> Hi Stipe,
> 
> Here you have the patch to date.c

patch applied to cvs. 

I'm not sure on the impact, but since there we no objections from the
others here we are. If something breaks please complain ASAP.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are




RE: timestamps with emi2

2002-01-15 Thread Angel Fradejas

Hi Stipe,

Here you have the patch to date.c

Angel Fradejas.


-Mensaje original-
De: Stipe Tolj [mailto:[EMAIL PROTECTED]]
Enviado el: martes 15 de enero de 2002 12:12
Para: Angel Fradejas
CC: Kannel Developers
Asunto: Re: timestamps with emi2


please send fixes in "diff -u" format attached as plain/text to the
devel@ list.

There are a couple of guys working (more or less) as active CVS
commiters, see ChangeLog. If your patch doesn't get applied for some
days ask someone personaly to commit it.

When you have contributed some patches we will vote for giving you cvs
write access, so you can perform it on your own.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



patch_date.diff
Description: Binary data


Re: timestamps with emi2

2002-01-15 Thread Stipe Tolj

please send fixes in "diff -u" format attached as plain/text to the
devel@ list.

There are a couple of guys working (more or less) as active CVS
commiters, see ChangeLog. If your patch doesn't get applied for some
days ask someone personaly to commit it.

When you have contributed some patches we will vote for giving you cvs
write access, so you can perform it on your own.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are




RE: timestamps with emi2

2002-01-15 Thread Angel Fradejas



Hi Dima,
 
The code you pointed just states the opposite. 
date_convert_universal is called when a valid emi2 timestamp is received. 

 
And it uses an 1-12 index on a monthstart[12] array. 
That's the problem. With the change I suggest I think we can fix 
it.
 
My question again: what is the way to send fixes? Is 
there anybody responsible to commit the CVS changes?
 

  -Mensaje original-De: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]En nombre de Dima 
  MilentievEnviado el: martes 15 de enero de 2002 
  9:12Para: Angel Fradejas; Kannel DevelopersAsunto: RE: 
  timestamps with emi2
  
  Hi 
  all,
   
  It seams we mix here 
  something.
   
  We do parsing but if 
  only if we have problem we entry in branch and call  date_convert_universal():
   
   
      
  if (octstr_parse_long(&unitime.second, tempstr, 10, 10) 
  != 12 ||
      
      (octstr_delete(tempstr, 10, 
  2),
      
   octstr_parse_long(&unitime.minute, tempstr, 8, 10) 
  != 10) ||
      
      (octstr_delete(tempstr, 8, 
  2),
      
   octstr_parse_long(&unitime.hour, tempstr, 6, 10) != 
  8) ||
      
      (octstr_delete(tempstr, 6, 
  2),
      
   octstr_parse_long(&unitime.year, tempstr, 4, 10) != 
  6) ||
      
      (octstr_delete(tempstr, 4, 
  2),
      
       octstr_parse_long(&unitime.month, tempstr, 2, 10) 
  != 4) ||
      
      (octstr_delete(tempstr, 2, 
  2),
      
   octstr_parse_long(&unitime.day, tempstr, 0, 10) != 
  2)) {
      
      error(0, "EMI 
  delivery time stamp looks malformed");
      
  notime:
      
      
  time(&msg->sms.time);
      
  }
      
  else {
      
      unitime.year += 2000; /* Conversion function expects full 
  year */
      
      msg->sms.time = date_convert_universal(&unitime);
      
  }
   
      
  And about date_convert_universal in date.c
      
  May be I mistake but it’s look like we use that to get time in Unix 
  format in case of broken timestamp not reverse.
      
  
      
  MO time stamp is correct all you need to format it as you 
  want.
      
  
      
  Dima.
      
      
  
   
  -Original 
  Message-From: Angel 
  Fradejas [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 8:29 
  PMTo: Kannel 
  DevelopersSubject: 
  timestamps with emi2
   
  
  I recently 
  began to work with a EMI2 smsc link, and have a question about the calculation 
  of the timestamps for the MO messges. 
  
   
  
  First, the code at 
  smsc_emi2.c splits day,month,year, and so on, and then it takes the 
  corresponding time_t by calling 
  date_convert_universal.
  
   
  
  The question 
  is the timestamp I'm getting in the msg->sms.time variable is one month 
  ahead the real one. For example for the EMI2 timestamp "140102185129" I 
  get a timestamp representing "14/02/2002 18:51:29 
  UTC".
  
   
  
  I think the 
  problem is in de date.c function 
  date_convert_universal:
  
   
  
      line 
  81:  date += monthstart[t->month] * 
  DAY;
  
   
  
  Shouldn't it 
  be 
  
   
  
      line 
  81:  date += monthstart[t->month-1] * 
  DAY;
  
   
  
  ?
  
   
  
  Or am I doing 
  something wrong?
  
   
  
  I need exacts 
  timestamps because we have to do accounting fo the sms 
  traffic.
  
   
  
  Angel 
  Fradejas.
  
   


RE: timestamps with emi2

2002-01-15 Thread Dima Milentiev









Hi all,

 

It seams we mix here something.

 

We do parsing but if only if we have
problem we entry in branch and call  date_convert_universal():

 

 

    if
(octstr_parse_long(&unitime.second,
tempstr, 10, 10) != 12 ||

        (octstr_delete(tempstr, 10, 2),

     octstr_parse_long(&unitime.minute, tempstr, 8, 10)
!= 10) ||

        (octstr_delete(tempstr, 8, 2),

     octstr_parse_long(&unitime.hour, tempstr, 6, 10) != 8)
||

        (octstr_delete(tempstr, 6, 2),

     octstr_parse_long(&unitime.year, tempstr, 4, 10) != 6)
||

        (octstr_delete(tempstr, 4, 2),

         octstr_parse_long(&unitime.month,
tempstr, 2, 10) != 4) ||

        (octstr_delete(tempstr, 2, 2),

     octstr_parse_long(&unitime.day, tempstr, 0, 10) != 2))
{

        error(0, "EMI delivery time stamp
looks malformed");

    notime:

        time(&msg->sms.time);

    }

    else
{

        unitime.year += 2000;
/* Conversion function expects full year */

        msg->sms.time = date_convert_universal(&unitime);

    }

 

    And
about date_convert_universal in date.c

    May
be I mistake but it’s look like we use that to get time in Unix format in
case of broken timestamp not reverse.

    

    MO
time stamp is correct all you need to format it as you want.

    

    Dima.

        

 

-Original Message-
From: Angel Fradejas
[mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 14, 2002
8:29 PM
To: Kannel Developers
Subject: timestamps with emi2

 



I recently began to work
with a EMI2 smsc link, and have a question about the calculation of the
timestamps for the MO messges. 





 





First, the code at
smsc_emi2.c splits day,month,year, and so on, and then it takes the
corresponding time_t by calling date_convert_universal.





 





The question is the
timestamp I'm getting in the msg->sms.time variable is one month ahead the
real one. For example for the EMI2 timestamp "140102185129" I
get a timestamp representing "14/02/2002 18:51:29 UTC".





 





I think the problem is in de
date.c function date_convert_universal:





 





    line
81:  date += monthstart[t->month] * DAY;





 





Shouldn't it be 





 





    line
81:  date += monthstart[t->month-1] * DAY;





 





?





 





Or am I doing something
wrong?





 





I need exacts timestamps
because we have to do accounting fo the sms traffic.





 





Angel Fradejas.





 










RE: timestamps with emi2

2002-01-14 Thread Angel Fradejas

>>I think the problem is in de date.c function date_convert_universal:
>>line 81:  date += monthstart[t->month] * DAY;
>>Shouldn't it be
>>line 81:  date += monthstart[t->month-1] * DAY;
>>?
>>Or am I doing something wrong?
>>I need exacts timestamps because we have to do accounting fo the sms
traffic.

>sounds reasonable assumption. the unix represenation of timestamps start
with month 0-11.

>Andreas Fink

So who's the person responsible for date.c? Or should I send a patch?

Angel Fradejas.





timestamps with emi2

2002-01-14 Thread Angel Fradejas



I recently 
began to work with a EMI2 smsc link, and have a question about the calculation 
of the timestamps for the MO messges. 
 
First, the code at smsc_emi2.c splits day,month,year, and so on, and 
then it takes the corresponding time_t by calling 
date_convert_universal.
 
The question 
is the timestamp I'm getting in the msg->sms.time variable is one month ahead 
the real one. For example for the EMI2 timestamp "140102185129" I get a 
timestamp representing "14/02/2002 18:51:29 UTC".
 
I think the 
problem is in de date.c function date_convert_universal:
 
    line 81:  date += monthstart[t->month] * 
DAY;
 
Shouldn't it 
be 
 
    line 81:  date += monthstart[t->month-1] * 
DAY;
 
?
 
Or am I 
doing something wrong?
 
I need 
exacts timestamps because we have to do accounting fo the sms 
traffic.
 
Angel 
Fradejas.