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

DEVEL STAROSTA devel at starosta.org
Tue Jun 3 15:59:55 CDT 2008


Steve Edwards ha scritto:
> On Tue, 3 Jun 2008, DEVEL STAROSTA wrote:
>
>   
>> I want to notice that trixbox with all modules installed have a lot of
>> configuration files and is very hard to place solution.
>>     
>
> What's Trixbox? :)
>
>   
>> 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
>>     
>
> Are 2100, 2200, 2300, 2400 all supposed to dial the same destination?
>
> You probably want something like this:
>
> [general]
>  	SERVICE-PHONE-1			= sip/front-desk
>  	SERVICE-PHONE-2			= sip/service-phone-2
>  	SERVICE-PHONE-3			= zap/1
>  	SERVICE-PHONE-4			= zap/2
>
> [service]
>  	exten = 2100,1,			dial(${SERVICE-PHONE-1})
>  	exten = 2200,1,			dial(${SERVICE-PHONE-2})
>  	exten = 2300,1,			dial(${SERVICE-PHONE-3})
>  	exten = 2400,1,			dial(${SERVICE-PHONE-4})
>  	exten = _2xxx,1,		dial(sip/${EXTEN},20,rT)
>  	exten = _2xxx,n,		hangup()
>
> Note that I removed the space between "," and "2." Asterisk's parser
> is not very smart in how it handles spaces (IMNSHO). Using them will
> come back to bite you later when you start using expressions and if
> statements.
>
> Also note that something as obtuse as:
>
>  	exten = _2[1-4]00,1,		dial(${SERVICE-PHONE-${EXTEN:1:1}})
>
> does not quite work because _2xxx is evaluated before _2[1-4]00 -- go 
> figure :)
>
> 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
>
>   
Trixbox is CentOS based project focused to use asterisk.
So, i need that extensions 2100,2200,2300 and 2400 can call any internal 
extensions (ex: 2101,2000 and so on) but not be able to call outside 
(ex: 00390541 ... or 33889088...) because some hotel client could be 
make calls without any control. This extensions is usefull for example 
for staff to communicate with reception, office, rooms withou must use 
stairs ... ;)

Alberto.



More information about the asterisk-users mailing list