[sr-dev] git:master: pv(k): added new PV class to get timeval attributes

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 29 10:37:32 CET 2010



On 1/28/10 7:28 PM, Daniel-Constantin Mierla wrote:
>
>
> On 1/28/10 7:11 PM, Klaus Darilion wrote:
>>
>>
>> Daniel-Constantin Mierla schrieb:
>>>
>>>
>>> On 1/28/10 6:27 PM, Klaus Darilion wrote:
>>>>
>>>>
>>>> Daniel-Constantin Mierla schrieb:
>>>>> Module: sip-router
>>>>> Branch: master
>>>>> Commit: 40a183b716853a08b523349b92a8d4ad0470e360
>>>>> URL:    
>>>>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=40a183b716853a08b523349b92a8d4ad0470e360 
>>>>>
>>>>>
>>>>> Author: Daniel-Constantin Mierla <miconda at gmail.com>
>>>>> Committer: Daniel-Constantin Mierla <miconda at gmail.com>
>>>>> Date:   Wed Jan 27 23:17:59 2010 +0100
>>>>>
>>>>> pv(k): added new PV class to get timeval attributes
>>>>>
>>>>> - $TV(s) - struct timeval tv_sec (cached per sip message)
>>>>> - $TV(u) - struct timeval tv_usec (cached per sip message)
>>>>> - $TV(sn) - struct timeval tv_sec (not cached)
>>>>> - $TV(un) - struct timeval tv_usec (not cached)
>>>>
>>>>
>>>> Who does uncached timeval work?
>>>>
>>>> e.g.: $avp{time}=$TV(sn) + "." + $TV(un).
>>>>
>>>> What happens if timeval is 0.999999 when calling $TV(sn) and 
>>>> timeval is 1.000000 when calling $TV(un)? Will the result be "0.0"?
>>> yes, so use cached :-).
>>>
>>> uncached is good if you use only one of attributes, maybe to measure 
>>> the diff between two calls or print it in logs.
>>
>> But as the example show, this would make only sense if both, sec and 
>> usec are returned with a single function call (single pseudo variable)
> that can be done, returned as string.
to close the thread, $TV(Sn) was added to return "sec.usec".

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the sr-dev mailing list