About VoIP

From Yate Documentation
Jump to: navigation, search

VoIP is an acronym that stands for Voice Over Internet Protocol, or, as the common user would name it, phone service over the Internet. It is a technique that brings communications at another level, allowing you to use an Internet broad-band connection to make calls instead of using Plain Old Telephony System (POTS). Service providers may allow you to call only the persons that are under the same network and some may allow you to make a call to anyone who has a analog or digital telephone line, no matter if we are talking about a local, long distance, mobile or international call.

There are two ways of using this technology: either by replacing your old phone with a new one that supports VoIP or by using an adaptor to connect the present phone to the VoIP network. No matter what solution you consider, there is also the possibility to disconnect it from the present network and making a new contract with the VoIP service provider or to keep them both. We will see later why anyone would choose an option or the other. VoIP converts the voice signal into digital signal that goes through the Internet until it reaches the called party. Then it is reconverted and outputs into the telephone as normal voice. This is convenient because you can speak using a telephone. The need of replacing the telephone with another type of hardware does not exist.


Why use VoIP?

This is the first question that comes when migrating to another service. The main advantages of using this new technology are:

  • lower costs
  • increased functionality.

Lower costs

But how low are the costs? It depends on the provider that you choose. There are different ways of charging. In some cases, phone calls are free within the local network. This is used when a provider already has the network system (e.g. is a Internet ISP) and the overall consumption of the bandwidth supports this feature. Notice that a local network it is not defined by a geographical area, but rather by your options. To explain this better, I will use an example: let’s say you belong to the X VoIP provider’s network. But you go in vacation somewhere else, possibly in another country. If you have an Internet connection, all people calling you from your city will not be charged and all the people you call and are in the city too. Another way you could be charged is a monthly flat fee that also may include free minutes in your network, another network or with some telephone numbers. You don’t have to use a telephone to speak over the Internet. An alternative is a headset and a microphone plugged into your computer and specialized software.

Increased functionality

The telephone only needs an Internet connection to work. This means that you can take the phone anywhere with you and still be able to make and receive calls. You may also have some advantages like saving a conversation to listen later, check the availability of a person. Because VoIP’s functionality is software, it depends on protocols and therefore can be easily changed or updated without the need of purchasing a new hardware every time you want a new service.

You will have an idea of how IP telephony works after reading the following example. Let’s assume that George wants to call Mary. They are subscribers of the same telephony network. George’s phone has the address and Mary’s These are the IP addresses and every phone of the two knows about each others address. George picks up the phone and calls Mary, as usual by dialing her number. Mary’s phone starts ringing and, when she answers, her telephone sends a connect message to George’s phone. Once the connection has been established, packets containing data (voice) are sent from one phone to the other. When they are finished talking, George puts down the phone. In that moment, a disconnect message is sent to Mary’s phone which responds with a release message. This is the basic idea of a VoIP phone call. Of course, things are a little more complicated when a gatekeeper is used, or the users calling are not in the same network as the ones that they call. But there is nothing to worry. It is all being taken care of by the data network, that is the Internet and by the service provider. For a typical user, things will work this way every time you make a call.

IP telephony is also known as packet-switched telephony. Instead of the normal circuit-switched voice lines used in analogue connections, VoIP packets are sent from phone to phone. In the Internet, packages may not come in the same order that they are sent, but they are numbered, helping the application to easily reconstruct the message. But in voice and video calls this is very important. Messages have to come in the same order or at least the section that handles the reconstruction of package order has to work in real-time. This can cause an effect called increased latency. For this not to happen special protocols for VoIP have been developed. These are used to carry data over the Internet, handle the way the two terminals understand and communicate with each other. Although these protocols help, the latency problem still remains. In networks with 256kps or more bandwidth, there is no problem, but if you have less it is very difficult to ensure minimum latency and time order of the packets. VoIP is designed to totally replace PSTN (Public Switched Telephony Network). Originally, these lines were analogue, nowadays they are almost entirely digital.

VoIP protocols

The PSTN is designed after a lot of standards. This applies to VoIP protocols as well. Below you will find a list with the most common protocols:

  • H.323
  • SIP (Session Initiation Protocol)
  • Megaco (H.248) and MGCP (Media Gateway Control Protocol)
  • Skinny Client Control Protocol
  • MiNET
  • IAX
  • Skype

Network reliability

Another issue about VoIP is its’ reliability. A normal PSTN telephone is powered by the phone company. In case you need to make an urgent call and the power in your home is down you could make a phone call without any problems. This is not the case of VoIP. Usually separated power sources are not provided, so, when the power fails, your telephone will stop, too. Also, if the network congestion happens to very high at some time packets will be lost and this will a cause a momentary voice-drop. If you are in a network with a small bandwidth that is highly used, you may consider upgrading it.

The integration with the global numbers format is not an obligation. Some providers may give local numbers to the users. This is a bad thing because you might not be able to receive or make calls outside your network.

Using a pure VoIP network would bring some more advantages: Web, instant messaging, email, presence and video conferencing. Companies, in order to reduce costs, can also buy their own gateways, which, in some situations, is worth it.

Pro's and Con's of using VoIP

As VoIP rapidly extends, it now offers:

  • a simple setup and use (almost the same as with old phones)
  • voice storage (you can save your conversations and replay them any time you want, check voice mail.

Some of the risks that come with this technology are:

  • theft: this includes also taking control of a server and listening to private stored conversations or even conversations taking place at that moment and also making phone calls from a number registered to that server.
  • A new way of promoting products through telephone could became more popular. It may lead to system overhead if too many products are being promoted at a time.
  • There is also the danger of someone stealing your number and making a call that was suppose to come from a trusted source to obtain some secret information.

How to protect yourself from all these possible attacks?

  • The use of a junction-box. This is a hardware equipment that allows VoIP to come directly to your phone, without the need of a computer.
  • Keep the passwords as private and as complicated as possible. This way it will be very hard for someone to find out the password and steal your number/stored conversations
  • If you do use a computer to connect to VoIP, make sure it is well guarded against attacks of any kind by purchasing and installing antivirus, firewalls and spyware programs.

Typical setups and applications


A typical session border controller is used to overcome some of the problems that may appear in a VoIP communication by integrating it between the caller and the called parties signaling path. For more information about SBC please see http://en.wikipedia.org/wiki/Session_border_controller.

In order to use Yate as a SBC please see this page.

SIP registration server

The registration server’s functionality typically stands in setting up and tearing down functionality with a client by using the registration and invite requests as well as clearing and retrieving registrations from a SIP url.

The Session Initiation Protocol provides a REGISTER functionality that is used mainly in a proxy configuration case. For what reason? The answer is quite simple. It’s about locating individual users in case of a call, which is similar to an INVITE message sent to the server.

The actual registration of a SIP user agent on a registration server is made using a pretty simple message flow.

By changing some fields in the message the registration cancelling is performed. Also interrogation of the server to identify contacts associated with a SIP url are made in the same way.

To use Yate as a SIP registration server please see this page.

Yate as H323 GateKeeper and YateClient as H323 client

H323 is composed from an entire suite of protocols. The exact definition of H323 states that H323 is a recommendation published by the International Telecommunications Union (ITU) defining the internetworking of elements and protocols with the purpose of multimedia communications over an unreliable packet-based network.

The elements of an H323 system are as follows:

  • Terminals: A H323 Terminal can be any of a telephone, videophone, IVR device or other kind of endpoint inside a network, which can communicate with another endpoint or with a Multipoint Control Unit or with a Gateway using various types of media ranging from audio to video or other data.
  • Multipoint Control Units: Yate acting like a multiple endpoint server resembles such an element. A Multipoint Control Unit provides services needed by more endpoints to take part in a conference call. This is done through a Multipoint Controller that manages the call signaling. Optional Multipoint Processors can be present to handle the various media types exchange and processing during a conference.
  • Gateways: The main purpose of the gateway is to make possible the protocol conversion between the endpoints that support H323 and the endpoints that use other protocols for VoIP communication including interfacing to PSTN. Typically a H323 gateway is formed from a Media Gateway for media handling and a Media Gateway Controller for call signaling and other functions.
  • Gatekeepers: a gatekeeper's use is actually to “guard” a network area. Yate acts like a H323 Gatekeeper providing basic admission control by permitting or denying communication between different endpoints in its zone of control. It also provides an address resolution service. A gatekeeper manages calls in the way that permits them to be placed directly between terminals or routes the signaling through it to perform different kinds of functions like follow me, find me, forward on busy and others. There are also gatekeepers that integrate proxy solutions.

The protocols that H323 unites under its specifications vary from G.7xx codecs to various others descriptions. The most important protocols comprised under the H323 specifications are:

  • H225 protocol which in fact parts itself in three specifications more exactly RAS – Registration, Admission and Status, Call Signaling and Text Telephony. This has a direct relation with a gatekeeper – component which Yate is used as, more exactly specifies the modes by which an endpoint can register through the gatekeeper and be allowed to pass it to reach the network.
  • H245 is multimedia control protocol used between endpoints to establish the channels for media transmission.
  • RTP and RTCP are the protocols concerned with the media transport
  • Q931 is the call signaling protocol for ISDN networks. The information included in the H225 data which also like stated is concerned with call signaling is used to complete the info carried by Q931 messages which is missing certain important things for a H323 transmission like the IP address.

Call center server

A call center server redirects callers to the resources that are best equipped to satisfy their needs like a receptionist who transfers your call to some specific department inside an institution. Inside a typical call center server this routing can be done automatically based on various combinations defined using callers’ profiles or other information.

Besides this call processing following predefined rules a call center server can register and analyze the incoming and outgoing calls using the information in various purposes.

To use this functionality in Yate see the Yate as a PBX article and the routing section.

IVR - Interactive voice response

One easy way to explain what IVR stands for, would be to think at one common mobile telephony service. One like those when you call a short number to activate your international calls for example and you are answered by a nice (or not) voice which tells you: “Press 1 for english… Press 2 for this… Press 3 for that… etc, etc”. And when you press the x key you are redirected to the service you desire or, if you are unlucky, to another “Press 1 for.. “. This is a simple example of Interactive Voice Response, but IVRS can imply more than this.

Like you probably figured by now IVR software provides an automated response to a call. Every day life examples includine:

  • for your mobile connection provider support issues
  • for checking account balances
  • for ordering something, etc.

It would be impossible for a large company to answer every call in one of the above cases, so IVR represents a practical solution not needing a operator to answer the phone from ten to ten seconds. IVR can be either based on touch tone or speech recognition so instead of pressing the x key on your phone you may simple tell “x” or other predefined command which is at your disposal to get what service you desire. The IVR concept can be used in more complex applications integrating databases, speech recognition and others.

You can develop IVR's in Yate using the PHP and Python libraries.

Yate as IAX server and YateClient as IAX client

IAX is a signaling and media protocol. It operates in peer-to-peer mode, meaning that the connection is made between the two endpoints that are responsible for the protocol operations. When it was designed, the people working on it had the following main purposes: minimize bandwidth usage for control and for media and make it work behind NAT (Network Address Translation). NAT is the process in which an address is passing through a server or firewall that rewrites it. Usually, it is used for multiple computers across a network to share the same Internet connection, using only one public IP. As packets come to the server, it automatically rewrites the private address of each computer to the public IP, also keeping pieces of information about every packet.

IAX is a full-featured protocol and yet easy to implement. It works with any codec and any number of streams. This is a very powerful attribute, as it means it can be used as a transport for any type of data. Communication between endpoints takes place on port 4569, using a single UDP data stream. UDP is used for both signaling and data. Using in-band transmission it is possible for IAX to cross through firewalls and over NAT servers. IAX multiplexes the single UDP connection over multiple media streams. It is a binary protocol and designed in such a way to eliminate as much as possible the overhead especially for voice streams.

One advantage of IAX is that it supports trunking. In computer networking, this word means that multiple cables/wires/ports are being used in parallel to achieve faster speeds than with only one cable or port. Data from multiple calls is considered as a single set of packets, resulting in one IP datagram to carry data from more than one call. This reduces overhead a lot and does not create external unneeded latency. Considering the fact that IP overhead is a large part of the total bandwidth, this is a great improvement.

Please follow the following article to see How to configure Yate as IAX server.

Prepaid and postpaid cards system

  • Prepaid refers to the fact that you have to first buy the card and then you call a secret number mentioned on the card. This number is used to activate your card. The server remembers what is your account state (how much money you have left, how many calls and to whom they were made, etc.) and allows users that have a positive money account to make calls.
  • Postpaid cards work the same way, but the client is billed on a regular basis (e.g. monthly). In this case, all the server has to do is make sure you are a registered client and check monthly if your bills have been paid.

Please see this article for an overview on how to build such a service with Yate.

VoIP-PSTN gateway

A gateway is a device used for connecting two different types of networks. In this case, one network is the VoIP network and the other the PSTN. The gateway’s main task is to provide signaling interworking and to transform the information it receives on one side in information compatible with the other side. A gateway can consist of only one piece or it can be distributed into more components. These are:

  • a Signaling Gateway - provides transparent interworking of signaling between switched circuit, in this case, PSTN, and the VoIP networks
  • a Media Gateway - is responsible for extracting audio from the PSTN network, encode it and transport it over the Internet. This component carries the data
  • a Media Gateway Controller - is used for controlling the call. It is also known as “Call Agent”.

To see how to use this functionality in Yate follow this article.

See also:

Personal tools