cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
415
Views
5
Helpful
4
Replies

Block all incoming calling numbers except predefined range

astupakov
Level 1
Level 1

Hello. I need to block all incoming calling numbers except certain range in voip dial-peer on Cisco 3845. I have two dial-peers, one for SIP-provier and another for the VoIP where my users reside. So, I need to prevent all calling numbers from SIP-provider except numbering 1234... (pls don't ask me why).

I've tried to use call-block translatioin rule, like this:

voice translation-rule 1000
 rule 1 /^1234...$/ //
 rule 2 reject //
!
voice translation-profile Invalid
 translate calling 1000
!
dial-peer voice 1 voip
 description SIP-provider
 call-block translation-profile incoming Invalid
 destination-pattern 1234...$
 session protocol sipv2
 session target sip-server
 ip qos dscp cs5 media
 no vad

 

but unfortunately it can only block certain numbers, not permit. Is any method exists to implement this?

Many thanks in advance.

 

1 Accepted Solution

Accepted Solutions

Try this instead and let me know if it works:

 

voice translation-rule 111
 rule 1 reject /^[^1]......$/

 rule 2 reject /^1[^2].....$/

 rule 3 reject /^12[^3]....$/

 rule 4 reject /^123[^4]...$/

View solution in original post

4 Replies 4

john.welsh
Level 5
Level 5

Probably the best way to accomplish this is to use the "do not match" character.  So, for instance, you could do something like this for your rule:

rule 1 reject /^[^1][^2][^3][^4]...$/

I think that should work or at least get you closer to your goal.

 

john.welsh, thanks for reply.

Unfortunately this doesn't work too:

!
voice translation-rule 111
 rule 1 reject /^[^1][^2][^3][^4]...$/
!

C3845#test voice translation-rule 111 1234000
1234000 Didn't match with any of rules
C3845#test voice translation-rule 111 1235000
1235000 Didn't match with any of rules
C3845#test voice translation-rule 111 1235000
1235000 Didn't match with any of rules
C3845#test voice translation-rule 111 1000000
1000000 Didn't match with any of rules
C3845#test voice translation-rule 111 1000   
1000 Didn't match with any of rules
C3845#test voice translation-rule 111 1   
1 Didn't match with any of rules
C3845#test voice translation-rule 111 234
C3845#test voice translation-rule 111 2340000
2340000 blocked on rule 1

 

The rule matches numbers by first digit only.

Try this instead and let me know if it works:

 

voice translation-rule 111
 rule 1 reject /^[^1]......$/

 rule 2 reject /^1[^2].....$/

 rule 3 reject /^12[^3]....$/

 rule 4 reject /^123[^4]...$/

john.welsh, thank you very much, it works!