How to set order of inbound routes

I have a DID 123456789 which routes all calls to ring group, I want to set a CID route for certain numbers that call this DID 123456789 to be routed else were. I can create the CID route but how to place it before the catch all route for DID 123456789.
All incoming callers dial 123456789.

The system will match the most exact route.

Consider the following routes:

  • 123456789 → Ring Group 600
  • 123456789 / 13051234568 → Queue 500

If someone with the CID 120512387956 calls to the DID 123456789, the call will be forwarded to the Ring Group 600.

Now, if someone with the CID 13051234568 calls to your DID, the call will be forwarded to Queue 500.

Thank you that works.