[asterisk-users] How to limit extension to allow only internal calls
Steve Edwards
asterisk.org at sedwards.com
Mon Jun 2 10:06:31 CDT 2008
> On Mon, Jun 2, 2008 at 2:00 AM, DEVEL STAROSTA <devel at starosta.org> wrote:
>
>> I'm playing with asterisk and I try to make system for my sister hotel
>> with aprox. 40 extensions (30 rooms, 1 reception, 2 office, 4 services
>> phones on each floor). I.ve installed latest version of trixbox (for
>> GUI) but I made manual modifications.
>>
>> My problem:
>> I have 4 services phones (each per floor) which must be able to make
>> only internal calls (not external - no PSTN nor VOiP provider), I've
>> just look about solution in Google, mailing list, I can't find solution,
>> please can someone give me an idea ?
>> NB: sorry for my english ... ;)
On Mon, 2 Jun 2008, Rizwan Hisham wrote:
> There is another easier and interesting thing you can do in extensions.conf
> to restrict specific dialinmg codes for specific users.
>
> suppose your internal extensions are 4 digits long. your service phones have
> did 1111, 1112, 1113.here is the dialplan for all of your phones including
> service phones:
>
> [hotel]
> ;for all other phones
> exten=> _1XXXXXXXXXX,1,Dial(${external})
> exten=> _011.,1,Dial(${internaltional})
> exten=> _XXXX,1,Dial(${internal})
>
> ;for service phones
> exten=> _1XXXXXXXXXX/1111,1,hangup
> exten=> _1XXXXXXXXXX/1112,1,hangup
> exten=> _1XXXXXXXXXX/1113,1,hangup
> exten=> _1XXXXXXXXXX/1114,1,hangup
>
> exten=> _011./1111,1,hangup
> exten=> _011./1112,1,hangup
> exten=> _011./1113,1,hangup
> exten=> _011./1114,1,hangup
>
> if you dont want to define separate context for every person you can match
> his did just like above. This way whenever service phones try to dial a
> local or international number they will hangup instead and all other phones
> will be able to dialout. try it
You don't need a separate context for each person (phone), just 1 for each
"class" of phone.
[guests]
exten = _1XXXXXXXXXX,1, dial(${external})
exten = _011.,1, dial(${international})
exten = _XXXX,1, dial(${internal})
[service]
exten = _XXXX,1, dial(${internal})
It seems more robust, simple, and obvious to me to start with nothing (an
empty context) and specifically allow rather than allow everything and
then specifically deny.
In your example, adding a phone means remembering to modify the dialplan
in 2 places versus no change to the dial plan.
Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
More information about the asterisk-users
mailing list