SIP Header Manipulations per Trunk

I am current running asterisk 1.8 but if I need to upgrade to solve my current problem I will certainly look at that as a solution.

I need to perform a SIP header modification for each trunk, I can currently achive this for a single trunk where I hard code the Pilot AoR and use the macro predial-hook, an example of what I am doing is shown below.

[macro-dialout-trunk-predial-hook] exten => s,1,NoOp(Adding P-Asserted-Identity for Trunk Pilot User) exten => s,n,SipAddHeader(P-Asserted-Identity: <> ) exten => s,n(done),MacroExit()

An idea would be if during the call routing logic I could pass the currently hardcoded AoR sections as one or two different variables.
I am open to ideas here for passing on vallues based on the trunk selected for routing.
please note that the From header may not be the Pilot AoR so not simply a case of copying the FROM.
Ideally the solution would be something that is automated or was possible to do using freePBX provisioning frontend.



Asterisk doesn’t have such a hook. I would guess this relates to a GUI frontend. You should ask on the forum for that frontend, e.g. for FreePBX.