<span style="font-family: arial, helvetica, sans-serif; font-size: 12px"><div>Thanks for the info everyone.</div>
<div> </div>
<div>With our particular dial plan. We break out _321 _305 _407.. Local area codes, And handle them differently. Where is _NXX555 XXXX works for numbers not specifically broken out. The fix for this was adding more specific _321555XXXX for those handful of areacodes. Letting _NXX555XXXX handle the rest.</div>
<div> </div>
<div>Thanks to everyone that replied.</div>
<div> </div>
<div>Nick Olsen<br />
<span style="font-size: 10pt; font-family: arial,helvetica,sans-serif;">Network Operations</span>
<div>(855) FLSPEED x106<br />
<br />
<img alt="" height="56" src="http://www.flhsi.com/files/emaillogo.jpg" width="168" /></div>
</div>
<div> </div>
<hr align="center" size="2" width="100%" />
<div><span style="font-family: tahoma,arial,sans-serif; font-size: 10pt;"><b>From</b>: "Josh Metzger" <joshdmetzger@gmail.com><br />
<b>Sent</b>: Monday, May 12, 2014 1:43 PM<br />
<b>To</b>: nick@flhsi.com, "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com><br />
<b>Subject</b>: Re: [asterisk-users] Realtime Pattern Matching</span>
<div> </div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Mon, May 12, 2014 at 1:25 PM, Nick Olsen <span dir="ltr"><<a href="mailto:nick@flhsi.com" target="_blank">nick@flhsi.com</a>></span> wrote:
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px">Hello All, Looking for a little guidance on Real Time Pattern Matching.</span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px"> </span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px">We are attempting to block outbound 411 via when someone dials NXX-555-XXXX, The must common being NXX-555-1212. However, We have some outbound providers that consider any call to NXX-555-XXXX a directory assistance call. So simply making my pattern _NXX5551212 doesn't work.</span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px"> </span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px">So as you can see from the lines below. If I Dial <a href="tel:321-555-1212" target="_blank" value="+13215551212">321-555-1212</a> the call is being applied to _321NXXXXXX not my _NXX555XXXX. I assume because they are equally specific. Does anyone have any creative ideas to pattern match NXX-555-XXXX besides what I've done here?</span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px"> </span></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:12px">1056 outbound _NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist<br />
1057 outbound _1NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist<br />
1776 outbound _321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 321 Catchall<br />
1777 outbound _1321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 1321 Catchall</span></div>
</blockquote>
</div>
</div>
<div class="gmail_extra">If you're always trying to catch "555" for the prefix, instead of playing with pattern matching the extension, you could test on the substring:<br />
</div>
<div class="gmail_extra">exten => _1NXXNXXXXXX,1,GotoIf($["${EXTEN:-7:3}" = "555"]?outbound-411,411,1)<br />
</div>
<div class="gmail_extra">This example would match any "1+Area code+number where the prefix is "555". You could play with your pattern match to catch call to 1+AC+Number and just AC+Number using this same test since it's right-delimited. <br />
</div>
<div class="gmail_extra">Josh</div>
</div>
</div></span>