>
>
>> Daniel,
>>
>> But the documentation
>>
>>
http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2506229
>>
>> says that append_hf() can be used inside a reply route?
>>
>>
> yes, it can be used. The nuance in the initial question, as I
> understood, was to add a header to a reply for current processed
> request. with append_hf you add a header to the current processed sip
> message (no matter is request or reply).
>
> append_to_reply() adds a header to any eventual reply kamailio may send
> for the request being processed, not visible in the request if that is
> forwarded.
>
> Just to give an example, save("location") sends a reply from inside the
> function. If you want to have a custom header in that reply, that can be
> done with append_to_reply().
>
>
Oh, I see. I did not realise append_hf() always applied to the request context only.
Thanks a lot! Learn something new every day.
I think the confusion is about which message you process in the on_reply
branches - you actually process the initial request that you triggered with a reply route
in the initial processing, not the reply. Thus if you use append_hf - you add a header to
the request, not the response.