[Asterisk-Users] Size limitations of extensions.conf

Paul Hewlett paul at cottonpickinminds.co.za
Sun Jun 4 06:10:34 MST 2006


On Saturday 03 June 2006 23:42, voiplist wrote:
> So what are the smart folks doing when it comes to retricting/allowing
> which area/country codes can and can't be called?

I use different contexts. i.e. the phones context defined in sip.conf only 
includes contexts that define patterns for (say) cellphones and/or landlines 
The last context is a catchall that simply playbacks a "invalid extension' 
message
viz 

sip .conf

[206]
context=int_calls_basic

[205]
context=int_calls_cellphone

extensions.conf

[int_calls_cellphone]
include => int_calls_cellphone_
include => int_calls_basic_
include => invalid

[int_calls_basic]
include => internal_extensions
include => invalid

[internal_extensions]
;
; 2XX are internal extensions
;
extens => _2XX,1,Dial(${EXTEN})
extens => _2XX,n,Hangup()

[int_calls_cellphone_]
;
; Cellphones are 082 
;
extens => _082.,1,Dial(Zap/G1/${EXTEN})
extens => _082.,n,Hangup()

[invalid]
extens => _X.,1,Playback(invalid_extension)
extens => _X.,n,Hangup()

This 'schema' works very well for me - I find it quite intuitive to add other 
capabilities (international dialing for example) and then just 'include =>' 
them in the right places.

I use a script to generate these files automatically.

NB The invalid context above really should use the 'i' extension

Paul Hewlett
 



More information about the asterisk-users mailing list