Accounting modules differences between duration and ms_duration fields

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Accounting modules differences between duration and ms_duration fields

Arto Kuiri

Hi,

I have noticed n accounting module that there seems to be differences between cdr fields "duration" and "ms_duration".

You can notice it even from opensips documentation:
http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting#toc11

If you check CDR example:
ACC: call ended: created=1474639265;call_start_time=1474639281;\
 
duration=5;ms_duration=4250;setuptime=16;method=INVITE;from_tag=1515466979;\
   to_tag=1284910.0.0.1351;call_id=1766189979;code=200;reason=OK

ms_duration= 4250 and still duration field is 5, although it should be 4 ?

I first thought that it could be that duration is rounded up, but we have cdr's where duration is rounded down,
like ms_duration 1926 => duration 1.

Any idea why it behaves like that?

Regards,
Arto Kuiri




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Accounting modules differences between duration and ms_duration fields

Liviu Chircu

Hi Arto,


Second-precision does not imply "differences are always positive". If a call starts at second offset 1.999 and ends at 2.000, it will have incorrectly lasted 1 second instead of 0 seconds. Conversely, if it starts at second offset 2.000 and ends at 2.999, the duration will be 0 seconds, instead of 1.


In other words, the expected error of the "duration" column is anything between [-0.(9), +0.(9)] seconds. If this is not enough for you, you should only make use of "ms_duration", which has an expected error of [-0.(9), +0.(9)] milliseconds.


I hope this clears things up,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 30.04.2018 13:57, Arto Kuiri wrote:
Hi,

I have noticed n accounting module that there seems to be differences between cdr fields "duration" and "ms_duration".

You can notice it even from opensips documentation:
http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting#toc11

If you check CDR example:
ACC: call ended: created=1474639265;call_start_time=1474639281;\
 
duration=5;ms_duration=4250;setuptime=16;method=INVITE;from_tag=1515466979;\
   to_tag=1284910.0.0.1351;call_id=1766189979;code=200;reason=OK

ms_duration= 4250 and still duration field is 5, although it should be 4 ?

I first thought that it could be that duration is rounded up, but we have cdr's where duration is rounded down,
like ms_duration 1926 => duration 1.

Any idea why it behaves like that?

Regards,
Arto Kuiri





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users