[OpenSIPS-Users] Remove previously added header

David Villasmil david.villasmil.work at gmail.com
Mon Jun 14 23:42:26 EST 2021


Ok i stumbled on to your email from back 2009 asking just about the same
thing (
https://users.opensips.narkive.com/W78SWsO9/opensips-users-remove-hf-doesn-t-always-work
)

I ended up doing
t_on_branch("1")

# Add the header before sending it out the parameter server
branch_route[1] {
    append_hf("X-MyHeader: 1\r\n");
}

then when actually sending it out to the termination provider:

t_on_branch("2");

# Remove the header before seding it out to the termination
branch_route[2] {
    remove_hf("X-MyHeader");
}

That's working perfectly!

Is this right or is there a more efficient/easier way to do it?

Thanks!

Regards,

David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337


On Tue, Jun 15, 2021 at 12:10 AM David Villasmil <
david.villasmil.work at gmail.com> wrote:

> Thanks Jeff,
>
> That's not going to work for me, I don't want to add new branches.
> What I'm doing is forwarding the call to a sip server that replies with a
> 302 and some extra headers.
> I then need to get these headers and continue routing normally, one single
> branch.
>
> Regards,
>
> David Villasmil
> email: david.villasmil.work at gmail.com
> phone: +34669448337
>
>
> On Mon, Jun 14, 2021 at 11:12 PM Jeff Pyle <jeff at ugnd.org> wrote:
>
>> Add it in a branch_route.  That way if you have to route advance, it'll
>> already be gone because you'll be on a new branch.
>>
>>
>> - Jeff
>>
>>
>> On Mon, Jun 14, 2021 at 5:52 PM David Villasmil <
>> david.villasmil.work at gmail.com> wrote:
>>
>>> Hello guys,
>>>
>>> So, I'm appending a header (append_hf("header")) to a forward.
>>> That forward fails and I'm trying to remove it with remove_hf("header"),
>>> but it's not getting removed for some reason, what am I doing wrong?
>>>
>>> Thanks everyone!
>>>
>>> David Villasmil
>>> email: david.villasmil.work at gmail.com
>>> phone: +34669448337
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>> _______________________________________________
>> 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/20210615/5923dc66/attachment-0001.html>


More information about the Users mailing list