[Asterisk-Users] limit the length of extensions

Chris Shaw chriss at watertech.com
Tue Aug 31 10:12:36 MST 2004


Why are you including your outbound context into your incoming context in
the first place? That doesn't make any sense?

I'm guessing that because you're using a number in your exten => you're
using an IP channel like SIP or H323? Is this correct? If you're using a
T1/PRI or POTS lines you need to use 's'.

Using your example, your dialplan should look something like this...

[incoming]

exten => 9543340726,1,GotoIf($[${CALLERIDNAME} = anonymous]?2:4)
exten => 9543340726,2,setcidname(Blocked)
exten => 9543340726,3,setcidnum(0000000000)
exten => 9543340726,4,Goto(companyname,beginmenu,1)

[companyname]

exten => beginmenu,1,SetVar(CALLEDNAME=CompanyName)
exten => beginmenu,2,Wait,1
exten => beginmenu,3,Answer() ; Answer the channel!
exten => beginmenu,4,Background(company-main)
exten => beginmenu,5,Background(ifyouknow)
exten => beginmenu,6,Goto(company_mainmenu,s,1)
exten => 502,1,Dial(SIP/whoever1&SIP/whoever2&sip/whoever3,30,m)
exten => 507,1,Dial(SIP/dave&SIP/jim&SIP/lisa,30,m)
...

[company_mainmenu]

exten => s,1,Background(company-nav1)
exten => 1,1,Goto(company_sales,s,1) ; Sales
exten => 2,1,Goto(companyname,502,1) ; Accounting
exten => 3,1,Goto(companyname,508,1) ; Customer Care
exten => 4,1,Goto(companyname,507,1) ; Technical Support
exten => 5,1,Goto(companyname,202,1) ; Human Resources
exten => 6,1,Goto(companyname,202,1) ; Provisioning
exten => 7,1,Goto(companyname,214,1) ; Marketing
exten => 0,1,Goto(companyname,210,1) ; Operator
...

Instead of jumping back and forth like this, I'd use macros to try and
condense the dialplan a bit...
I can help you more with this if you'd like...

Then for people inside the company there's this...

[outbound-local]
exten => _9NXXNXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)
exten => _9NXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,t) ; for
7-digit dialing
exten => _91800NXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)
exten => _91888NXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)
exten => _91877NXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)
exten => _91866NXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)

[outbound-ld]
exten => _91NXXNXXXXXX,1,Dial(SIP/${EXTEN:1}@sipprovider-out-context,60,T)

[outbound-international]
exten => _9011.,Dial(SIP${EXTEN:1}@sipprovider-out-context,60,T)

[office]
include = outbound-local
include = outbound-ld
include = outbound-international

exten => _[1-5]XX,1,Dial(SIP/${EXTEN},25,tT) ; This is assuming they're all
SIP, you can use $DIALSTATUS to continue checking ZAP,MGCP,ETC...

and so on...

-Chris




More information about the asterisk-users mailing list