Thank to pointing that out. 
I'm not sure about all the implications but yes, I think it is better to go with kamailio v. 5 save() flag approach.
However, the guys at my company might want this change soon so I might need to go with kamailio v. 4.
Of course, I always run load test before releasing.

On Tue, Feb 11, 2020 at 8:43 PM Yuriy Gorlichenko <ovoshlook@gmail.com> wrote
But you will see those changes in the pcap even without apply_message_changes
It is highly recommended to not use this function as it parses all message again. 

On Tue, 11 Feb 2020, 12:29 mayamatakeshi, <mayamatakeshi@gmail.com> wrote:


On Tue, Feb 11, 2020 at 7:48 PM Daniel Tryba <d.tryba@pocos.nl> wrote:
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
> Actually, my idea was to do something like this before handing the REGISTER
> to registrar save() function:
>                         remove_hf("Expires");
>                         append_hf("Expires: 200\r\n");
> However, this didn't work (or at least, it doesn't work with kamailio 4.3.7
> which is the one I use).

These changes aren't applied to the processing of the current message
until you call msg_apply_changes().

Try adding and see if it works.

Indeed. This worked:
        remove_hf("Expires");
        append_hf("Expires: 200\r\n");
        msg_apply_changes();
Thanks! 
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users