How does a VoIP Call works? Staring the SIP & RTP protocols
When you dial a number in your fancy VoIP-enabled IP phone and someone talks the only thing the caller cares about is having connectivity. The truth is it is way more complex than an end-user may think. If you are looking forward to starting your own VoIP business, at some point in your planning you will find yourself selecting the right carrier. It could be confusing, everybody assumes you already know what they are selling but that not always happens, furthermore, some sellers invent their own VoIP terms which makes the selection harder than it is.
In this article, we will describe in terms of protocols and concepts what happens when an end-user dials a number. We will assume you (the reader) have some basic networking knowledge; you already know what an IP is?, what is the difference between TCP and UDP connections?, what does SSL/TLS do?, how does a LAN work? and so on.
Normal SIP & RTP Flow
The SIP and RTP protocols present a lot of scenarios where you can interact with them. For starters, we will only explain in this article the big picture where a single caller plugged into a VoIP company X calls a number that results to be a VoIP number and it gets answered by a single extension. The following diagram tries to explain it.
- The caller is just an end-user using the service from some VoIP Company.
- The VoIP Company is just an end-user VoIP company that offers IP Telephony services, in other words, a class-5 PBX service.
- Termination Carrier, like To Connect Me, a provider that offers services to make calls. It is called termination carrier, outbound carrier, or outbound gateway depending on who are you talking to.
- PSTN is the old fashion telephony network.
- Origination Carrier is the company where you rent the DID's (phone numbers) from. Many companies are termination and origination carriers at the same time, but these are different roles.
- Another VoIP Company is the VoIP provider that powers the Callee.
- The callee is the end-user that is receiving the call.
So, what is happening? Let's try to explain.
- Usually, the end-user is registered into the VoIP Company infrastructure with a username and password. It is called extension or SIP credentials. When this given user dials a number, for example, 16138007370, it sends an INVITE signal to the VoIP Company's server.
- The VoIP Company's server may or may not change something on the original request; usually, the caller ID number is altered. After processing it, it forwards it to the Termination Carrier.
- Because of the simplicity of this diagram, we are excluding multiple termination carriers. Termination carriers forward the INVITE among them until it arrives at one that has a direct connection to the PSTN and it is processed there within the old-fashioned telephony network.
- Eventually, if the destination number happens to be a VoIP number, the INVITE will arrive at an origination carrier.
- This origination carrier will know what servers to forward the INVITE and it will be forwarded to another's VoIP company's server.
- That given server will process the call and it will send the INVITE to the right callee. Then the extension will start to ring. If nobody is taking shortcuts, this extension will return a SESSION PROGRESS that will be forwarded back until it arrives at the caller extension. At this time, the only RTP that passes is the ring-tone and it could be generated from the callee's provider or from the caller's provider. This depends on how the caller's providers
Some curious thing about the VoIP:
- The concept of a line (taken from the traditional old-fashioned telephony) doesn't apply. You can have as many incoming or outgoing calls as you want. However, many service providers can control that by tracking the activity. They can cap to one simultaneous call regardless if it is incoming or outgoing. Just to be clear, the VoIP does not have that limit by default.
- VoIP is not limited to numbers, this is a limitation hesitated from the traditional telephony system. VoIP is more like the email system, user, and domain couple.
- SIP and RTP traffic may come from different IP's. This is very common in class 4 PBX's.
- SIP may work on UDP and TCP, clear or with TLS from well-known ports defined by your service provided. RTP runs on UDP and it could be encrypted or not, it runs on a defined port range and the final port is given in the SIP DSP payload.