[OpenSIPS-Users] R: Milliseconds in the accounting table

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Feb 17 00:02:15 CET 2009


Hi Mauro,

are you sure you added an onreply_route[] for the call and store the 
time into the $var(x)?

    onreply_route[1] {
       if (t_check_status("200")) {
          $var(x) = $Ts;
       }
    }

and set $var(x) as extra acc :
    modparam("acc", "db_extra", "custom_time=$var(x)")

Regards,
Bogdan


Mauro Davi' wrote:
> Hi Bogdan,
>
> I modified the script as you said but in the DB there is always the same
> problem.
> I used an avp variable to store the time value in the onreply_route
> function, now I invoke the t_on_reply()function before the INVITE
> t_relay() function.
> When the server received the 200 OK (onreply_route function), I see the
> correct time value in the log file, but the stored value on the DB is
> different. It is the time taken at the INVITE received time...I Think...
> Any suggestions??
>
> Thanks a lot
>     MD
>
> -----Messaggio originale-----
> Da: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro] 
> Inviato: sabato 14 febbraio 2009 22:22
> A: Mauro Davi'
> Cc: users at lists.opensips.org
> Oggetto: Re: [OpenSIPS-Users] Milliseconds in the accounting table
>
> Hi Mauro,
>
> The "time" for accounting is when the reply is received - for the acc'ed
>
> INVITEs, it is the time for the 200 OK reply.
>
> So, what you can do is to use onreply_route to store in a $var(x) the 
> string with the time representation you want and set $var(x) as extra
> acc;
>
> Regards,
> Bogdan
>
> Mauro Davi' wrote:
>   
>> Hi,
>>
>> I'm always a newbye so be patient.
>>
>> I need to trace in the accounting table the start/stop dialog time in 
>> milliseconds.
>>
>> I don't know if this is the correct way, but I modified the cfgutils. 
>> Now I can write $time(msec) and I receive the millisecs...
>>
>> So I store this information in an avp variable that I store on the DB 
>> in the acc table via the multi_leg_info parameter.
>>
>> Obviusly I store the entire date time in the form 
>> $time(year)/$time(mon)/$time(mday) 
>> $time(hour):$time(min):$time(sec).$time(msec).
>>
>> Problem: The date time stored for the INVITE message, with this method
>>     
>
>   
>> differ to the time writed in the time field on the same acc table...
>>
>> I think that the time saved in the time field is that of the received 
>> ACK message... On the otherhand the time saved with the multi_leg_info
>>     
>
>   
>> is the time of the first INVITE...
>>
>> I need the correct date time with millisecs of a dialog start/stop, so
>>     
>
>   
>> the time field in the accounting table isn't good enough...
>>
>> Any suggestion to bypass this problem?
>>
>> Thanks in advance
>>
>> MD
>>
>>
>>     
> ------------------------------------------------------------------------
>   
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>   
>>     
>
>
>   




More information about the Users mailing list