Make an extension only receive calls from another extension

I’m using the latest FreePBX and I have a situation here.

I have an outdoor siren at Extension 3523 on a system I am putting in and I have an emergency notification system at Extension 3520. I also have a few SIP speakers at 3521 and 3522.

What I need to do here is set up something so that extension 3520 is the ONLY one that can call 3521, 3522, and 3523, to prevent somebody from picking up a phone and dialing into a siren and then their voice is heard for miles.

I tried making a context and putting the numbers in it but I was still able to call the siren from outside the context.

Thanks everyone! Andrew

In extensions_override_freepbx.conf (IIRC) you should be able to add something like this:

exten => 3200,1,NoOp(Override default 3200 code)
exten => 3200,n,IF($DID=3201),GOTO 80

exten => 3200,n,IF($DID=3205),GOTO 80
exten => 3200,n,Say(Unreachable extension)
exten => 3200,n,Goto(h,1)
exten => 3200,80,Goto(something else)

You want it in override because you are subverting the default 3200 extension steps. The steps should start at “,1,” and continue through the steps where you play the file that says “Nope” and jumps to the call end context.

Step 80 is arbitrary, but it should do the code that is current set up for extension 3200 - you should be able to find that in extensions_additional.conf. Basically, you need to add the “check for valid extensions” before you send the call to the actual extension.

The code above, while looking reasonable, is just dashed off the top of my head. I’m pretty certain that it isn’t going to work as-is. Still, the concept should get you started.