Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to detect if a NGN (Non Geographic Number, e.g. 0844, 0845, 0870 etc) number has been used to connect to an Asterisk PBX?

Thanks in advance.


share|improve this question
up vote 0 down vote accepted

Asterisk can only act on the information provided by the call. If your telephony service provider delivers the calling number (CallerID or ANI) via PRI, SIP, or other signalling, then Asterisk can act on that data. Whether you can trust the validity of the provided data has nothing to do with Asterisk; it can be spoofed.

Use Asterisk dialplan in extensions.conf to compare ${CALLERID(num)} against a fixed list or database, then take whatever action you wish as a result -- go to a different context, set a billing code, etc.

share|improve this answer

It depends on how your Asterisk box receives those calls.

If using E1/T1 you usually receive a DNIS indication with the called number, available on your receiving context.

If receiving those calls trough some SIP provider, they should provide you some way to access that data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.