<br><br>
<div><span class="gmail_quote">On 7/18/06, <b class="gmail_sendername">Jerry Bonner</b> <<a href="mailto:Jerry.Bonner@cptelecom.net">Jerry.Bonner@cptelecom.net</a>> 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> </div>
<div>[4digitContext]</div>
<div>exten => XXXX,1,goto(checkdids,123456${EXTEN},1) ;Change 1-6 with whatever the prefix</div>
<div> </div>
<div>[checkdids]</div>
<div>;this will try to find a match in 'mydids' before sending out to 'dialout'</div>
<div>include => mydids</div>
<div>include => dialout</div>
<div> </div>
<div>[mydids]</div>
<div>;this is the context that houses your DID's.</div>
<div>exten => _8135551212,1,Dial,SIP/whatever</div>
<div>exten => _9195551212,1,Dial,SIP/whatever2</div>
<div> </div>
<div>[dialout]</div>
<div>;This will prefix a '1' to the number and make the call.</div>
<div>exten => _XXXXXXXXXX.,1,Dial,SIP/1${EXTEN}@carrier<br> </div>
<div>I believe this should help you. </div>
<div>Good luck,</div>
<div> </div>
<div>bp</div>