You can use a combination of call-block and xlation profile to achive this..example below:
Here I am blocking all incoming calls beginning with 202456...
voice translation-rule 1
rule 1 reject \^2024561212\
voice translation-profile block
translate calling 1
Router(config)# dial-peer voice 5 pots
Router(config-dial-peer)# call-block translation-profile incoming block
Router(config-dial-peer)# call-block disconnect-cause incoming invalid-number
From this excellent doc..
Because the xlation profile is applied at your POTS ports, which is where the call hits first before it goes to callmanager
Thats true, Zhang. With MGCP, the dial plan intelligence resides on the CUCM, so any configuration on the gateway is ignored. There's no easy way to do this when the gateway is MGCP controlled.
This tech note on CCO states it can't be done, and recommends using H.323 and then using translation rules like Deji described earlier:
I've seen suggestions of using CRS to accomplish the goal. Your CRS script can be coded to inspect the ANI of all incoming calls, and then route the call based on whether the ANI matches a given string. This would work, but the obvious downside here is the added layer of complexity, and the overhead of routing all incoming calls through CRS. If you are not already CRS, this is also an expensive solution.
Hope this helps.
Thanks for the responses. Yes I kind of thought MGCP would not work that is why I asked.
We are using IPCC currently for all call flows so I will give that work around a try.