[SR-Users] Keeping track of routing/dialog attribute value pairs

Daniel Tryba d.tryba at pocos.nl
Fri Apr 10 14:21:20 CEST 2015

On Friday 10 April 2015 13:16:40 Dirk Teurlings - SIGNET B.V. wrote:
> Throughout the routes of kamailio we use multiple variables. These 
> consist of $var, $avp, $dlg_var and probably more. What's the policy for 
> these variables when used. When, if even, are they being cleaned up 
> after a call has been terminated.

These variables are limited to their scope, a $var is valid in the current SIP 
message. An $avp's scope is a SIP transaction (eg from INVITE til the end of a 
BYE), the same for $dlg_var but then only when using the dialog module. 

Destroying seems to be handled internally by kamailio core at the end of a 
message, by (I guess) tm.so for $avp and dialog.so for dlg_var at the end of 
the transactions lifetime. You don't need to do manual garbage collection, 
avp_delete can be used to unset avps within scope though.

More information about the sr-users mailing list