Modify/Edit INVITE

Hello.

I have a question about Asterisk configuration.
Can I edit or modify the INVITE message content? For example, remove “To” or “Via” fields in the INVITE content.
If yes, how can I do?
Thanks.

You can add and remove non-critical headers, using the applications with the obvious names. You can control fields in critical ones that can sensibly be changed, by specific setings that influence those fields.

Note that Asterisk is a back to back user agent, so Via headers do not reflect the incoming leg.

Generally this sort of question should specify the over all goal, not the tacting you think you can use to achieve that goal.

All such questions should be on Asterisk Support, not Asterisk General.