Unable to internal routing (to ext) based upon called ID by customer

A discussion you should follow. Sounds like a similar (programmatically) solution.