[SR-Users] AVPs in timer-route

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 29 09:52:27 CEST 2012


Hello,

On 3/21/12 6:05 PM, Klaus Darilion wrote:
> On 20.03.2012 23:36, Daniel-Constantin Mierla wrote:
>> Hello,
>>
>> On 3/20/12 8:13 PM, Klaus Darilion wrote:
>>> Hi!
>>>
>>> I wonder what happens to AVPs defined in a route which is executed by
>>> rtimer?
>>>
>>> It seems (tests on Kamailio 1.5) that the AVPs, once they are defined,
>>> they life forever. This would be fine for my application.
>>>
>>> Are there any issues when using AVPs in timer routes?
>> there is no issue using avps in rtimer routes. Those routes process a
>> faked sip message, which does not change, just the internal id is
>> increased. AVPs live for ever because they are cleaned up after a
>> received messages is processed, but in this case there is no received
>> context. It can be added to reset avps in rtimer module.
>>
>> On the other hand, avps are usually useful in context of a real sip
>> message. Why you need them in a timer route?
>
> I use rtimer module (backported from 1.5 to a quite extended openser 
> 1.3) to dump statistics in the timer route. The first time the timer 
> route is executed I define some AVP-arrays (e.g. IP addresses of 
> servers) over wich I loop in a while loop to dump the respective 
> statistics.
Then it is working fine with current implementation - the avps 
associated to the fake message given to timer route are not deleted at 
all, avp_delete() from avpops can be used to do it on purpose if one wants.

Btw, if you load the lost from a db table, if you use sqlops/sql_query() 
and don't free the result, it is available again and again -- it is 
another way to keep some data in private memory and be able to loop over 
it many times.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/




More information about the sr-users mailing list