<div dir="ltr"><div dir="ltr">Hello again!<div><br></div><div>My problem was solved by using <i>t_reuse_branch()</i> in <i>event_route[tm:branch-failure:FAILURE]</i>.</div><div><br></div><div>Thanks a lot!</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 19 бер. 2019 о 19:42 Володимир Іванець <<a href="mailto:volodyaivanets@gmail.com">volodyaivanets@gmail.com</a>> пише:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I just realized that <b>$T_branch(uri)</b> variable in <i>onreply_route[REPLY]</i> is always set to first Contact's Address from AoR list.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 19 бер. 2019 о 12:05 Володимир Іванець <<a href="mailto:volodyaivanets@gmail.com" target="_blank">volodyaivanets@gmail.com</a>> пише:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<div><br></div><div>I'll try to break down my scenario as detailed as I can :)</div><div><br></div><div>Following happens when Kamailio receives INVITE from Asterisk:</div><div>1. It decides if Asterisk reaches out to registered UAC.</div><div>2. <i>lookup("location")</i> is executed. AoR can have multiple Contacts.</div><div>3. Processing reaches branch_route[MANAGE_BRANCH]. String with rtpengine_offer parameters is being formed here. It can have different settings based on each Contact. <i>rtpengine_offer</i> is called.</div><div>4. Some phones will respond with 415 or 488. These responces are processed in event_route[tm:branch-failure:FAILURE].</div><div>5. Alternative rtpengine_offer parameters are compiled. This time <b>call-id</b> is set to value from <b>Call-ID</b> plus a <b>suffix</b>. This information is stored in Htable. <i>rtpengine_offer</i> is called.</div><div>6. <b>$du</b> is set from apropriate Contact's data from <i>reg_fetch_contacts("location", "$ru", "callee")</i> and <i>t_relay()</i> is called.</div><div>7. Responce 200 for this branch will be processed in <i>onreply_route[REPLY]</i>. rtpengine_answer parameters are formed including <b>call-id</b> and <i>rtpengine_answer</i> is executed.</div><div><br></div><div>The problem is that that I was not able to rely responce on step 7 to new request from steps 4-6. I figured that <b>$(ulc(callee=>addr)[$var(i)])</b> in <i>event_route[tm:branch-failure:FAILURE]</i> will be the same as <b>$T(ruid)</b> in <i>t_on_reply("REPLY").</i> At this point I need to perform comparison of <b>$T(ruid)</b> to saved values from Htable.</div><div><br></div><div>These values have few dozens of characters and operation of comparison does not look to be efficient.</div><div><br></div><div>It also looks like <b>$T_branch(uri)</b> variable (which could be perfect to use on step 7) is not available in responce to new branch because how I set <b>$du</b> and called <i>t_relay()</i>. I was trying to call <i>lookup("location")</i> before <i>t_relay()</i> and <b>$T_branch(uri)</b> would be available but since each AoR can have multiple Contacts this will not work.<br></div><div><br></div><div>Please let me know if I need to provide any clarifications. I will really appreciate any suggestions on improvements that cam be made here.</div><div><br></div><div>Thanks a lot!</div></div></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 18 бер. 2019 о 22:51 Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> пише:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Mar 18, 2019 at 12:43:25PM +0200, Володимир Іванець wrote:<br>
<br>
> I found much better description of the problem here<br>
> <a href="https://lists.kamailio.org/pipermail/users/2008-August/019070.html" rel="noreferrer" target="_blank">https://lists.kamailio.org/pipermail/users/2008-August/019070.html</a>.<br>
<br>
Wow. That is some rather ancient history. And I think reflects a<br>
different place in the evolution of my own understanding of<br>
Kamailio/OpenSER; it was 11 years ago. I don't know if the question is<br>
very pertinent today as formulated there.<br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>