[asterisk-users] Just got defrauded - how do I block calls which contain a dash (RegEx noob question)

John Covici covici at ccs.covici.com
Fri Oct 28 10:55:42 CDT 2016


How about a \ before the - ?

On Fri, 28 Oct 2016 11:38:13 -0400,
Markus wrote:
> 
> Hi list,
> 
> I'm using Asterisk2Billing (v2.0.16) and it appears to have an
> annoying bug. When there are rates for e.g. 44 (UK landline) and
> 44870 (UK premium) and a fraudster manages to somehow dial 44-870
> instead of 44870 the rate for 44 will match, not the one for
> 44870.
> 
> So, I would like to block all calls on a dialplan level that
> contain a dash. -44, 4-4, 44-, 44---, -, ---, just everything
> with a friggin' dash.
> 
> My noob-ish try:
> 
> exten => _-.,1,NoOp(Blocking dash)
> exten => _-.,n,Hangup
> 
> Doesn't work.
> 
> On https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching I found:
> 
> "The dash (-) character is ignored in extensions and patterns
> except when it is used in a pattern to specify a range in a
> character set. It has no effect in matching or sorting
> extensions."
> 
> How do I do it right?
> 
> Thank you!
> Markus
> 
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> Check out the new Asterisk community forum at: https://community.asterisk.org/
> 
> New to Asterisk? Start here:
>      https://wiki.asterisk.org/wiki/display/AST/Getting+Started
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici
         covici at ccs.covici.com



More information about the asterisk-users mailing list