Hard to find anything crystal clear on this! This is an extract from CIPT2:
When rerouting over the PSTN is desired, call agents are configured not only to advertise their internally used number ranges, but also with the corresponding PSTN numbers. The PSTN number is not advertised as a distinct number; it is advertised by a PSTN failover digit-transformation rule (known as a ToDID rule). A ToDID rule describes how the internally used number has to be manipulated to get to the associated PSTN number. A ToDID rule consists of two components: ■ Number of digits to be stripped: The first part of a ToDID rule is the number of digits to be stripped from the internally used number. For example, if site-code dialing is used and the internally used number to reach a block of directory numbers is 8-408- 2XXX, you might want to strip the leading 8408 before prefixing the necessary digits to directory-number range 2XXX. In this case, your ToDID rule starts with 4: because the four leading digits should be stripped. ■ Prefix to be added to the (deflated) internal number: The second part of a ToDID rule is the prefix that should be added to the internally used number after digit stripping has been performed. In the previous example, if the PSTN direct inward dialing (DID) range of the internally used directory-number range 2XXX (dialed as 8-408- 2XXX from other sites) is 408 555-2XXX, the prefix would be 408555. Usually, E.164 format with a + prefix represents the PSTN number, so the configured prefix would be +140855. In the given example, the complete ToDID rule would be 4:+1408555 because the numbers to be stripped and the prefix are separated by a column. By advertising only the locally present internal numbers and the corresponding ToDID rule at each call agent, the dial plan implementation of large networks is extremely simplified. If there are any changes at a call agent, you have to change only the advertised number (range) and its ToDID rule at the affected call agent. All other call agents will dynamically learn the changes.