Decoding the pridialplan
The prilocaldialplan option within the Asterisk configuration controls the TON+NPI associated with the Calling Party information element. This is the originator to be presented to the receiving user (think CallerId). The available options are:
-
unknown : set TON to unknown and NPI to unknown. This instructs the receiving switch to interpret the digits according to the standard used by the pstn in that country, leading zeroes etc included. E.g. 00461234567 for a call to Sweden.
-
local : Almost never used unless requested by your pstn provider.
-
national : Interpret the digits as a national number, i.e. with an area code at the beginning, but without any escape digits. I.e. no leading zero or similar for the area code. International dial is not possible.
This is the default in Asterisk and almost always wrong. In some pstn networks in the USA this is actually interpreted like unknown above and not according to the specification.
-
international : A fully formed E.164 phone number. 461234567 would be a call to Sweden. Usable.
-
dynamic : Parse the dialed number and try to find a matching prefix in the settings internationalprefix, nationalprefix, localprefix, privateprefix, unknownprefix. If matched, set the TON/NPI to the matched setting and strip the prefix. Having set nationalprefix=0 allows you to call Dial with e.g. 0461234567 and have it sent as TON=national, digits=461234567.
Setting the *prefix variables listed in dynamic above will _add_ the prefix on inbound calls. This can make the parsing of incoming calls easier.