[sr-dev] Resetting private variables between requests?

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 18 15:35:46 CET 2017


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 at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170118/db2809d5/attachment.html>


More information about the sr-dev mailing list