<div dir="ltr"><div><div><div><div>Hi everybody!<br><br></div>I'm writing script with Push Notification mechanism using TM module and t_wait_for_new_branches() function and EBR.<br></div><div>Here example in docs <br><a href="https://opensips.org/docs/modules/3.2.x/event_routing.html#idp5576704">https://opensips.org/docs/modules/3.2.x/event_routing.html#idp5576704</a></div><div><br></div>My  is:<br><br></div>route {<br>      ...<br></div><div>      t_newtran();</div><div>      ....<br></div><div>      create_dialog();<br>      ...<br></div><div>      t_on_reply("HANDLE_REPLY");<br></div><div>      t_wait_for_new_branches();<br>      ....<br>      notify_on_event("E_UL_CONTACT_INSERT", $avp(filter), "fork_call", $var(ttl));<br></div><div>}<br><br>onreply_route[HANDLE_REPLY] {<br>  xlog("L_DBG", "received reply $rs $rr");<br>  switch($rs) {<br>    case "486":<br>      xlog("L_DBG", "wait no more branches DLG_DID=$DLG_did");<br>      t_wait_no_more_branches();<br>      t_cancel_branch("a");<br>      break;<br>    default:<br>  }<br>}<br><br>route[fork_call] {<br>  xlog("L_DBG", "[$ci] user $avp(aor) registered a new contact $avp(uri), injecting");<br>  t_inject_branches("event");<br>}<br><br></div><div>First, I create dialog. Then, call t_wait_for_new_branches() and set notify_on_event() handler.<br></div><div>Then I'm waiting for new REGISTERs. When new contacts register to usrloc, I'm injecting received contacts as new branches to current transaction.<br></div><div>I do all things as described in docs.<br></div><div>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.<br></div><div>I try handle 486, calling t_wait_no_more_branches().<br></div><div>I expect that OS will stop waiting for new branches and t_inject_branches  will not add anymore.<br></div><div>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.<br></div><div>But in real next things happen:<br></div><div>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<br></div><div>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.<br><br></div><div>WIDW??<br><br></div><div>How to stop transaction immeditially when at least one ongoing branch reply 486 code and to wait no more for any branches?<br></div><div>Thx for answers<br></div><div><div><div><div><div><div><div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>Regards,</div><div>Yaroslav Napadilo<br></div></div></div></div></div></div></div></div></div></div>