<br><br>
<div><span class="gmail_quote">On 7/18/06, <b class="gmail_sendername">Jerry Bonner</b> &lt;<a href="mailto:Jerry.Bonner@cptelecom.net">Jerry.Bonner@cptelecom.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi all,</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Does anyone have any tips on how I would accomplish a plan where if a user dials 4 digits, then prefix 6 digits, then if there is a local extension configured for that number dial it, otherwise send it out another sip gateway ( my pstn gateway)?
</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Perhaps more specifically, are there any construtcs that would "dial extension if exists"? Because I want to make sure I dial a sip extension before routing it out to the pstn.
</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">~jerry</span></font></p></div></div></div></blockquote></div>
<div>I believe that something like this will do what you are looking for:</div>
<div>&nbsp;</div>
<div>[4digitContext]</div>
<div>exten =&gt; XXXX,1,goto(checkdids,123456${EXTEN},1) ;Change 1-6 with whatever the prefix</div>
<div>&nbsp;</div>
<div>[checkdids]</div>
<div>;this will try to find a match in 'mydids' before sending out to 'dialout'</div>
<div>include =&gt; mydids</div>
<div>include =&gt; dialout</div>
<div>&nbsp;</div>
<div>[mydids]</div>
<div>;this is the context that houses your DID's.</div>
<div>exten =&gt; _8135551212,1,Dial,SIP/whatever</div>
<div>exten =&gt; _9195551212,1,Dial,SIP/whatever2</div>
<div>&nbsp;</div>
<div>[dialout]</div>
<div>;This will prefix a '1' to the number and make the call.</div>
<div>exten =&gt; _XXXXXXXXXX.,1,Dial,SIP/1${EXTEN}@carrier<br>&nbsp;</div>
<div>I believe this should help you. </div>
<div>Good luck,</div>
<div>&nbsp;</div>
<div>bp</div>