[OpenSIPS-Users] async(wait_for_event()) statement in a branch_route[]

Vitalii Aleksandrov vitalik.voip at gmail.com
Fri Nov 2 06:04:44 EDT 2018


Hi Bogdan,

Ok. Let's say I have 5 branches and before calling t_relay() want to 
iterate over branches and do some async() action. From my understanding 
if I do something via async() it will suspend the whole transaction with 
all branches and if I need the same action for every branch it will 
create a big PDD because all async() calls will be done sequentially.

As a workaround I think I can send all branches to myself (spiral call) 
and receiving those INVITEs from loopback opensips will create a 
separate transaction for every destination so I'll be able to run 
async() tasks in parallel and forward a call to every destination 
immediately its async() task is finished.


> Hi Vitalii,
>
> The async() statement can be used only in REQUEST route. Still, 
> whatever you need to do in terms of async query from branch route can 
> also be done from request route.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
> OpenSIPS Bootcamp 2018
>   http://opensips.org/training/OpenSIPS_Bootcamp_2018/
>
> On 11/01/2018 01:46 PM, Vitalii Aleksandrov wrote:
>> Hi,
>>
>> I'm a bit new to opensips, while have some experience with kamailio.
>>
>> Trying to figure out whether it's possible to use async() statement 
>> from branch_route[].
>>
>> From the documentation I understood that async() functionality is 
>> tightly connected to the TM module and creates some context attached 
>> to a transaction, suspends it and resumes a transaction on an event. 
>> If said above is correct I suppose calling async() from a 
>> branch_route[] to suspend only one branch and expect that other 
>> branches will continue their normal execution is not what it was 
>> designed for..
>>
>> Is there any way to forward a branch while other branches wait for an 
>> async event or i/o?
>>
>> Would appreciate any ideas.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list