How to add prefix to incoming calls

May I ask why I shouldn’t use it? Looking at the documentation in extension.conf:

;-------------------------------------------------------------------------------
; from-pstn:
;
; Entry context for calls from the outside world to hit FreePBX
[from-pstn]
include => from-pstn-custom             ; create this context in extensions_custom.conf to include customizations

because it would be ‘re-entrant’, if you add the callerid in your custom context then send it back to from-trunk (effectively the same as from-pstn) , which would then catch your from-pstn-custom and round and round you go.

Due to the way includes are arranged, every line you put in from-pstn-custom overrides a line generated by FeeePBX.

Well, I’m using it exactly as documented to remove ‘+’ sign at CID and DID - and it works just fine:

[from-pstn-custom]
exten => _+.,1,GotoIf($["${CALLERID(num):0:1}" != "+"]?noplusatstart)
exten => _+.,n,Set(CALLERID(num)=${CALLERID(num):1})
exten => _+.,n(noplusatstart),Noop()
exten => _+.,n,Goto(${EXTEN:1},1) ; remove + from DID

If you shouldn’t use it, it should be removed in the documentation in the file.

Point taken: https://issues.freepbx.org/browse/FREEPBX-21952

Thanks! Strange kind of inclusion of customizations by overriding existing code. What was the original idea of doing it like that?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.