Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Block all incoming calling numbers except predefined range

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
New Member

Try this instead and let me

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]...$/

4 REPLIES
New Member

Probably the best way to

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.

 

New Member

Unfortunately this doesn't

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.

New Member

Try this instead and let me

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]...$/

New Member

john.welsh, thank you very

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

97
Views
5
Helpful
4
Replies