[asterisk-users] How to limit extension to allow only internal calls

DEVEL STAROSTA devel at starosta.org
Mon Jun 2 18:35:40 CDT 2008


Steve Edwards ha scritto:
>> 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
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>   
Thank all for answer.
Yours suggestion is very clear.
I want to notice that trixbox with all modules installed have a lot of 
configuration files and is very hard to place solution.
So, I've added this in extensions_custom.conf (file included by 
extensions.conf)

[service]
exten => _2XXX,1,Dial(SIP/${EXTEN}, 20,rT) ; this match only  wth 4 
digits ad with the first digit begins with "2" (nb: all internals in 
hotel begin with 2: 2000-reception, 2001 - office and so on)
exten => _2XXX,n,Hangup()

after this:

exten => 2100,1,dial(${service})   ; 1-st floor telephone service
exten => 2200,1,dial(${service})   ; 2-nd floor telephone service
exten => 2300,1,dial(${service})   ; 3 floor telephone service
exten => 2400,1,dial(${service})   ; 4 floor telephone service

This will be ok ?



More information about the asterisk-users mailing list