Block calls from devices that have no users logged in?


How can I stop devices from making external calls. Only internal calls or 999 should be possible from a device that has no user logged in.


Excellent thanks.

I’m currently developing some XML prompts, PHP and commands to allow someone to walk up to a Yealink T28, input their user/pass. It then logs them into the phone, changes the logo and line buttons etc. and adds a button for Agent login.

I’m not sure if I can log in a user to the exten over the AMI yet, but I know I can with the AgentLogin. Also, I’m speaking to Yealink to see if you can query system vars and POST them to the server.

I may just have to use the *11/*12 first and then have a queue button, not sure yet.

Thanks for your support as always.


It’s not really related to this thread, but one could develop a script that would remotely log a user into a device.

unfortunately FreePBX is not well setup to do that ‘automatically’

If you are using devices numbers that do not overlap with user numbers, and are using 2.7 or greater, than you can use CID routing to stop them.

The idea would be as follows. Assume your device numbering range is 2XXX and does not overlap with any extensions. You would setup the following assuming 2.8, the concept is similar for 2.7 but you need to get the right syntax.

First Route - EMERGENCY

include your emergency patterns (999 in your case), no restrictions.

Second Route - Block Devices

match_pattern: X.
CallerID: 2XXX

for the trunk, you can either send it to a bogus trunk so the call fails, or create a custom trunk to a recording that tells them something useful like they can’t make a call until the login or something like that.

Third Route (and beyond):

what ever else you need to do for your outbound routing.

The idea here is that the first route will handle all your Emergency calls and has no restrictions, and is always good practice to have such an Emergency Only route. Any phone call make a call to that route.

Your second route will be limited to only devices, since a device that is not logged in will result in its device number as its CID, and this route will catch only devices with a CID of 2XXX but be ignored by all other calls.

This is the ‘cleanest’ way to do this. You are welcome to add a feature request that would allow the system to be more easily configured for this behavior - the challenge though, is that we would not want to block all calls since we want emergency calls to work, and we really don’t have any dependable way to know what constitutes and emergency call.

But is this now easy?

I did it minus the custom trunk because that looks complicated. But I get “all circuits are busy now” and I wish I could customize that to “Yo, log in first!”