Greetings all,
 
I'm not real good with dial plan programming and need some help. I've looked
at the 2nd edition of the Asterisk book about GotoIf() and have a basic idea
what I need to do but not sure about the correct way or the best way, to set
it up. I need to branch based on whether the dialed number is long distance
(international or not) or not. I have branch offices on SIP and IAX trunks
that have 4 digit extensions and one office has a 1000 range for their
extensions so I have to make sure I don't pick that up as dialing long
distance. I think what I have below will work but it can probably be cleaned
up.... alot. Any help is greatly appreciated.
 
 
exten => s,n,GotoIf($[${DIAL_NUMBER} = 011XXXX. ] ? yescode : steptwo)
 
exten => s,n,(steptwo),GotoIf($[${DIAL_NUMBER} = 9XXXXXX. ] ? yescode :
stepthree)
 
exten => s,n,(stepthree),GotoIf($[${DIAL_NUMBER} = 1NXXNX. ] ? yescode :
nocode)
exten => s,n,(yescode),Playback(please-enter-the&accounting)

exten => s,n,Read(account|number|8)

exten => s,n,SetAccount(${account})

exten => s,n,(nocode),Blah, Blah....

 
Thanks,
 
Glenn
_______________________________________________
--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

Reply via email to