One useful feature on a gateway which uses H323 or SIP (dial-peers) as opposed to MGCP is the ability to block calls based on ANI. This might be useful in order to discard calls from certain callers such as cold callers and specific area codes. Let’s take a look at the configuration required to achieve this requirement.
First of all we are going to use a voice translation-rule to detail which types of calls will be rejected. In the example below we are matching on calls from “800” numbers, calls which block their caller id and also calls which have the numbering type set to “international”.
BR1-RTR(config)#voice translation-rule 1 BR1-RTR(cfg-translation-rule)#rule 1 reject /^800/ BR1-RTR(cfg-translation-rule)#rule 2 reject /^$/ BR1-RTR(cfg-translation-rule)#rule 3 reject // type international
Note that the caret (^) and dollar ($) refer to the start of string and end of string respectively. To clarify, “/^$/” in effect means that there is no character between the start and end of digit string. Compare this with “//” which matches any string including a null string.
The next step is to specify which type of number the gateway will analyze in order to match one of the translation rules defined above.
BR1-RTR(config)#voice translation-profile BLOCK-CALLING BR1-RTR(cfg-translation-profile)#translate calling 1
Here voice translation-rule 1 (which contains 3 sub-rules) is used to match on the calling number. The other options are called and redirecting-number.
The final step is to apply the voice translation-profile to either the voice-port or incoming POTS dial-peer and whilst doing so specify the direction the translation-profile will take effect. Note this is the hurdle where most candidates will fall. If you are familiar with voice translation-profile’s you will understand that to invoke a voice translation-profile you use the following syntax:
BR1-RTR(cfg-translation-profile)#voice-port 0/0/0:23 BR1-RTR(config-voiceport)#translation-profile incoming BLOCK-CALLING
This is the correct command to use to invoke the translation-profile in any instance other rejecting a call. So if you wanted to manipulate some digits and allow the call to proceed onto dial-peer matching then this would work. In this example we are blocking the call and do not want to continue with processing the call. There is another method to apply the voice translation-profile in order to reject the call and this is shown below.
BR1-RTR(config-voiceport)#dial-peer voice 1 pots BR1-RTR(config-dial-peer)#incoming called-number . BR1-RTR(config-dial-peer)#direct-inward-dial BR1-RTR(config-dial-peer)#call-block translation-profile incoming BLOCK-CALLING
The command is fairly intuitive obvious in what it achieves. There are two points worth mentioning. The first is that this profile can only ever be invoked on an inbound dial-peer whether it be POTS or VOIP. So this block profile would be active for all calls coming in from POTS interfaces since “incoming called-number .” will match for the Called Number for any call arriving to the gateway and this is applied to a POTS dial-peer. The second point is that the call-block profile cannot be applied to the voice-port in the same way the voice translation-profile is used earlier in this post.
It must be stressed that any incoming call that does not match on any one of the three rules (ANI beginning with “800”, null ANI and International caller) will proceed as normal.
If there is an additional requirement to only block calls that apply the voice translation-rule for a specific number (let’s say extension 1000) then this can be done by using the following configuration.
BR1-RTR(config-voiceport)#dial-peer voice 1 pots BR1-RTR(config-dial-peer)#incoming called-number 1000 BR1-RTR(config-dial-peer)#direct-inward-dial BR1-RTR(config-dial-peer)#call-block translation-profile incoming BLOCK-CALLING
BR1-RTR(config-voiceport)#dial-peer voice 2 pots
BR1-RTR(config-dial-peer)#incoming called-number .
BR1-RTR(config-dial-peer)#direct-inward-dial
Tags: block ani, call-block translation-profile, h323, translation-profile, voice translation-rule







