Avoid transferring outside calls to page group

Every so often someone will accidentally transfer an outside call to the paging group. Then everyone in the company gets to hear some poor lost soul saying “hello”?

In our old server I had custom code to avoid this, it looks something like this:

exten => 760,n,GotoIf($["${CHANNEL:4:3}" = “ver”]?from-internal-xfer,200,1)
exten => 760,n,GotoIf($["${CHANNEL:4:3}" = “Ver”]?from-internal-xfer,200,1)
exten => 760,n,GotoIf($["${CHANNEL:4:3}" = “Eme”]?from-internal-xfer,200,1)
exten => 760,n,GotoIf($["${CHANNEL:0:3}" = “DAH”]?from-internal-xfer,200,1)

This would check all the potential outside channels and redirect them to the parking lot instead.

I can do this again, but by doing so I lose the ability to use FreePBX’s interface for controlling who is in a page group. This is because I’m replacing the entire [app-pagegroups] function with my own in the override file. Perhaps there’s a method where I can override only part of the [app-pagegroups] code? If my code could run first, and then it run the rest, this would be an easy work around.

Basically, I’m looking for suggestions of not losing the FreePBX interface for managing extensions in a page group, but still be able to redirect an outside call to the parking lot instead of the page group. Alternatively, to just stop a transfer from outside to page altogether would work.

We transfer by using the transfer button on our Snom 320 or GXP-2000 phone, then hitting the parking lot button (which is programmed to the parking lot extension), in case this matters.

Any suggestions?