[OpenSIPS-Users] CDR Accounting

Anton Zagorskiy a.zagorskiy at oyster-telecom.ru
Tue Jan 25 10:28:37 CET 2011


Hi Dave.

> So just to be sure I'm clear on this. $Ts rounds down ( truncates ) the
current second. So using $avp(s:start_time) = $Ts.$Tsm; would give something
like "12343253.543233" and always be accurate?

You should understand that $Ts.$Tsm is two independent calls to the system
time function. So actually $Tsm isn't microseconds of $Ts.

P.S. Could you please use any brackets to mark original letter or send your
answer in the plain text fromat?



> Thanks for that clarification!

> So just to be sure I'm clear on this. $Ts rounds down ( truncates ) the
current second. So using $avp(s:start_time) = $Ts.$Tsm; would give something
like "12343253.543233" and always be accurate?
> Further (standard ACC [without dialog]) you could just put $Tsm in the
db_extras as an extra column and then use the tool you are using to created
cdrs from the acc table to take the column with the $Tsm value into account
when > calculating duration, ringtime, etc.
> To get these numbers with the new CDR feature, you would have to store a
dialog variable like $dlg_val("start") = "$Ts.$Tsm" at start
and $dlg_val("answered") = "$Ts.$Tsm" at answer and at the end of the call
add them db_extras > along with $Ts.$Tsm for the end of the call. You would
then want to go off of those numbers rather than what the acc module
automatically put in the db.
> The disadvantage would be having duplicate columns for start/answer/end
times but you would still have the benefit of not having to have an external
process building cdrs from acc table matching up BYEs to INVITES, etc.
> Calculating the durations in opensips would be tricky since it does not
work with non integers. But you could do that easily with a sql trigger on
the record insert.

> Does this sound right?

> Thanks
> Dave

> On Thu, Jan 20, 2011 at 4:54 AM, Anca Vamanu <anca at opensips.org> wrote:
> On 01/19/2011 09:31 PM, a.zagorskiy at oyster-telecom.ru wrote:
> It was my conversation, and I told about
> 1) $Tsm is MICROseconds (6 digits)
> 2) It is microseconds of a current second.
> Yes, that's true. I fixed it in documentation also.

> -- 
> Anca Vamanu
> www.voice-system.ro



_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





More information about the Users mailing list