[Asterisk-Users] limit the length of extensions

Adam Goryachev mailinglists at websitemanagers.com.au
Tue Aug 31 12:56:48 MST 2004


On Wed, 2004-09-01 at 04:39, Deon Rodden wrote:
> All of my phones use sip, their accounts are in the sip.conf file and 
> they have the context of 'company' or whatever. These phones need to be 
> able to call each others extension, as well as dial outside to the real 
> world. So in that context I put the outbound rules so that the phones 
> can call out to the pstn, and I put the extensions of all the other 
> phones in that context so that the phones can call each other.
> 
> Different companies wanted it different. ie some wanted just local, or 
> local and national, or local national and international. Some wanted to 
> dial 9 to get an outside line, others wanted to be able to dial without 
> the 9. So with the variance, I chose to put customized "outbound" 
> extensions per context.You should *really* read the examples on the wiki and asterisk docs, and 
other places, but, basically what you should do is this:
in sip.conf all your users belong to the context "inside-local" or "inside-ld" or whatever.

[inside]
exten => 800,1,Dial...
exten => 801,1,Dial...
etc, or use a macro, or whatever you like

[remote]
include => inside
exten => s,1,PlayBack(menu)
etc

[dialout-local]
exten => _9XXXXXXXXXX,1,Dial(Zap/g1/${EXTEN:1})
exten => _XXXXXXXXXX,1,Dial(Zap/g1/${EXTEN})

[dialout-ld]
exten => _91NXXXXXXXXXXX,1,Dial(Zap/g1/${EXTEN:1})
exten => _1NXXXXXXXXXXX,1,Dial(Zap/g1/${EXTEN})

[inside-local]
include => inside
include => dialout-local

[inside-ld]
include => inside
include => dialout-local
include => dialout-ld

etc...

You should probably have another context for your internal applications 
such as voicemail etc, another for global apps (maybe voicemail again, 
or meetme, etc) and don't forget to include parking where appropriate.

Asterisk is powerful, and easy to make secure, however, like a lot of 
other powerful devices, it is also easy to shoot yourself in the foot.

Regards,
Adam




More information about the asterisk-users mailing list