VoIP: PSTN Gateways
Probably the most core concept in VoIP, at least beyond the idea that it is voice data carried over the Internet Protocol, is the idea that all VoIP traffic needs the ability to bridge between a VoIP network and the PSTN which is, inherently, not VoIP. The PSTN uses the S7 protocol and is an ancient network designed purely for voice and built on decades of previous legacy infrastructure. In order for VoIP systems to be able to make a phone call to a telephone number they need a means of bridging the voice traffic to the legacy network. This becomes one of the biggest complications in working with VoIP.
In order to bridge this divide any VoIP system has to connect to a traditional phone company at some point. This "traditional" telephone company might be someone like AT&T or Verizon, or it might be a newer carrier but in any situation that carrier needs a connection into the PSTN directly. In this way the PSTN can be thought of as a second, totally independent (and older) Internet in that it is a network that is defined by many large networks connecting to each other. On the Internet side we use IP Addresses for network addressing and on the PSTN side we use telephone numbers in the same way.
Normally we acquire bridging by purchasing a telephone connection from the telephone company. In this way the VoIP world is really no different from the legacy telephony world. We get a "telephone line."
The bridging point or demarcation point between VoIP and the PSTN can happen in multiple places. If VoIP (SIP likely) is delivered to the customer then the demarcation point is at or behind the SIP Trunk provider. If a legacy (non-VoIP) trunk is provided to the customer then the demarcation point would normally be in the PBX on the customer's premises. Wherever it exists, understanding the bridging point is very important in understanding VoIP.