You may put two sets of CSS for each building (under phone's line or device itself). Each CSS may match a separate route pattern when they call out. This can be achieved by using partitions. For example if they call a local 10 digit dialing, your pattern may look like 9.[2-9]XX[2-9]XXXXXX. Create two such patterns one in partition P1 and another in partition p2. Include p1 in the CSS of building 1 phones and include p2 in the CSS of building 2 phones.
Use a different ext ph mask in either route patterns (527-6400 in one and 5276401 in the other).
Hope that makes sense!
Sankar
PS: please remember to rate posts!
Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus