[OpenSIPS-Users] b2b preserve header.

Anca Vamanu anca.vamanu at gmail.com
Mon Sep 17 22:49:42 CEST 2012


Hi Jorge,


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.

So you will have:

In request route:
$var(ua) = $ua;
b2b_init_request("top hiding");

In local route:
remove_hf("User-Agent");
append_hf("User-Agent: $var(ua)\r\n");

Regards,
Anca Vamanu


On Fri, Sep 14, 2012 at 12:08 PM, Jorge Henrique Pinho <
jorge-h-pinho at ext.ptinovacao.pt> wrote:

> Hi Duane,
>
> This does not work, because b2b will generate a new message with a
> modified User-Agent header.
> Defining User-Agent as a custom header :
> modparam("b2b_logic", "custom_headers", "User-Agent")
>
> 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.
>
> king regards,
>
> Jorge Pinho
> Analyst/Developer
> Network Platforms and Multimedia Solutions
> Multimedia Division
> ________________________________________
> From: users-bounces at lists.opensips.org [users-bounces at lists.opensips.org]
> On Behalf Of Duane Larson [duane.larson at gmail.com]
> Sent: 13 September 2012 21:43
> To: OpenSIPS users mailling list
> Cc: José Carlos Amorim
> Subject: Re: [OpenSIPS-Users] b2b preserve header.
>
> Read this
> http://www.opensips.org/html/docs/modules/1.8.x/b2b_logic.html#id250020
>
> Does that help or is that not what you are looking for?
>
> On Wed, Sep 12, 2012 at 5:26 AM, Jorge Henrique Pinho <
> jorge-h-pinho at ext.ptinovacao.pt<mailto:jorge-h-pinho at ext.ptinovacao.pt>>
> wrote:
> Hi all
> In b2b, is there a way to preserve headers added in opensips routine when
> the second leg is generated? Here is an example
>
> route
> {
>                append_hf("Orig-User-Agent: $hdr(User-Agent)\r\n");
>                b2b_init_request("top hiding");
> }
>
> local_route {
>                 if(is_present_hf("Orig-User-Agent"))
>                 {
>                         do stuff....
>                 }
>
> }
>
> My goal is to preserve headers that b2b modules changes. Like User Agent
> header and To header.
>
> Kind regards,
>
> Jorge Pinho
> Analyst/Developer
> Network Platforms and Multimedia Solutions
> Multimedia Division
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org<mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> --
> --
> *--*--*--*--*--*
> Duane
> *--*--*--*--*--*
> --
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120917/2b342143/attachment.htm>


More information about the Users mailing list