<div dir="ltr"><div>OK...</div>
<div>It worked great... and, no append_branch() was needed... only t_on_branch with the main branch route.</div>
<div>When will i need to use the append_branch? </div>
<div>BR,</div>
<div>Uri<br><br></div>
<div class="gmail_quote">On Wed, Mar 28, 2012 at 4:00 PM, Uri Shacked <span dir="ltr">&lt;<a href="mailto:ushacked@gmail.com" target="_blank">ushacked@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div dir="ltr">
<div>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Hi,</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Thanks, this was very helpful for understanding.</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Still let’s see if i got it right:</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">I get the INVITE.</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Do whatever I do on the main route.</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Then do:</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">“append_branch();”</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">“changes….changes…..;”</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt"><span> </span>Now before the t_relay do t_on_branch(name of branch).</span></p>

<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Get the reply (301 in my case)</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">And from here I am back to the original request?</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">maybe a stupid question now but - I must use the <span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">append_branch()  right :-)?</span></span></p>

<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">BR,</span></p>
<p style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 6pt" class="MsoNormal"><span style="FONT-FAMILY:&#39;Times New Roman&#39;,&#39;serif&#39;;FONT-SIZE:12pt">Uri</span></p></div>
<div> </div>
<div> </div>
<div>Hi,<br><br>On 03/27/2012 04:46 PM, Uri Shacked wrote:<br>&gt;<i> In my case i need to change the header and then send it. <br></i>&gt;<i> <br></i>&gt;<i> Here the case works if i make the changes after i sent the invite and<br>
</i>&gt;<i> got the reply. As i know the t_on_branch will work after the invite is</i></div>&gt;<i> sent... am i wrong?<br></i>&gt;<i> <br></i>&gt;<i> There are many questions to ask about the branches... when do they work </i>&gt;<i> in a serial manner, when parallel... where can i find it documented best?<br>
</i><br>Actually it&#39;s quite simple. If a request comes in and you modify it in a<br>normal route (e.g. calling rtpproxy_offer(), uac_replace_from(), adding<br>additional headers and stuff like that) and you send it out using e.g.<br>
t_relay(), then in a serial scenario when you re-enter via a<br>failure-route, these changes will still be there (which is not always<br>what you want).<br><br>On the other hand, if you register a branch route via t_on_branch() and<br>
do your changes there instead of prior to calling t_relay(), then these<br>changes from branch route will be rolled back, and you can do your<br>changes easily again in the same or another branch route starting with<br>your original message. This is important for example in serial call<br>
forward scenarios, where the first destination might require an<br>rtpproxy, but the second doesn&#39;t, or when the first destination requires<br>different custom headers compare to the second.<br><br>Basically the same applies to parallel scenarios. If you modify your<br>
message before calling lookup() and you&#39;ve multiple contacts registered<br>for your destination, then your changes will apply for all branches<br>which are created by that. However if you move your modifications to a<br>
branch route, then you can work on your messages individually, depending<br>on the branch.<br><br>Hope this clarifies it a bit.<br><br>Andreas<br><br></div></blockquote></div><br></div>