One pitfall would be to think that this function would add this header
field to any reply that kamailio would send. This append_hf() function
should add a header field to a SIP request that it *relays*, but would
not add it to a response that kamailio *generates* (for that, you
would use the append_to_reply() function).

James

On Mon, 11 Mar 2024 at 11:26, Alex Balashov via sr-users
<sr-users@lists.kamailio.org> wrote:
>
> Indeed, it has become a bit of a cliché that msg_apply_changes() should be 
> called after append_hf(), uac_replace_from(), etc.
>
> This should be dispelled. In the vast majority of use-cases, it is not only 
> unnecessary, but highly undesirable.
>
> -- Alex
>
> > On 11 Mar 2024, at 06:45, Henning Westerholt via sr-users 
> > <sr-users@lists.kamailio.org> wrote:
> >
> > Hello,
> >  the usage of msg_apply_changes is not necessary (not even recommended) for 
> > append_hf (and other functions) to work. The OP was talking about a packet 
> > capture, so I assume that he got the capture after the proxy send out the 
> > message.
> >  Cheers,
> >  Henning
> >   -- Henning Westerholt – https://skalatan.de/blog/
> > Kamailio services – https://gilawa.com
> >   From: Unai Rodriguez via sr-users <sr-users@lists.kamailio.org>
> > Sent: Montag, 11. März 2024 09:33
> > To: Calvin E. via sr-users <sr-users@lists.kamailio.org>; Kamailio (SER) - 
> > Users Mailing List <sr-users@lists.kamailio.org>
> > Cc: Unai Rodriguez <u...@rodr.org>
> > Subject: [SR-Users] Re: append_hf not working
> >  Using 
> > https://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.msg_apply_changes
> >  might be relevant in your case...
> >  With best wishes, Unai Rodriguez
> > On 11 Mar 2024 at 09:22 +0100, Benoit Panizzon via sr-users 
> > <sr-users@lists.kamailio.org>, wrote:
> >
> > Hi Calvin
> >
> >
> > I'm trying to add something simple like the following:
> >
> > append_hf("X-testheader: True\r\n", "From");
> >
> > However, I don't see my X-testheader in a packet capture. Are there
> > any common pitfalls that would prevent append_hf from working as
> > expected?
> >
> > Weird, I use this a lot and it always works. But I never attempted to
> > specify the header after which it should be appended. Does it work if
> > you don't specifiy "From"?
> >
> > Mit freundlichen Grüssen
> >
> > -Benoît Panizzon-
> > --
> > I m p r o W a r e A G - Leiter Commerce Kunden
> > ______________________________________________________
> >
> > Zurlindenstrasse 29 Tel +41 61 826 93 00
> > CH-4133 Pratteln Fax +41 61 826 93 01
> > Schweiz Web http://www.imp.ch
> > ______________________________________________________
> > __________________________________________________________
> > Kamailio - Users Mailing List - Non Commercial Discussions
> > To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> > Important: keep the mailing list in the recipients, do not reply only to 
> > the sender!
> > Edit mailing list options or unsubscribe:
> > __________________________________________________________
> > Kamailio - Users Mailing List - Non Commercial Discussions
> > To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> > Important: keep the mailing list in the recipients, do not reply only to 
> > the sender!
> > Edit mailing list options or unsubscribe:
>
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: https://evaristesys.com
> Tel: +1-706-510-6800
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:

Reply via email to