You order "DID Trunks" from the local telco. They bring them in just like they were loop or ground start trunks, that is they come in as pairs on your minimum-point-of-entry terminal. They don't have dial tone or battery on them; in fact YOU supply the battery back to the phone company.
You order a "block" of DID numbers, and a quantity of DID "trunks" to handle the maximum number of simultaneous incoming DID calls that you expect to receive. For instance, your Block could be 555-0100 through 555-0199, and you could only have 4 trunks. Only 4 incoming DID calls could be received at one time, the 5th call gets a busy signal.
When a call comes in, the telco "winks" the trunk to signal the Legend that there is a call coming in, the Legend "winks" back to indicate that it is ready, then the telco sends a string of digits to tell the Legend what number the caller dialed. This could be 2, 3, 4 or more digits, depending on how you have it set up with the telco.
If you have the telco sending the same number of digits as your extension numbers, and in the same range, calls go automatically to the matching extension. If, for instance, the telco sends only the last 2 digits, and your extension numbers go from 100 to 199, you would "add" the digit "1" to the string to make it match. If the telco sends say, 3 digits in the range of 100 to 199, but your extension numbers are 200-299, then you would delete one digit, and add the digit "2". So it's best to order the DID block and digits to match your extension range.
One other "gotcha" when connecting the trunks: If you are using a premade connecting cord, plugging it into the DID trunk jack on the Legend, and then punching the other end down on the MPOE or RJ-21 66 Block, REVERSE the polarity of the Green/Red at the block. This is because the Legend was designed to have the lines on jacks installed by the telco, and then use telephone line cords (which do a cross-over) to connect to the trunk jacks. Since you are providing the battery back to the telco, it won't work if tip and ring are reversed.