[OpenSIPS-Users] EBR and wait_for_event() timeout

Vitalii Aleksandrov vitalik.voip at gmail.com
Tue Nov 27 10:02:41 EST 2018


Hi Bogdan,
Instead of t_inject_branches I use t_relay() from wait_for_event() 
callback. As far as I understood the logic is the same. t_relay should 
just fail if transaction connected to the waiting context has been 
canceled by that time.
Thanks for the detailed reply.
> Hi Vitalii,
>
> The waiting for the event is not strong correlated with the 
> transaction. The transaction may disappear while waiting. The waiting 
> context is only keeping a reference to the transaction, so the 
> t_inject_branch() can look it up (if still exists).
> So, if the transaction is canceled, the event waiting is not affected, 
> it will still be triggered, but the t_inject will fail (either with 
> transaction not found, either with not able to create more branches on 
> a canceled transaction).
>
> 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/16/2018 07:07 PM, Vitalii Aleksandrov wrote:
>> Thanks for the information. Have one more related question.
>>
>> What If I call somewhere, opensips calls wait_for_event() and before 
>> the event happens or async timeout (will create a bug report) fired I 
>> CANCEL the call.
>> Since async() keeps some context in transaction structure and this 
>> transaction is already canceled should I expect that async() task is 
>> also canceled and will never call a callback route? Or should I 
>> always check  t_was_cancelled() in the beginning of a callback route?
>>
>>
>>> Hi Vitalii,
>>>
>>> For the wait_for_event(), the timeout seems to have no effect, the 
>>> waiting being for ever :-| . The transaction has no timeout as you 
>>> didn;t sent out any branch yet (the transaction timeout is for 
>>> waiting on replies).
>>>
>>> Could you please open bug report on the opensips tracker on github ?
>>>
>>> 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/14/2018 03:17 PM, Vitalii Aleksandrov wrote:
>>>> Hi,
>>>>
>>>> event_routing module provides the great async function 
>>>> wait_for_event().  If script subscribes for a event and received it 
>>>> it calls some "resume_route".
>>>> What I can't understand is what happens with a transaction if 
>>>> wait_for_event() never catches an event and reaches its timeout.
>>>> Is the any way to continue script execution from the place where 
>>>> "wait_for_event() was called or to execute some "timeout_route" to 
>>>> handle transaction properly?
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>



More information about the Users mailing list