Dear fellow freePBX users,
I just want to change the incoming CID to “0” if CID name or num = “unknown”. This should be quite simple, but I’m stuck figuring out how and where to inject my three lines.
For now I’m aware of these two possibilities
- recommended: add custom context and set this in trunks settings
- use auto generated custom context which is automatically included (from-trunk-sip-voipGwName-custom)
Going with the first solution I created a custom context “from-trunk-unknown” in extensions_custom.conf:
[from-trunk-unknown]
exten => _.,1,ExecIf($[ “${CALLERID(name):0:7}” = “unknown”]?Set(CALLERID(name)=0))
exten => _.,n,ExecIf($[ “${CALLERID(num):0:7}” = “unknown”]?Set(CALLERID(num)=0))
exten => _.,n,Goto(from-trunk,${EXTEN},1)
I set this in my trunk incoming settings:
USER Context: inbound
USER Detail
secret=*****************
type=peer
canreinvite=yes
context=from-trunk-unknown
dtmfmode=rfc2833
When I Apply changes the context “from-trunk-unknown” is loaded (fwconsole and full log show that), but it is never used. Inbound calls start in context “from-trunk-sip-voipGwName” and then continue in “from-trunk”.
Any help on how to get this working is highly appreciated.
Also I wonder if the User Context “inbound”, which seems not to be required in our setup, is causing
trouble.
Cheers,
Marcus
FreePBX 13.0.190.7