[OpenSIPS-Users] EBR and wait_for_event() timeout

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Nov 27 06:09:09 EST 2018


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