Hi.
I’m using a fresh install of Fpbx 17 (PJSIP only).
This newly FPBX will be used to facing different SIP Trunk Providers.
Kind of a proxy node between many others PBXs and our different Providers.
In order to place some outbound calls to one of the providers using multiples FROM caller numbers id, that provider is requesting us to send a specific PAI field.
Now, I tried this good old configuration into extension_custom.conf like this:
[macro-dialout-trunk-predial-hook]
exten => s,1,Noop(Entering user defined context macro-dialout-trunk-predial-hook in extensions_custom.conf)
exten => s,n,ExecIF($["${OUT_${DIAL_TRUNK}_SUFFIX}"!=""]?Set(trunk_name=${OUT_${DIAL_TRUNK}_SUFFIX}):Set(trunk_name=${OUT_${DIAL_TRUNK}}))
exten => s,n,Noop(Trunk Name: ${trunk_name})
exten => s,n,ExecIf($["${trunk_name}"="PJSIP/TO-PROVIDER"]?func-set-sipheader,s,1(P-Asserted-Identity, <sip:[email protected]>))
exten => s,n,Return()
Seems to work only for good old Chan_SIP channels ?
FBPX 17 do nothing with that configuration.
Anyways, I saw that with PJSIP we should used PJSIP_HEADED instead…
So, again into extension custom:
[add-pai-header]
exten => s,1,NoOp(Adding P-Asserted-Identity)
exten => s,n,Set(PJSIP_HEADER(add,P-Asserted-Identity)=<sip:[email protected]>)
exten => s,n,Return()
As per my reading, we should be able to call that macro into the FPBX gui with the Asterisk Trunk Dial Options , with something like this: Ttb(add-pai-header^s^1).
When placing an outbound call, in the asterisk logs I can see the following
Executing [5558889999@trunk-dial-with-exten:1] Dial(“PJSIP/699-000000e6”, “PJSIP/5558889999@provider,300,Ttb(add-pai-header^s^1)b(func-apply-sipheaders^s^1,(1))U(sub-send-obroute-email^5558889999^^1^1732547749^^5558889999,^)”) in new stack
but no PAI field is added to the outbound SIP packets…
I guess that I missed a something somewhere, but I can’t figured out where.
Thanks.