$var(x) keeps the value in the context of the process. t_continue() doesn't delegate route execution to other processes, it is executed in the context of same process. So, yes, it is also the same for rtimer processes. Actually, I can bet more for rtimer case, for evapi, I will need to double check, because the libev might create some extra threads around...

In other words, t_continue(tindex, tlabel, rtname) is like:

set_active_transaction(tindex, tlabel);
route(rtname);

t_suspend() is the one that parks the transaction and you can resume processing it with t_continue() in other process, so if you set $var(x) before t_suspend(), don't expect proper value at t_continue().

Cheers,
Daniel

On 25/05/15 12:35, Alex Balashov wrote:
Daniel,

On 05/25/2015 06:32 AM, Daniel-Constantin Mierla wrote:

yes, it is safe to use $var(x) to pass values between the block
calling t_continue() and the route executed by t_continue().

Why is that, when the scope of $var() variables is, as I understand it, maintained only by a given SIP receiver thread?

Regardless, is this true only when async task workers are used, or is this also true with other mechanisms, like resuming suspended transactions in rtimer threads?


-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com