What configuration I can implement in order to route the incoming calls to CUCM from Lync application via particular PSTN. Suppose I have two set of extension range i.e. 911206118XXX and 9112061197XX but I want if the calling from number is 911206119700 then it should route via PSTN A and if the incoming number is 91120611800 then it must go out via PSTN B.
Please help :)
CUCM is not meant to use the ANI for call decisions, it uses the called number.
Probably the easiest way would be if you can add a prefix to the called number, directly on the Lync side, then use that prefix to match the "right" route pattern in CUCM and send via the right PSTN trunk.
You can also look into external call control profiles to create the custom routing that you need.
There is a way to do so, under TP you can use option "Route Next Hop By Calling Party Number". Please refer https://supportforums.cisco.com/document/71966/blocking-calls-based-calling-party-id, it explains the process. Its a very tricky one and not recommended by Cisco but it works out.
This Document tells you how.