Hi Jorge,<div><br></div><div><br></div><div>You can achieve what you want if you save the original User-Agent header in a variable before calling b2b_init_request and then in local route remove the User-Agent header added by B2BUA and add the original one.</div>

<div><br></div><div>So you will have:</div><div><br></div><div>In request route:</div><div>$var(ua) = $ua;</div><div>b2b_init_request(&quot;top hiding&quot;);</div><div><br></div><div>In local route:</div><div>remove_hf(&quot;User-Agent&quot;);</div>

<div>append_hf(&quot;User-Agent: $var(ua)\r\n&quot;);</div><div><br></div><div>Regards,</div><div>Anca Vamanu</div><div><br><br><div class="gmail_quote">On Fri, Sep 14, 2012 at 12:08 PM, Jorge Henrique Pinho <span dir="ltr">&lt;<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt" target="_blank">jorge-h-pinho@ext.ptinovacao.pt</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Duane,<br>
<br>
This does not work, because b2b will generate a new message with a modified User-Agent header.<br>
Defining User-Agent as a custom header :<br>
modparam(&quot;b2b_logic&quot;, &quot;custom_headers&quot;, &quot;User-Agent&quot;)<br>
<br>
will result in two User-Agent headers in the message created by b2b, because it will create a new User-Agent header and keep the old one.<br>
<br>
king regards,<br>
<div class="im"><br>
Jorge Pinho<br>
Analyst/Developer<br>
Network Platforms and Multimedia Solutions<br>
Multimedia Division<br>
________________________________________<br>
</div>From: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> [<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>] On Behalf Of Duane Larson [<a href="mailto:duane.larson@gmail.com">duane.larson@gmail.com</a>]<br>


Sent: 13 September 2012 21:43<br>
To: OpenSIPS users mailling list<br>
Cc: José Carlos Amorim<br>
Subject: Re: [OpenSIPS-Users] b2b preserve header.<br>
<div class="im"><br>
Read this<br>
<a href="http://www.opensips.org/html/docs/modules/1.8.x/b2b_logic.html#id250020" target="_blank">http://www.opensips.org/html/docs/modules/1.8.x/b2b_logic.html#id250020</a><br>
<br>
Does that help or is that not what you are looking for?<br>
<br>
</div><div class="im">On Wed, Sep 12, 2012 at 5:26 AM, Jorge Henrique Pinho &lt;<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt">jorge-h-pinho@ext.ptinovacao.pt</a>&lt;mailto:<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt">jorge-h-pinho@ext.ptinovacao.pt</a>&gt;&gt; wrote:<br>


Hi all<br>
In b2b, is there a way to preserve headers added in opensips routine when the second leg is generated? Here is an example<br>
<br>
route<br>
{<br>
               append_hf(&quot;Orig-User-Agent: $hdr(User-Agent)\r\n&quot;);<br>
               b2b_init_request(&quot;top hiding&quot;);<br>
}<br>
<br>
local_route {<br>
                if(is_present_hf(&quot;Orig-User-Agent&quot;))<br>
                {<br>
                        do stuff....<br>
                }<br>
<br>
}<br>
<br>
My goal is to preserve headers that b2b modules changes. Like User Agent header and To header.<br>
<br>
Kind regards,<br>
<br>
Jorge Pinho<br>
Analyst/Developer<br>
Network Platforms and Multimedia Solutions<br>
Multimedia Division<br>
_______________________________________________<br>
Users mailing list<br>
</div><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div class="HOEnZb"><div class="h5"><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
--<br>
--<br>
*--*--*--*--*--*<br>
Duane<br>
*--*--*--*--*--*<br>
--<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto: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></div></blockquote></div><br></div>