Block call regardless if number is dialed with 1 or not

I am trying to block outbound calls regardless if they are dialed with a 1 or not. Currently the only way I can figure to do this is to add separate entries into my extensions_table; one that has the 1 in front of the number and one that doesn’t.

Example:

±------±---------±------------±-------±--------±---------+
| id | context | exten | app | appdata | priority |
±------±---------±------------±-------±--------±---------+
| 37127 | internal | 2223334444 | hangup | | 1 |
| 37126 | internal | 12223334444 | hangup | | 1 |
±------±---------±------------±-------±--------±---------+

The above would prevent me from dialing both numbers.

I’d like to bring this down to just one entry that covers both, but I’m not sure how to do this. I see the pattern matching stuff, and have tried _X2223334444 but that doesn’t seem to do it.

Is there another method for doing this?

Thanks!

I suspect the easiest way is to canoncalise the number, then apply the block list.

IE convert all numbers to the one form.

Hrmm, well I’m not sure how to do that :smile:

I inherited this system, and am not familiar with Asterisk, so was hoping there was an easier way.