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("top hiding");</div><div><br></div><div>In local route:</div><div>remove_hf("User-Agent");</div>
<div>append_hf("User-Agent: $var(ua)\r\n");</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"><<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt" target="_blank">jorge-h-pinho@ext.ptinovacao.pt</a>></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("b2b_logic", "custom_headers", "User-Agent")<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 <<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt">jorge-h-pinho@ext.ptinovacao.pt</a><mailto:<a href="mailto:jorge-h-pinho@ext.ptinovacao.pt">jorge-h-pinho@ext.ptinovacao.pt</a>>> 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("Orig-User-Agent: $hdr(User-Agent)\r\n");<br>
b2b_init_request("top hiding");<br>
}<br>
<br>
local_route {<br>
if(is_present_hf("Orig-User-Agent"))<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><mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><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>