<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br><br>lets say you have 2 branches 0 towards user in location and 1 towards PSTN.<br>&nbsp;<br>I suggest to use branch flags which are used to activate some functions in branch level<br><br>when creating the branches in main route use this variable <b><strong>$branch()</strong></b> to set branch flags to each indivisual branch depending on its index 0 for branch 0 and 1 for branch 1.<br><br>use branch routing blocks to execute certain logic (it could be the manipulation ) for each branch before forwarding the request.<br><br>// Binan<br><br>--- On <b>Thu, 8/30/12, Jayesh Nambiar <i>&lt;jayesh.voip@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Jayesh Nambiar &lt;jayesh.voip@gmail.com&gt;<br>Subject: [OpenSIPS-Users] Parallel forking and per branch
 manipulation<br>To: "OpenSIPS users mailling list" &lt;users@lists.opensips.org&gt;<br>Date: Thursday, August 30, 2012, 8:11 AM<br><br><div id="yiv558436653">Hi All,<div>I have a scenario to do parellel forking between the user found in location and towards a PSTN gateway. The requirement here is, I have unique manipulations to be done before routing the call which I believe can be done using branch routes, but I'm just wondering how.&nbsp;</div>
<div>For eg: The branch that goes to the user found from location should have no FROM Header manipulation and the branch that goes out to PSTN gateway needs a uac_replace_from("<a rel="nofollow" ymailto="mailto:sip%3A123456789@1.2.3.4" target="_blank" href="/mc/compose?to=sip%3A123456789@1.2.3.4">sip:123456789@1.2.3.4</a>"), and insert_hf("P-Asserted_Identity: <a rel="nofollow" ymailto="mailto:sip%3A123456789@1.2.3.4" target="_blank" href="/mc/compose?to=sip%3A123456789@1.2.3.4">sip:123456789@1.2.3.4</a>\r\n") before calling t_relay(). There are many other manipulations like this.</div>
<div>How do I take the script logic to individual branch routes before calling t_relay, because whats happening with me is once the location is looked up, I go ahead for manipulations that is supposed to be done for the gateway branch, but it gets applicable for the branch that goes out to the user as well !!</div>
<div><br></div><div>Probably I am missing something on my understanding on how to call branch_routes while doing parallel forking.</div><div><br></div><div>Thanks for any help.</div><div><br></div><div>--- Jayesh</div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opensips.org" href="/mc/compose?to=Users@lists.opensips.org">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></div></blockquote></td></tr></table>