glenn,
what an interesting way to use GotoIf() and 9XXXX.  didn't know you could do that in GotoIf()!
you could have used (broken out) the individual services
[trunklocal]
[trunkld]
[trunktollfree]
and just included the above individual context in with the groups that you allowed a particular class of service to ...
daveC

Glenn Cobb wrote:
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

No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1209 - Release Date: 01/04/2008 12:05 PM

-- 
My wife's sister is in California.  
I should buy her a Videophone2008!

Truly, The Next Best Thing to Being There!
--

WorldWideVideoPhones.com
856.380.0894


_______________________________________________
-- 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