We have a PRI link with old PABX and route calls from it to ITSP. Some extensions’ CID is hidden, but we have to set CID before sending to ITSP. Because ITSP rejects all Anonymous calls.
We used the Set CallerID, but it doesn’t override cid name press and cid num press, also the set caller id custom context is not usable, because before include there is a Goto() !
We made a custom destination and override name-press and num-press with "“allowed_passed_screen”, but after return to ext-trunk, they will override with prohib_passed_screen.
Do you have any idea how we can change these values before call routing to ITSP?
Try to use the macro macro-dialout-trunk-predial-hook.
Here is an example how to use it:
[macro-dialout-trunk-predial-hook]
;Remove spaces or dashes from outboundnumber when calling
exten => s,1,Set(OUTNUM=${FILTER(0123456789*#+,${OUTNUM})})
;Remove Alert Info headers
exten => s,n,SIPRemoveHeader(Alert-Info:)
;Remove Call Info headers
exten => s,n,SIPRemoveHeader(Call-Info:)
exten => s,n,NoOp(The caller id name is: ${CALLERID(name)})
exten => s,n,NoOp(The caller id number is: ${CALLERID(num)})
exten => s,n,NoOp(The ampuser is: ${AMPUSER})
exten => s,n,NoOp(The real caller id is: ${REALCALLERIDNUM})
exten => s,n,NoOp(The outbound cli is: ${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n,MacroExit()
You need to declare this macro in the Asterisk dialplan.
Put this context in the extensions_custom.conf file and reload the dial plan (rasterisk -x'dialplan reload').
Thanks. But problem is that there isn’t any call for this macro in dialplan! in 2 different minor versions of FPBX 15.
It’s ok in v13 and 14, i checked.
I will share logs here.
I think I found the issue.
We are not using any outbound routes ! and this macro is called just in outbound routes.
We are routing calls from DAHDI (from-trunk) via inbound routes to PJSIP trunk. So, there isn’t any call point for this macro.
We used the u() and f() dial options in the pjsip trunk, but they didn’t work.
So, we are thinking about making an ext-trunk-custom and override the num-press variables.
I really appreciate if an expert provide correct solution:
we want to override CALLINGNAMEPRES:
First solution: ext-trunk-custom:
it’s not possible to override tdial!
Second solution: ext-did-0002-custom:
It’s not possible to override, although it uses Goto(ext-trunk,1,1).
Third Solution:
Changing the codes in functions.inc.php and override the CALLINGNAMEPRES values.
It works but you should be worry about system updates!
So what is the correct solution for changing some parts of dialplan??
For example you need set a variable for a call in the middle of a built-in context, but at the end of the context there is a Goto() and custom context is not helpful.
What you offer for these requirements?
If none of those techniques work, then you would have to copy the generated context from extensions_additional to extensions_override_freepbx and make the modifications you want, but you want to avoid that if possible.