VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
nick at flhsi.com Guest
|
Posted: Mon May 12, 2014 12:25 pm Post subject: [asterisk-users] Realtime Pattern Matching |
|
|
Hello All, Looking for a little guidance on Real Time Pattern Matching.
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.
So as you can see from the lines below. If I Dial 321-555-1212 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?
1056 outbound _NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist 1057 outbound _1NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist 1776 outbound _321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 321 Catchall 1777 outbound _1321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 1321 Catchall
Thanks
Nick Olsen Network Operations (855) FLSPEED x106 |
|
Back to top |
|
|
rmudgett at digium.com Guest
|
Posted: Mon May 12, 2014 12:36 pm Post subject: [asterisk-users] Realtime Pattern Matching |
|
|
On Mon, May 12, 2014 at 12:25 PM, Nick Olsen <nick@flhsi.com (nick@flhsi.com)> wrote:
Quote: | Hello All, Looking for a little guidance on Real Time Pattern Matching.
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.
So as you can see from the lines below. If I Dial 321-555-1212 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?
1056 outbound _NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist
1057 outbound _1NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist
1776 outbound _321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 321 Catchall
1777 outbound _1321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 1321 Catchall
|
The _321NXXXXXX is more specific than _NXX555XXXX that is why it is selected.
See
https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching
for the rules of pattern matching.
Richard |
|
Back to top |
|
|
joshdmetzger at gmail.com Guest
|
Posted: Mon May 12, 2014 12:43 pm Post subject: [asterisk-users] Realtime Pattern Matching |
|
|
On Mon, May 12, 2014 at 1:25 PM, Nick Olsen <nick@flhsi.com (nick@flhsi.com)> wrote:
Quote: | Hello All, Looking for a little guidance on Real Time Pattern Matching.
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.
So as you can see from the lines below. If I Dial [url=tel:321-555-1212]321-555-1212[/url] 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?
1056 outbound _NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist
1057 outbound _1NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist
1776 outbound _321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 321 Catchall
1777 outbound _1321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 1321 Catchall
|
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:
exten => _1NXXNXXXXXX,1,GotoIf($["${EXTEN:-7:3}" = "555"]?outbound-411,411,1)
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.
Josh |
|
Back to top |
|
|
nick at flhsi.com Guest
|
Posted: Mon May 12, 2014 1:34 pm Post subject: [asterisk-users] Realtime Pattern Matching |
|
|
Thanks for the info everyone.
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.
Thanks to everyone that replied.
Nick Olsen Network Operations (855) FLSPEED x106
From: "Josh Metzger" <joshdmetzger@gmail.com> Sent: Monday, May 12, 2014 1:43 PM To: nick@flhsi.com, "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com> Subject: Re: [asterisk-users] Realtime Pattern Matching
On Mon, May 12, 2014 at 1:25 PM, Nick Olsen <nick@flhsi.com (nick@flhsi.com)> wrote: Quote: | Hello All, Looking for a little guidance on Real Time Pattern Matching.
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.
So as you can see from the lines below. If I Dial [url=tel:321-555-1212]321-555-1212[/url] 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?
1056 outbound _NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist 1057 outbound _1NXX555XXXX 1 Goto outbound-411,411,1 Block Dir Assist 1776 outbound _321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 321 Catchall 1777 outbound _1321NXXXXXX 1 Goto outbound-cocoa,${EXTEN},1 Outbound 1321 Catchall
|
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:
exten => _1NXXNXXXXXX,1,GotoIf($["${EXTEN:-7:3}" = "555"]?outbound-411,411,1)
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.
Josh |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|