Get Dialable Number is used to provide a dialable display number to a subscriber endpoint or a non-subscriber endpoint. This API returns the 'dialable number' (formatted number) for an input number (i.e. the 'From' number) in the context of the endpoint or subscriber that will receive the dialable number (i.e. the 'To' number).

Barring the exceptions described in other section, the general flow for getting a dialable number is then as follows:

Get Type of Number for the input 'from' number. The result is normally a normalized number (if the normalization tables are populated) or a defined number. The type of number of the 'from' number is now recorded as the TON_IN.

Find the best matching Number Modification rule, given the input: from, to, and TON_IN. If a rule ends up failing, the next best rule is searched and so forth until there are no more matching rules. If all applicable rules fail, this API returns a failure indication.

For each found rule

The presentation status recorded in the rule is stored in the output number. The number source (Input number, BG Display Number, Default Home DN), TON_OUT (output type of number), the TON_OPT (requested optimization level) and the Prefix required flag are also recorded from the rule for use in this loop.

Call Get Fully Qualified Number for the 'from' number. This call will transform the 'from' number to a Fully Qualified Number if it was not done previously by the previous call to Get Type of Number. The resulting type of number of the 'from' number is recorded as the TON_FQN. If this fails, then the rule fails and the next best rule will be searched (see above).

Now, the Get Dialable Number API tries to create the requested output type of number. If the numbering plan indicator of the input number ('from') and output type of number are different the following possibilities exist:

(1) "The number conversion table is searched to convert the input number ('from') to the desired numbering plan (private or public). After the conversion, the TON_FQN is set to the new type of number of the converted 'from' number. The new TON_FQN is recorded with International (Fully Qualified Public Number must be International).

(2) "If the conversion fails for a conversion from private to public and the Get Dialable Number API was called with an external caller ID number, then the external caller ID number is used as input number ('from') from here on (after running it through the number definition table and the Get Fully Qualified Number API (just like the original 'from').

In all other cases where the conversion fails, the rule fails and the next best rule will be searched

If the TON_OUT is FQPN, then TON_OUT and TON_OPT are set to TON_FQN.

If the 'from' and 'to' are in different BGs and the requested TON_OUT is not a public type of number, then the rule fails and the next best rule will be searched

If the number modification rule requires optimization, the optimization logic is consulted to optimize the 'from' number. If after optimization, the resulting type of number of the 'from' number has a higher level than the requested output type of number (TON_OUT), then the rule fails and the next best rule will be searched

If a prefix needs to be added to the dialable number then the appropriate number prefix table entry is searched and the network access code and prefix are pre-pended to the dialable number. Regardless whether a prefix is found or not, the Get Dialable Number API returns success with the modified number.