[SR-Users] $var(name) - Private memory variables

Alex Balashov abalashov at evaristesys.com
Sat Jul 21 20:40:26 CEST 2018


On Sat, Jul 21, 2018 at 02:33:45PM -0400, John Petrini wrote:

> You need to use an avp or an xavp instead of a var. As far as I understand
> it a var is tied to a particular thread (which will be reused) while avp's
> live in shared memory and are unique to each dialog.

Almost accurate. (X)AVPs are transaction-persistent, not
dialog-persistent.

Dialog-persistent variables are possible, though, either by using
Record-Route parameters that travel around with every in-dialog request
and reply, or a more stateful approach using $dlg_var:

   https://www.kamailio.org/wiki/cookbooks/5.1.x/pseudovariables#dlg_var_key

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list