Page 167 - Asterisk™: The Future of Telephony
P. 167

Pattern-matching examples
               Before we go on, let’s look at a few more pattern-matching examples. In each one, see
               if you can tell what the pattern would match before reading the explanation. We’ll start
               with an easy one:
                   _NXXXXXX
               This pattern would match any seven-digit number, as long as the first digit was two or
               higher. This pattern would be compatible with any North American Numbering Plan
               local seven-digit number. In areas with 10-digit dialing, that pattern would look like
               this:
                   _NXXNXXXXXX
               Note that neither of these two patterns would handle long distance calls. We’ll cover
               those shortly.


                                        The NANP and Toll Fraud

                  The North American Number Plan (NANP) is a shared telephone numbering scheme
                  used by 19 countries in North America and the Caribbean. Countries within NANP
                  share country code 1.
                  In the United States and Canada, telecom regulations are similar (and sensible) enough
                  that you can place a long-distance call to most numbers in country code 1 and expect
                  to pay a reasonable toll. What many people don’t realize, however, is that 19 countries,
                  many of which have very different telecom regulations, share the NANP. (More infor-
                  mation can be found at http://www.nanpa.com.)
                  One popular scam using the NANP tries to trick naive North Americans into calling
                  expensive per-minute toll numbers in a Caribbean country; the callers believe that since
                  they dialed 1-NPA-NXX-XXXX to reach the number, they’ll be paying their standard
                  national long-distance rate for the call. Since the country in question may have regu-
                  lations that allow for this form of extortion, the caller is ultimately held responsible for
                  the call charges.
                  The only way to prevent this sort of activity is to block calls to certain area codes (809,
                  for example) and remove the restrictions only on an as-needed basis.



               Let’s try another:
                   _1NXXNXXXXXX
               This one is slightly more difficult. This would match the number 1, followed by an area
               code between 200 and 999, then any 7-digit number. In the NANP calling area, you
               would use this pattern to match any long-distance number. ‡
               Now for an even trickier example:

                   _011.

                                                                Building an Interactive Dialplan | 139
   162   163   164   165   166   167   168   169   170   171   172