rule for only 10 or 11 digits

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
sm8651
Posts: 13
Joined: Fri Nov 22, 2013 9:05 am

rule for only 10 or 11 digits

Post by sm8651 »

1. Brekeke Product Name and Version:
3.9

5. Your problem:
I would like to modify my rule so only calls that dialed 10 or 11 digits should go out from this rule.

my rule now is
$request = ^INVITE
To = sip:(.+)@
From = sip:(.+)@

how do I modify this to grab only 10 or 11 digits.

Then i need a rule after this that if you dialed anything that didnt route through this one should get a error so they dont try the calls again.

The reason is we have accounts misdialing like 3 digits and their pbx sends it to the server and the calls go to our carrier, the carriers dont like all these invalid destinations.
Niloc
Posts: 70
Joined: Tue Sep 19, 2017 9:49 pm
Location: NL

Post by Niloc »

Modify "To=" definition like this.
To = sip:(.{10,11})@

FYI:
https://en.wikipedia.org/wiki/Regular_expression
Post Reply