Disallowing external call forwarding, but allowing internal call forwarding

freepbx
Tags: #<Tag:0x00007f7027c45f88>

(John M) #1

I have a client that would like users to be able to forward calls from one extension to another, but they do not want to allow users to forward calls to an external number. The goal is to restrict people from forwarding sensitive calls to their personal cell phones or to someone outside the organization. Is this something that is possible to do?


#2

I went down that path some time ago, I found it a little convoluted to do in the code as there are several callforwards that can be set, I came up with this one liner that works if internal extensions are less that 5 digits long and external numbers 5 or more long

for i in CF CFB CFU ;do rasterisk -x "database show $i";done|grep ^/|sed   's/\(.*\)\s*: \([0-9]*\)/\1 \2/'|egrep "[0-9]{5}"|awk '{print "rasterisk -x \"database del"$1"\""}'|tr '/' ' '|bash

you could add that as a cron job when comfortable with it, remove the final |bash to preview what would happen. I would also watch out for follow-me’s set also (/AMPUSER/<EXT>/followme/grplist)


#3

CF or follow-me normally preserves the caller ID of the original caller. If your extension numbers are 4 digits, putting XXXX in the CallerID field of the Outbound Route that would normally handle the call will disallow incoming calls from being forwarded out. However, the forward would still be honored for calls originating from an extension.

@dicko 's suggestion avoids that issue, but fails to block forwarding done by the device. If you don’t need that functionality, you could block it in the phone settings.


#4

IMHO all ‘vertical codes/local feature codes’ in all Extension needs to be disabled, if not you are not in control, and will get endless calls from clients that did ‘locally’ that which should not be done. Specifically In our case DND (number 1, “I didn’t get a call”) and call forwarding (number 2 " my friend called but my phone didn’t ring and there was no voice mail" ) and three way calling (number 3, unexpected -$$ )

FPBX/Asterisk adequately covers all ‘features’ your client needs


(Char1) #5

In [macro-dialout-trunk-predial-hook] try to check if EXTTOCALL or NODEST or BLINDTRANSFER are set. If there is any hangup call. I think it should work.


(John M) #6

Thank you, everyone, for the suggestions. I like the cron job idea, since I can tweak that to exclude people who would be allowed to transfer out. Unfortunately, clients being clients, they changed their mind, so I don’t have an opportunity to test it out.