[OpenSIPS-Users] $var scope clarification

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Apr 13 18:42:43 CEST 2010


Hi Brett,

I see you missed the last webinar on script variables ;).

So, the $var() are script variables - you should not rely on any kind of 
persistence for them. They are intended to be used in script only (in 
route + all its subroutes).
You should use them for script ops (like iterations, building strings, etc)

This vars are not share at all and, as they are attached to processes, 
it is highly recommended to reset they value before using them in script.

Regards,
Bogdan

Brett Nemeroff wrote:
> Hello All,
> I've always been hesitant to use $var type variables over avps since
> they have a scope that spans the whole process.. Most of my need for
> variables is transactional. I'm just concerned about race conditions.
> Am I misunderstanding their scope? ie: $var(customer) is going to
> change from transaction to transaction and having that shared across
> an entire process wouldn't be good..
>
>
> Thanks for your insight.. :)
> -Brett
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list