Hi IƱaki,
I checked the code and made test calls that span multiple profiles. The calculus is correct.
The confusion likely arises because StartTime is printed in each span, while it is the StartTime of the call itself and not of the span.
Finally the sum of all spans equals the duration of the call. If you have data that contradicts this I would be happy to look at it again.
Regards, Adrian
>>>>>>>>>>
Hi, CDRTool can calculate the price of a call involving various spans (rates). But it does it wrongly since the start time for each span is set to the start time of the call, so the price is much higher than the correct one.
An example: This is a call of more than 3 days of duration. Note that in spans 2, 3 and 4 the "StartTime" is 2008-02-16 15:57:05 in all (the start time of
the call), and note also that the "Duration" of spans 2, 3 and 4 are the sum of each span and its previous spans:
-- Span: 1 Duration: 28975 s StartTime: 2008-02-16 15:57:05 (Europe/Madrid) ProfileId: 01 Festivo for weekend RateId: Reducida for 0-24h Rate: 0.0100 / 60 s Price: 4.8292 -- Span: 2 Duration: 115375 s <---- WRONG !!! StartTime: 2008-02-16 15:57:05 (Europe/Madrid) <---- WRONG !!! ProfileId: 01 Festivo for weekend RateId: Reducida for 0-24h Rate: 0.0100 / 60 s Price: 19.2292 -- Span: 3 Duration: 144175 s <---- WRONG !!! StartTime: 2008-02-16 15:57:05 (Europe/Madrid) <---- WRONG !!! ProfileId: 01 Laboral for weekday RateId: Reducida for 0-8h Rate: 0.0100 / 60 s Price: 24.0292 -- Span: 4 Duration: 229878 s <---- WRONG !!! StartTime: 2008-02-16 15:57:05 (Europe/Madrid) <---- WRONG !!! ProfileId: 01 Laboral for weekday RateId: Normal for 8-22h Rate: 0.0300 / 60 s Price: 114.9390 -- Total: 163.0765