<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffcc" text="#330000">
glenn,<br>
what an interesting way to use GotoIf() and 9XXXX. didn't know you
could do that in GotoIf()!<br>
you could have used (broken out) the individual services <br>
[trunklocal]<br>
[trunkld]<br>
[trunktollfree]<br>
and just included the above individual context in with the groups that
you allowed a particular class of service to ...<br>
daveC<br>
<br>
Glenn Cobb wrote:
<blockquote cite="mid:014f01c85168$85c09aa0$1e01a8c0@GECXP" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2900.3243" name="GENERATOR">
<div><span class="781092519-07012008">Greetings all,</span></div>
<div><span class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008">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.</span></div>
<div><span class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008"></span><span
class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008">exten =>
s,n,GotoIf($[${DIAL_NUMBER} = 011XXXX. ] ? yescode : steptwo)</span></div>
<div><span class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008">exten =>
s,n,(steptwo),GotoIf($[${DIAL_NUMBER} = 9XXXXXX. ] ? yescode :
stepthree)</span></div>
<div><span class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008">exten =>
s,n,(stepthree),GotoIf($[${DIAL_NUMBER} = 1NXXNX. ] ? yescode : nocode)</span></div>
<div><font size="1">
<p><font size="3">exten => s,n,<span class="781092519-07012008">(yescode),</span>Playback(please-enter-the&accounting)</font></p>
<p><font size="3">exten => s,n,Read(account|number|8)</font></p>
<p><font size="3">exten => s,n,SetAccount(${account})</font></p>
<p><span class="781092519-07012008"><font size="3">exten =>
s,n,(nocode),Blah, Blah....</font></span></p>
</font></div>
<div> </div>
<div><span class="781092519-07012008">Thanks,</span></div>
<div><span class="781092519-07012008"></span> </div>
<div><span class="781092519-07012008">Glenn</span></div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
--Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a>--
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
<a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></pre>
<pre wrap="">
<hr size="4" width="90%">
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
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="132">--
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
</pre>
</body>
</html>