<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi Babak,<br>
<br>
Yes, the 'r' flag in lookup() is the magic one here, but you do
not have to use append_branch() 2 times before the lookup. Just
set the first AOR into RURI and the second one have it appended as
branch - this is all you need to do before the lookup().<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
</pre>
<div class="moz-cite-prefix">On 4/14/20 4:25 PM, Babak Yakhchali
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEVfcaY12kK1f1YJUb=YYRviajLgbcKCY9hghA4_w0OjietZhQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">For anyone interested:
<div>I used append_branch() two times to create 2 branches. then
using </div>
<div> $(branch(uri)[1]) = $avp(other_aor);<br>
</div>
<div>I set the second branch to go for other AOR, now calling
lookup() like this:</div>
<div> lookup("location","r")<br>
</div>
<div>will create all needed branches based on the 2 already
created branches and removes them from destination set. Till
now invites are generated for different contacts, BUT there is
a problem with clients registered with second contact, because
To header is based on the first AOR in ruri and they will not
accept the invite message, to solve this I used a branch route
and changed the To header like this:</div>
<div><br>
</div>
<div>branch_route[per_branch_ops] {</div>
<div>
<div> if($tU != $rU){</div>
uac_replace_to("","$avp(other_aor)");<br>
}</div>
<div>}<br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Apr 14, 2020 at 12:46
PM Babak Yakhchali <<a
href="mailto:babak.freeswitch@gmail.com"
moz-do-not-send="true">babak.freeswitch@gmail.com</a>>
wrote:<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">Hi
<div>I'm trying to implement this scenario:</div>
<div>each user has two AORs. one for mobile and one for a
userId (random string)</div>
<div>at any time user may be registered on one, both or none
of these AORs</div>
<div>when a call comes to one of these AORs the other one
must be called too (if there is a registered contact for
it)</div>
<div><br>
</div>
<div>reading the documents I think I need to use
lookup("location","r"). but I don't know how should I add
branches before calling it for the two AORs</div>
<div><br>
</div>
<div>thanks</div>
</div>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>