You will need to read the header and then add it on the outgoing side. This won’t work for key headers, like call-id, and it is unwise to do it for any header that Asterisk itself uses.
Asterisk is a back to back user agent, so the two legs aren’t necessarily the same technology and passing through raw protocol values is not something normal.
You have right. This is not working with the key headers, but if you want to transfer a proprietary headers (e.g. X-MyHeader) from the incoming leg to the outgoing leg you need this possibility!
In my case, both channels use the same technology.
Is it possible to transfer it via AMI interface etc.