[Resolved] Setting D-channel variables on a PRI line

We having issues with privacy managers. Looking at the D-channel trap I can see that the Calling number (CGN) and Type of Number (TON) is set to unkown. Like this:

CGN: unknown


it needs to be like this:

CGN: e164


How do I do that with Asterisk?

In Zapata.conf I do have pridialplan=national but it is not showing up like that and I have no idea how to set the e164 value.

Any help would be appreciated.


I was able to solve this problem with the help of John at Digium. Thanks John!

So to help others that might run into the same problem I will explain.

Some of the privacy managers that some providers run will look for certain variables to be set on the D-channel on a PRI line. In my case the CallerID was set but the Calling number (CGN) and Type of Number (TON) was set to unknown which caused the privacy managers to intercept the call and ask the caller to enter his 10 digit phone number. You can see on my initial message what it needs to be. As I would have thought the pridialplan needs to be set to national and it was but only after changing the prilocaldiaplan=national it worked (which is strange to me as it was on our long distance).

You can see what the values of the Calling number (CGN) and Type of Number (TON) is by typing the following at the CLI prompt and then make an outbound call.

pri debug span 1

This will produce quite a bit of debug info but you will see the following if those varibales are not set:

[code]>Calling Number (len=14) [ Ext: 0 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0)

Presentation: Presentation permitted, user number not screened (0) ‘2023456789’ ]

Called Number (len=14) [ Ext: 1 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) '15057968235 ][/code]

and when it is set correctly it will look like this:

[code]>Calling Number (len=14) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)

Presentation: Presentation permitted, user number not screened (0) ‘2023456789’ ]

Called Number (len=14) [ Ext: 1 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) '15057968235 ][/code]

The output above is from Asterisk debug and the outpout in the initial message is from a D-channel trap from the Telco.

To disbale pri debugging just type: pri no debug span 1


I also found the following info on pridialplan but you can also read it at this link: http://www.plasmaperfect.net/knowledge/12/

The “prilocaldialplan” option controls the TON+NPI associated with the Calling Party information element. This is the originator to be presented to the receiving user (think CallerId).

“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.
This is what one should normally use

“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

We are using a EuroISDN numbering plan with a spool dialout option.

We need for the calling number type to be Unknown
in zapata.conf we have set prilocaldialplan=unknown
and pidialplan=unknown

Still the calls made by asterisk over PRI show calling party numbering plan as National. What are we missing ?