11-11-2014 09:09 AM - edited 03-13-2019 08:43 PM
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.
Solved! Go to Solution.
11-13-2014 11:30 AM
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]...$/
11-12-2014 09:30 AM
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.
11-13-2014 01:41 AM
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.
11-13-2014 11:30 AM
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]...$/
11-14-2014 02:04 PM
john.welsh, thank you very much, it works!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide