How does Asterisk connect to the telephone network?


I’m a newbie to VoIP and Asterisk. I would like to know a few basic things in general.

  1. Is Asterisk or AsteriskNow the open source PBX software? I’m going to assume it’s called Asterisk.

  2. How does Asterisk connect to a telephone network? How does the computer with Asterisk installed interface with the rest of the world to make phone calls?

I’m doing a project related to defending against spam call/robo call. Most of these have faked caller ids. So I would like to look in to how that works.

  1. How is caller id communicated between systems? How is caller id conveyed in the telephone network? What features does Asterisk provide related to caller id? Can it be modified?

  2. I heard two things: a) Telephone protocols have changed over the years b) Nowadays, most calls go through IP to save costs.
    So, what protocols are used nowadays? Is SS7 still used for PSTN and SIP for VoIP? How have they changed?
    And do most calls get routed through IP? How are calls transferred in general nowadays between two entities?

Thank you in advance. I’d appreciate any help I can get to understand this.


  1. Asterisk is the application. AsteriskNOW is a complete Linux distro with Asterisk/DAHDI/FreePBX preinstalled. They’re both open source, I believe.

  2. Asterisk can connect to a standard PSTN through DAHDI-compatible hardware cards that can be installed in the server for PRI or POTS lines, or you can use an external device, such as a Digium appliance to connect to the PSTN’s lines.
    Caller IDs can be faked in a number of ways. Many TelCos will default the caller ID name, but allow you to manipulate the caller ID number from your business. Others will accept whatever you send.

  3. Between systems is usually through SIP or IAX (pronounced eeks for some reason) network packets. To the PSTN, in North America, using a PRI, the signalling is sent over the 24th (of 24) channels. You can tell the system to use whatever caller id is programmed from a sip peer or override in the dialplan.
    exten => s,1,Set(CALLERID(name) = Somename)
    same => n,Set (CALLERID(num) = 999-555-1212)
    exten => s,1,Set(CALLERID(all) = Somename <999-555-1212>)

  4. a) Eventually, it’s likely that a call will run over a tcp/udp network.
    SS7 is still in use, but I’m not an expert on that. Better to read up yourself. SIP has had several updates over the years also.

Transfers can occur in a number of ways; bridged if internal, trunked if external. Not sure if that’s what you were asking, but that’s the short answer.

I would also recommend just reading “Asterisk - The Definitive Guilde” for more info.

1 Like
  1. Asterisk supports maybe 95% of the commonly used ways of connecting to the PSTN, so there is no simple answer to this.

Depending on the method of connection, and the capabilities of downstream systems, caller ID may be associated with flags indicating whether it should be presented and whether it is network provided (and therefore completely, trustworthy, user supplied and from a number confirmed to belong to a user, or user provided and not checked by the service provider. A service provider may downgrade the second of these parameters. Fake caller ID gets through either because the service provider doesn’t downgrade properly, or because user provided unscreened addresses are neither suppressed, nor passed with the unscreened flag to the end user (standard analogue lines don’t support this flag).

Thanks mkozusnik for your explanation.

  1. So when I download the AsteriskNOW, the DAHDI comes with it? I’m interested in knowing how Asterisk connects with the PSTN line. How does that work?

Hi david551,

Can you tell me more about “the method of connection” that you referred to which involved the use of “flags”?

Is there a name for it?
Do only VoIP lines support these flags?
Are these flags set by the service provider?
What do you mean by “a service provider may downgrade the second of these parameters”?
What is being downgraded?

You really need to do some background reading on how telephone systems work as I think the gap in your understanding is too great to be filled by 1 minute responses on a peer support forum.

The basic internal signalling system of the telephone networks is called SS7 (signalling system 7). End users get good access to it using ISDN. In general, VoIP services connect to it using ISDN, or directly, but because they are one removed they may not give as much access.

It is primarily digital circuit switched lines (ISDN, and SS7) that provide this. VoIP also does, but less well.

If the connection allows it the end user can set them. If the connection doesn’t allow them (e.g. simple analogue, or SIP not using Remote-Party-ID headers) the service provider has to set them).

If an end user claims to be providing a network provided address, the PSTN or VoIP operator should convert it to user supplied.

The highest quality of number is network provided, followed by user provided screened, user provided unscreened and finally user provided failed screen. By downgrading I mean converting an earlier status in that list to a later one.

Screened means that the service provider has checked the number against numbers controlled by their customer.

(Most spoofing is done over VoIP as VoIP service providers tend to be less scrupulous than traditional ones.)

That was rather more than one minute of my time.


DAHDI is the collective term for the software modules that allow the application (in this case, Asterisk) to speak to the hardware. The hardware can be a PRI (Primary Rate Interface) card or FXO/FXS card(s) for POTS (Plain Old Telephone Service) lines. FXO does FXS signaling, so it talks to the phone company. FXS does FXO signaling, so it talks to a phone (most often). The phone company will provide either to your location. It will be a cable (T1/E1) or standard copper lines (often as a block), sometimes fiber. If you’re using a whole PRI, in North America, there are 24 channels. 23 Bearer channels handle the audio for the call, and 1 Data channel handles the signaling. Typically, channels 0-22 (1-23) are the B channels, and 23 (24 if starting with 1) is the D channel. You will need to configure your DAHDI to conform with the settings that are agreed upon by you and the PSTN. Things like timing are typically provided by the network (PSTN) side. This can be changed if need be, but both sides have to configure it to “talk”. On that PRI, there can only be 23 inbound, outbound, or combination calls simultaneously.

The PSTN will give you, if needed, DIDs (Direct Inward Dialing). Basically phone numbers that people outside of your network can use to contact you through the PSTN. You will need to accept those DIDs, and route them to an endpoint (phone, queue, ring group, auto-attendant, etc.) or some part of the dialplan using Asterisk. Outward dialing is configured to find the first open channel (typically) either ascending or descending. You can pass the Caller ID info, and the call will go out if everything is configured properly. As David said, many telcos will only allow you to send caller id numbers that match one in their system. Often times, they will overwrite the caller id name with a default provided when you configure the circuit with them.

1 Like

Thanks mkozusnik.

You mentioned “…they will overwrite the caller id name…”. Do you mean “phone number” or “owner’s name” by “caller ID name”? I’ve read in some places that the “owner’s name” is transmitted as Caller ID. But, I don’t understand this as I’ve never seen any names on my cellphone. The only info I get (i.e. see on my cellphone display) when someone calls me is their phone number.

Thank you david551 for taking the time to explain more on the topic. I am fairly a newbie to telephony. Thanks anyways :slight_smile:

Yes, there are two parts to a caller id; Name and Number. Both can be sent, but the telco may replace either when sending the call out. You’ll have to contact them to see if they override the caller id name and/or number on the trunk.