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

Block incoming Calls based off of ANI. (incoming or originating phone number)

The following is an example of how to setup call blocking based off of incoming Caller's ANI.

In this example, my voice enviornment consist of an 8.6 CUCM Pub with 3 Subscribers.  I have three cisco 2911 h.323 voice gateways with 1 PRI each.  I put together this simple 3 step process based off of a Cisco Configuration guide.  I tested it on my cell phone and a coupe of others and it worked great.  Here are the three steps:

Block Incoming Calls based off of ANI. 



The following configuration must be applied to each voice gateway.  It is done in basically 3 steps:



1. Create a Translation Rule. 

Within the translation rule you will use the reject command followed by the pattern you wish to reject.  In this case we use the entire phone number.



router#conf t

router(config)#voice translation-rule 1

router(config-xxx)#rule 1 reject /8055553538/
router(config-xxx)#rule 2 reject /4805557904/



Moving forward, you can continue to add rules to reject numbers as you see fit.  example:

router(config-xxx)#rule 3 reject /4805557905/ and so on.





2. Apply the Translation rule to a Translation Profile and give it a name. 

(This will be used to apply to the incoming Dial-peers.)



router#conf t

router(config)#voice translation-profile call_block

router(config-xxx)#call-block disconnect-cause incoming call-reject


in this case we named the Translation Profile "call_block"



3. Apply Translation Profile to incoming Dial-peers (only) on each router.



router#conf t

router(config)#dial-peer voice 1 pots

router(config-xxx)#call-block translation-profile incoming call_block

router(config-xxx)#call-block disconnect-cause incoming call-reject



In our case, we apply this to dial-peers 1 and 2 on each voice gateway as these are the incoming dial-peers for each location. 

Each dial-peer looks like this after configuration:  (at least in our enviornment)

dial-peer voice 1 pots

call-block translation-profile incoming call_block

call-block disconnect-cause incoming call-reject

incoming called-number .T

direct-inward-dial

port 0/0/0:23

Hope this helps for anyone out there looking to block based off incoming numbers.

Comments
New Member

Nice work there, i made a similar conf, and blocked all numbers begining with 060 and 064:

rule 1 /^060/ /9999/

rule 2 /^064/ /9999/

New Member

is possible redirect a call to especific hunt-goup using similar configuration?

New Member

We used this method successfully until we quickly reached the maximum number of blocking rules (15). I see we can do this on the CUCM (8x & later) with a couple of CSS & Partitions, then build Xlate patterns to block based on calling party number. That's fine except I'd like to be able to do the blocking on the GW router if I could. How do I get around this limit of 15?  Someone mentioned IOS 15.3(T) expanded this capacity to 100 rules, which again is fine, but where do I go after I hit 100 reject rules?

TIA

Bill

New Member

Hi Bill, that is a good question.  Typically we purge out the older rules when and if we reach our maximum if we are blocking specific numbers.  Or you can block out groups of numbers using expressions the way fpavici describes above.

New Member

The above document has a small mistake in it. Under the voice translation-profile, rule needs to be applied. So currently the above configuration will not work as the rule is not been called anywhere.

New Member

Excellent document !!

Thanks for sharing

Regards

New Member

Bill,

 

I found an interesting way to block more if needed. You can create incoming dial-peers matching by answer-address and then apply a translation rule that rejects the call or reroutes the called number to something invalid.

 

You can create as many as you have memory for (Dial-peers consume 6k per peer).

 

Example:

 

voice translation-rule 99
 rule 1 /^..../ /7778/
voice translation-profile FILTER_LIST
 translate called 99

 

dial-peer voice 99 pots
 translation-profile incoming FILTER_LIST
 answer-address 5558675309

 

This will take calls that patch the peer and forward them to 7778, which I have configured in Unity as a call handler that says "goodbye" then hangs up.

 

Keep in mind if you are running CUBE that if you match the inbound calls using a "incoming called number .T" dial-peer it will take precedence over answer address. You will have to convert you peer to "answer-address .T".

 

I hope that is helpful!

Mitch

 

 

New Member

Hi all, 

I need to block an incoming call on my CME ver 9.1.

I follow the example but not working. Below my configuration:

voice translation-rule 1
 rule 1 // /0/ type unknown unknown
 rule 2 // /00/ type national national
 rule 3 // /000/ type international international
!
voice translation-rule 2
 rule 1 /^100/ /100/
 rule 2 /^101/ /101/
 rule 3 /^110/ /110/
 rule 4 /^111/ /111/
 rule 5 /^112/ /112/
 rule 6 /^113/ /113/
 rule 7 /^114/ /114/
 rule 8 /^115/ /115/
 rule 9 /^116/ /116/
 rule 10 /^117/ /117/
 rule 11 /^118/ /118/
 rule 12 /^119/ /119/
 rule 13 /^120/ /120/
!
voice translation-rule 3
 rule 1 /101/ /xxxxxxx101/
 rule 2 /.../ /xxxxxxx100/
!
voice translation-rule 4
 rule 1 /^0\([0-9]\)/ /\1/
!
voice translation-rule 6
 rule 1 reject /009715297xxxxx/
 rule 2 reject /^3903072xxxxx/
!
!
voice translation-profile IN-PSTN
 translate calling 1
 translate called 2
!         
voice translation-profile OUT-PSTN
 translate calling 3
 translate called 4
!
voice translation-profile call_block
 translate calling 6
!

dial-peer voice 10 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile incoming IN-PSTN
 incoming called-number .T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 20 pots
 trunkgroup BRITrunk
 corlist outgoing Internazionali
 tone ringback alert-no-PI
 description Outgoingdp
 translation-profile outgoing OUT-PSTN
 destination-pattern 000T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 30 pots
 trunkgroup BRITrunk
 corlist outgoing Nazionali
 tone ringback alert-no-PI
 description Outgoingdp
 translation-profile outgoing OUT-PSTN
 destination-pattern 00T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 40 pots
 trunkgroup BRITrunk
 corlist outgoing Cellulari
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 03T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 50 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 11.
 no digit-strip
 direct-inward-dial
!
dial-peer voice 60 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 011.
 no digit-strip
 direct-inward-dial
!
dial-peer voice 1 pots
 service stcapp
 port 0/2/1
!
dial-peer voice 2 pots
 service stcapp
 port 0/2/2
!
dial-peer voice 70 pots
 trunkgroup BRITrunk
 call-block translation-profile incoming call_block
 call-block disconnect-cause incoming call-reject
 incoming called-number .

 

Can you kindly help me?

Best regards

Pietro

 

New Member

Hi Joshua Engels

i have followed your guide but not work.

The number is not blocked by my call manager relesa 9.1 (below my rule)

voice translation-rule 1
 rule 1 // /0/ type unknown unknown
 rule 2 // /00/ type national national
 rule 3 // /000/ type international international
!
voice translation-rule 2
 rule 1 /^100/ /100/
 rule 2 /^101/ /101/
 rule 3 /^110/ /110/
 rule 4 /^111/ /111/
 rule 5 /^112/ /112/
 rule 6 /^113/ /113/
 rule 7 /^114/ /114/
 rule 8 /^115/ /115/
 rule 9 /^116/ /116/
 rule 10 /^117/ /117/
 rule 11 /^118/ /118/
 rule 12 /^119/ /119/
 rule 13 /^120/ /120/
!
voice translation-rule 3
 rule 1 /101/ /xxxxxxx101/
 rule 2 /.../ /xxxxxxx100/
!
voice translation-rule 4
 rule 1 /^0\([0-9]\)/ /\1/
!
voice translation-rule 6
 rule 1 reject /009715297xxxxx/
 rule 2 reject /^3903072xxxxx/
!
!
voice translation-profile IN-PSTN
 translate calling 1
 translate called 2
!         
voice translation-profile OUT-PSTN
 translate calling 3
 translate called 4
!
voice translation-profile call_block
 translate calling 6
!

dial-peer voice 10 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile incoming IN-PSTN
 incoming called-number .T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 20 pots
 trunkgroup BRITrunk
 corlist outgoing Internazionali
 tone ringback alert-no-PI
 description Outgoingdp
 translation-profile outgoing OUT-PSTN
 destination-pattern 000T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 30 pots
 trunkgroup BRITrunk
 corlist outgoing Nazionali
 tone ringback alert-no-PI
 description Outgoingdp
 translation-profile outgoing OUT-PSTN
 destination-pattern 00T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 40 pots
 trunkgroup BRITrunk
 corlist outgoing Cellulari
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 03T
 no digit-strip
 direct-inward-dial
!
dial-peer voice 50 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 11.
 no digit-strip
 direct-inward-dial
!
dial-peer voice 60 pots
 trunkgroup BRITrunk
 tone ringback alert-no-PI
 translation-profile outgoing OUT-PSTN
 preference 1
 destination-pattern 011.
 no digit-strip
 direct-inward-dial
!
dial-peer voice 1 pots
 service stcapp
 port 0/2/1
!
dial-peer voice 2 pots
 service stcapp
 port 0/2/2
!
dial-peer voice 70 pots
 trunkgroup BRITrunk
 call-block translation-profile incoming call_block
 call-block disconnect-cause incoming call-reject
 incoming called-number .

 

Can you kindly help me?

Best regards

Pietro

New Member

you need to add the two lines below too your inbound dial-peer, on your case dial-peer voice 10 pot

 call-block translation-profile incoming call_block
 call-block disconnect-cause incoming call-reject

New Member

I agree

New Member

My apologies for not starting a new thread but so much of this thread could apply to my version of the question. 

What if you had a certain block of numbers being used by your CER for the ERL masking and you only wanted to allow inbound calls from the PSAP to reach those numbers, not errant calls because the DIDs had been assigned by your provider prior to your assignment.  Basically, there are only maybe 100 numbers I would allow that are part of a block, let's say 321-456-78XX and then to block any other numbers inbound for your set of DIDs.  Imagine you already have a few hundred DIDs for normal calling concerns.  You are trying to avoid your onsite emergency response desk from being overwhelmed with solicitor calls.

Thank you in advance for any reply

New Member

Hi aksachede, I have tested the configuration and it works. 

An easy way to test is to just put a cell number in on the block and test.  It is possible that when I wrote this years ago I left something out but this should work.  If I left off a piece of the config, please feel free to submit an example and I will modify the above configuration.

 

Thanks!

New Member

I think what aksachede was saying is that in your Step 2, where you create the translation profile, you are missing the command "translate calling 1".  The 1 in that command is referencing the translation-rule 1 that was created in Step 1.  Without that, it wouldn't know what translation-rule to reference for the reject list. So your Step 2 should look like this instead...

 

2. Apply the Translation rule to a Translation Profile and give it a name. 

(This will be used to apply to the incoming Dial-peers.)

 

router#conf t

router(config)#voice translation-profile call_block

router(config-xxx)#translate calling 1


in this case we named the Translation Profile "call_block"

12042
Views
10
Helpful
14
Comments