[asterisk-users] GotoIf() help

Glenn Cobb gec at davisfloyd.com
Mon Jan 7 14:04:34 CST 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080107/afc7d46d/attachment.htm 


More information about the asterisk-users mailing list