[SR-Users] Using $avp in evapi:message-received

Alex Balashov abalashov at evaristesys.com
Mon May 25 12:54:30 CEST 2015


Oh, I see. I think I misunderstood the thread when I wandered into it 
and saw your answer, thinking that the question was whether variables 
set prior to t_suspend() can be used in the route invoked by 
t_continue(). I should read more carefully.

-- Alex

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

> $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
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>


-- 
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list