[OpenSIPS-Users] STOP waiting for new branches and close transaction by t_wait_no_more_branches()

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Aug 19 14:29:33 UTC 2022


Hi,

So recap'ing the scenario here:

When you get the initial incoming INVITE, you do not send out any 
branch. All the outbound branches are created via the t_inject, right ? 
So INVITE come in, nothing, then the REGISTER triggeres a new branch, 
and this new branch gets replied with 486. And you want to stop the 
waiting at this point, right ?

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
   https://www.opensips.org/events/Summit-2022Athens/

On 8/12/22 3:12 PM, Ярослав Нападайло via Users wrote:
> Hi everybody!
>
> I'm writing script with Push Notification mechanism using TM module 
> and t_wait_for_new_branches() function and EBR.
> Here example in docs
> https://opensips.org/docs/modules/3.2.x/event_routing.html#idp5576704 
> <https://opensips.org/docs/modules/3.2.x/event_routing.html#idp5576704>
>
> My  is:
>
> route {
>       ...
>       t_newtran();
>       ....
>       create_dialog();
>       ...
>       t_on_reply("HANDLE_REPLY");
>       t_wait_for_new_branches();
>       ....
>       notify_on_event("E_UL_CONTACT_INSERT", $avp(filter), 
> "fork_call", $var(ttl));
> }
>
> onreply_route[HANDLE_REPLY] {
>   xlog("L_DBG", "received reply $rs $rr");
>   switch($rs) {
>     case "486":
>       xlog("L_DBG", "wait no more branches DLG_DID=$DLG_did");
>       t_wait_no_more_branches();
>       t_cancel_branch("a");
>       break;
>     default:
>   }
> }
>
> route[fork_call] {
>   xlog("L_DBG", "[$ci] user $avp(aor) registered a new contact 
> $avp(uri), injecting");
>   t_inject_branches("event");
> }
>
> First, I create dialog. Then, call t_wait_for_new_branches() and set 
> notify_on_event() handler.
> Then I'm waiting for new REGISTERs. When new contacts register to 
> usrloc, I'm injecting received contacts as new branches to current 
> transaction.
> I do all things as described in docs.
> Now I want to control negative replies from ongoing branches. By 
> default, OS ignores negative replies and continue waiting for new 
> branches. For example, I want to ignore 480, but handle 486.
> I try handle 486, calling t_wait_no_more_branches().
> I expect that OS will stop waiting for new branches and 
> t_inject_branches  will not add anymore.
> Also I expect that OS stop PHONY branch, which is created first when 
> calling t_wait_for_new_branches(), and sends final response (486 in my 
> case) to caller.
> But in real next things happen:
> 1. t_wait_no_more_branches() doesn't affect adding new branches. If 
> 1st callee reject call, then 2nd callee register new contact, 
> t_inject_branches() adds new branch all the same
> 2. If no other branches added, caller hears ringing until 
> FR_INV_TIMEOUT expires. And only when FR_INV_TIMEOUT expires, OS sends 
> final response to caller.
>
> WIDW??
>
> How to stop transaction immeditially when at least one ongoing branch 
> reply 486 code and to wait no more for any branches?
> Thx for answers
>
> -- 
> Regards,
> Yaroslav Napadilo
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220819/9c5ee381/attachment.html>


More information about the Users mailing list