Courtesy wall phone - restricted usage

We would like to install a wall-mounted phone on the outside wall of our office that is usage restricted. It is for visitors to use when they want to reach somebody inside of our office which has a locked door.

The main requirement is to lock down the phone so that the user (visitor) can only call internal extensions. All external calls must be absolutely blocked. This extension should have no access to outside trunks. I can’t figure out how to do this without using pin dialing. Is there a better way?

A nice-to-have (but far less important) feature would be setting up the extension so that it automatically dials a certain pre-defined extension as soon as the phone is picked up. This would happen without any input from the person using the phone (other than the action of just picking up the handset).

Are these features supported? And if so, what is the best way to implement them?



You want a “hot line” phone, in other words. The easiest way is to use a standard phone connected to a Linksys PAP2 (or Sipura SPA-2000) or similar device - if you buy one, make sure it is unlocked, and look in the how-to section ( for configuration documentation. After you get it working normally, make sure you are logged in to the device using the admin login and click on advanced, then go to the appropriate Line tab and change the Dial pattern to be simply (S0<:ext>) (replace ext with the extension number you want to call). Then whenever anyone picks up the phone, that extension will be called. That is probably the least expensive way to accomplish that (unlocked PAP2’s can be found on eBay for around $50 or even less - just be sure it’s unlocked - and everybody and their brother seems to have an old analog phone lying around).

If you decide that you want the phone to be able to dial any internal extensions, you could put something like this in /etc/asterisk/extensions_custom.conf:

exten => _1XXX,1,Goto(from-internal,${EXTEN},1)
exten => _[*0-9]!,1,Goto(app-blackhole,congestion,1)
exten => h,1,Hangup()

The above assumes your extensions are all in the range 1000-1999, if not change 1XXX to a pattern that matches your local extensions. Then just change the context on the extension’s setup page from from-internal to custom-internal-only.