<div dir="ltr">Hi,<div>to achieve the described behavior you could call t_on_branch(BRANCH_NAME) before calling t_relay.</div><div>In this way each branch, after forking and before being relayed, will traverse the branch_route named BRANCH_NAME.</div><div><br></div><div><a href="http://www.kamailio.org/docs/modules/devel/modules/tm.html#tm.f.t_on_branch" target="_blank">http://www.kamailio.org/docs/modules/devel/modules/tm.html#tm.f.t_on_branch</a><br></div><div><br></div><div>Hope this helps.</div><div><br></div><div>Regards,</div><div><br></div><div>Federico</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 2, 2015 at 7:43 PM, Andrey Utkin <span dir="ltr"><<a href="mailto:andrey.krieger.utkin@gmail.com" target="_blank">andrey.krieger.utkin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
Currently we have the following logic in our Kamailio routing script.<br>
On incoming INVITE, we lookup() the location of called party, then we<br>
analyse the updated Request-URI ($ru) regarding callee contact<br>
protocol: is it websocket-based or not, to distinguish web-based<br>
useragents from classic SIP agents and provide RTP profiles<br>
interconnection with rtpengine (RTP/SAVPF for web-based, RTP/AVPF for<br>
the rest). After that, we relay the mangled INVITE to callee<br>
location(s) with t_relay().<br>
<br>
The issue arises when callee has both websocket-based and classic<br>
useragents registered simultaneously. According to lookup() manual, it<br>
replaces Req-URI with just one contact, and somehow also attach<br>
metainformation about additional locations, so that t_relay() forks<br>
the call.<br>
<br>
lookup() does not provide the possibility to fork the execution of<br>
routing script, so that we could execute our routing logic described<br>
above. But I would love this to be possible, because the only<br>
alternative way for calling to multiple locations seems to be the<br>
serial forking described in TM module manual. But we don't need serial<br>
calling contact-by-contact, waiting for call failures, we need<br>
parallel calling to all available user locations.<br>
<br>
So we need an advice how to go. Is there a way to implement what we<br>
need at scripting level, or should this feature be implemented in<br>
Kamailio code (or is it already there?).<br>
Thanks in advance for any help.<br>
<span><font color="#888888"><br>
--<br>
Andrey Utkin<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</font></span></blockquote></div><br></div></div>