The second step is the compression of the digital audio data using a codec (enCOder/DECoder). The codec inside the ATA reduces the amount of digital data, which enables the voice call to be sent more efficiently over the Internet. The data stream is also divided into packets which contain the audio data as well as information about their destination and place in the data stream.
The third step is the transmission of the data stream over the Internet. VoIP data, like all other data traveling on the Internet, is encapsulated in layers which aid its delivery.
For example, in order for a web page to be displayed, the Internet Protocol (IP) network layer specifies the destination and origin addresses, the Transmission Control Protocol (TCP) transport layer creates a connection between two computers—the one serving the page and the one displaying it—and the Hyper Text Transfer Protocol (HTTP) application layer allows the Web browser to display the web page.
In the case of VoIP data, a transport layer called User Datagram Protocol (UDP) is used to create the connection. It is faster than TCP and more suited to voice. Instead of HTTP, a commonly used VoIP application layer is Real-time Transmission Protocol (RTP), which provides information about the sequence of the data packets so they can be reconstructed in the correct order at their destination.
RTP can also drop packets if they do not arrive within a certain amount of time, which minimizes the delay for the listener receiving the audio stream. If the VoIP software waited for every packet of information to arrive before reassembling it, there would be noticeable and annoying delays in the audio.
The final step in a VoIP call then, is the reconstruction of the packets at the destination. Even though RTP allows for some of the packets to be dropped, there is usually still enough information to make the conversation legible. The number of packets dropped depends on the speed of your Internet connection in the distance between the two parties.
Once the voice data has arrived at its destination, it is reassembled in the correct order and converted back from digital to analog. All this happens within seconds, and usually the person on the receiving end is totally unaware that the call took place over the Internet.
In many cases, a VoIP call only makes part of the journey over the Internet. If the person you are calling is not using VoIP, then the call at some point must transfer to the regular phone network. This transfer takes place at a VoIP gateway, which is a device maintained somewhere in the service provider's network. The gateway is responsible for routing calls between the Internet and the Public Switched Telephone Network (PSTN).

