Hi Daniel,

Thanks for your response.

Any thoughts to my later comments? i.e. would you consider a patch that resets these variables between top-level request_route executions, either by $var(all) = $null, and/or modparam behavior, and/or something else?

BTW, is the current behavior done this way for a specific reason or foreseen complication (i.e. one that I am not seeing at the moment)?

Thanks!

Armen

On Wed, Jan 18, 2017 at 6:35 AM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:

Hello,

preparing the release of v4.4.5 and digesting the sr-dev mailing list activity, I noticed that this was not answered.

The $var(x) type of variables is not reset, they persist over execution of the routing blocks. Their values are stored in private memory, so they are like global variables per each kamailio process/worker. You have to reset them explicitly.

Cheers,
Daniel


On 26/11/2016 00:19, Armen Babikyan wrote:
Hello,

I recall reading somewhere that all private variables (i.e. $var(foo)-style pvs) are reset/destroyed between request_route executions, but I have a suspicion this is not happening - either in some limited cases or perhaps in all cases.

I suppose the most telling symptom is that I see no references to either destroy_vars() or reset_vars() functions that are defined in $kamailio/modules/pv/pv_svar.{c,h}.

Is this behavior intentional?  If so, I'll see what I can do about implementing a mechanism that manually resets (or destroys?) variables with a  "$var(all) = $null;"-type of statement (similar to "$uac_req(all) = $null;"), or making a modparam setting that automatically does this.

Thoughts welcome.  Thanks!

Armen



_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com