How to add prefix to incoming calls


(Dirk2358) #21

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

#22

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.


(Lorne Gaetz) #23

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


(Dirk2358) #24

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.


(Lorne Gaetz) #25

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


(Dirk2358) #26

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