Each DID can have its own line, that should solve the problem.
Than use Call grouping to determine what extensions you want to have it ring, or just bind it to one extension.
The number mask of the DID is used to determine the difference, starting from the back. (from memory I have to look that up actually).