Dial Pattern matching on 10 or 11 digit version of a dialed number for a blacklist

I have implemented a “blacklist” of phone numbers using an Outbound Route that has the blacklisted phone numbers in the match pattern section of the dial patterns. If one of these number is dialed it plays a message that the number is black listed and hangs up. This works great, HOWEVER, the pattern doesn’t match if they prepend a 1 before the 10 digit number, so 555-555-5785 will match the blacklist, but 1-555-555-5785 won’t. I am wondering if there are any pattern matching I can add to the phone number to match the 10 digit number or 1 + the 10 digit number? I have tried all kinds of combinations with no luck. Otherwise I am going to have to put in the 10 digit and 11 digit version of numbers in my blacklist making it twice as long (it’s pretty long already). I have looked everywhere for an answer to this but haven’t found one.

Thank you. -J

In your code , match on only the rightmost 10 digits

${thenumber:-10}

Not sure where that would go this is the beginning of a block to send a particular number to the Blacklist route
exten => _[1]5555555785,1,Macro(user-callerid,LIMIT,EXTERNAL,)
.
The [1] is me trying to pattern match a 1 at the beginning which obviously doesn’t work. The real number being replaced with 5555555785 for obvious reasons :slight_smile:

Your snippet references a macro, there can only be the ‘s’ extension in macros so you would do that later in whatever part of your code looks-up $EXTEN in your blacklist ,
in your case try ${EXTEN:-10}

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.