Remove SIP Header


we’re having an issue when forwarding calls. Our DECT-phones (Mitel OMM) send a SIP header when forwarding calls (“Diversion”, e.g.: Diversion: sip:[EXT]@IP;reason=unconditional )
Our SIP provider however refuses to accept SIP calls containing this header. I’ve found no way to disable this header in the OMM config, so my hope is, FreePBX got an option for this (at least there is an option “Generate Diversion Headers” in “advanced settings”). The trunk for the outgoing route is a SIP-Trunk to our provider.

Has anyone got an idea on how to solve this problem?

Maybe it’s also possible to do this with the dialplan ([macro-dialout-trunk-predial-hook]?)
I tried to read the header with:exten => s,n,ExecIf($[${EXISTS(${SIP_HEADER(Diversion)})}]?NoOp(SIP_HEADER(Diversion): ${SIP_HEADER(Diversion)} )
but this didn’t work, obviously the SIP_HEADER function doesn’t work (tried it with another Header I set before). Always results in 0 and doesn’t contain information.
There is an asterisk extension available called “SipRemoveHeader”. But I don’t know if I can install custom extensions for asterisk in FreePBX. Maybe this would help, if it’s compatible with FreePBX?

Thanks and best regards