VoIP

Introduction

OpenSER vs. SER

FXO or FXS?: An FXS goes into an FXO (Mmm...)

O'Reilly's Switching to VoIP:

"In IP telephony, call management and signaling can be separated from voice transmission. In a VoIP environment, the core is mainly used to move data back and forth, and the programmatic functionality of voice applications exists in a distributed model of peers: VoIP servers and endpoints. These peers can reside anywhere on the edge and offer new and changing features, without requiring changes at the core.

A single VoIP server can act as a PSTN gateway for IP phones on Ethernet segments located at remote offices, as long as WAN connectivity exists between them.

http://nerdvittles.com (100 Great Springtime Projects For You & Your Free Asterisk@Home PBX, ISP-In-A-Box: Installing a Free Asterisk PBX Phone System)

Phone Home Revisited: Getting Remote Dialtone With Asterisk – Three Great Solutions

"With a traditional PBX, voice transmission and call management are dependent upon a route through the voice switch. In IP telephony, call management and signaling can be separated from voice transmission"

"La MOB-BOX permet d'utiliser sa ligne fixe à distance, depuis son téléphone portable. En insérant une carte SIM du même opérateur que le sien dans la MOB-BOX et en reliant la MOB-BOX à sa ligne téléphonique fixe, la MOB-BOX crée une passerelle GSM vers sa ligne fixe. En appelant le numéro (de la carte SIM) de la MOB-BOX, on obtient la tonalité de sa ligne fixe. Sachant que tous les opérateurs GSM proposent d'appeler jusqu'à 3 numéros du même réseau en illimité 24h/24h, on comprend rapidement que cette passerelle peut être complètement gratuite."

SIP

"SIP is a simple, text-based description protocol that uses interactions similar to HTTP and SMTP in order for two systems to describe a media stream that needs to get from point A to point B. The description includes authentication, caller ID information, media stream parameters, and a variety of other header information that is needed to fully qualify a call between two endpoints." (from Asterisk - A Bare-Bones VoIP Example)

How SIP works

Here's how things work when using a softphone (SIP) to call someone over his regular phone, either landline or cell. A subscription to a ToIP provider is required before having access to this type of service :

  1. The softphone connects through the Net to the provider's Media Gateway Controller (MGC) using the SIP protocol to register its IP adress and be authenticated (The MGC also includes the subscriber's public phone # so he can be called by a regular phone, either landline or cell)
  2. The MGC checks that the caller has sufficient rights (flat rate, credits, etc.) to call that number
  3. The MGC chooses the best route to that number based on QoS (Quality of Service) and availability; Routing is usually done in IP for internation calls and SS7 for POTS connections
  4. The POTS operator routes the call demand to the callee phone line
  5. When the callee gets in line, the signal is sent back all the way to the softphone, which creates a session
  6. The ToIP provider starts metering the call
  7. The caller's voice is compressed by the softphone using a specific codec (G.729), and sent to the Media Gateway (MG)
  8. The MG decompresses the voice packets and turns it back into analog voice using a specialized DSP (G.711), before routing this voice data to the POTS operator. Data between the softphone and the ToIP provider is usually transported using the RealTime Protocol (RTP), but it can also use a sub-set of the H.323 protocol or MGCP protocol
  9. Once the caller hangs up, his softphone sends an SIP signal to the gateway, which tells the POTS operator to generate an end-of-call signal down the POTS line
  10. The SIP and RPT sessions betwen the softphone and the ToIP provider are closed

An SIP registration server lets (soft)phones register with their SIP server so it knows that they're available, and, if they're using dynamic IP's, where to reach them. An SIP proxy server handles call establishment and call termination between parties; Once the call is established, voice data is handled by RTP, but the SIP server may listen in on the conversation so as to be available to provide mid-call features like conferencing services, or accounting.

RTP

"Real-time Transport Protocol (RTP) is utilized in addition to a User Datagram Protocol (UDP)/IP header to provide timestamping. RTP runs atop UDP and IP and is commonly noted as RTP/UDP/IP. RTP is currently the cornerstone for carrying real-time traffic across IP networks. (Microsoft Netmeeting, for instance, utilizes RTP to carry audio and video communications.) To date, all VoIP signaling protocols utilize RTP/UDP/IP as their transport mechanism for voice traffic. Often, RTP packet flows are known as RTP streams. This nomenclature is used to describe the audio path. The RTP stream is also often referred to as the media stream. Therefore, you can use IP in conjunction with UDP and RTP to replace a traditional 64-kbps voice circuit.

RTP has a field that stamps the exact time the packet was sent (in relation to the entire RTP stream). This information is known as RTP timestamps and is used by the device terminating/receiving the audio flow. The receiving device uses the RTP timestamps to determine when a packet was expected, whether the packet was in order, and whether it was received when expected. All this information helps the receiving station determine how to tune its own settings to mask any potential network problems such as delay, jitter, and packet loss. "

NAT

If the NAT firewall standing in the way between a remote SIP client and the Net is asymetric, STUN should work. If the NAT is symmetric, it won't, and you'll need to investigate other solutions:

There a few open-source STUN tools:

IAX-capable phones

Hardphones

Softphones

ENUM

"ENUM is an IETF standard (RFC 2916) for mapping the public telephone number address space into the Domain Name System (DNS)."

Jitter

"Jitter is the variation of interpacket arrival time, or the difference between when a packet is supposed to be received and when it is actually received."

Call Control

"Call-control, in a nutshell, is the process of making needs to go and somehow making the call happen. VoIP call-control protocols all solve a similar problem — phone numbering to IP address translation; however, they might all be used for slightly different purposes. For instance, currently H.323 is the most widely deployed VoIP call-control protocol. H.323, however, is not widely seen as a protocol that is robust enough for PSTN networks. For these networks, other protocols such as Media Gateway Control Protocol (MGCP) and Session Initiation Protocol (SIP) are being developed."

SIP Proxy

"There are several SIP implementations that are OSS, but they are primarily what are known as "call proxies" instead of more full-featured PBX applications. This means that they function only to connect two endpoints together, and are basically just large, fast, directory servers. Examples of SIP Proxies are ser and Vocal. There are also other open source PBX projects like Bayonne and OpenPBX, which have slightly different feature sets than Asterisk."

Asterisk vs. sipX vs. SER?

STUN

Simple Traversal of UDP Through NATs (STUN)

Soft- and Hardphones

SBC

Session Border Controller : "A Session Border Controller (SBC) is a device used in some VoIP networks. SBCs are put into the signaling and media path between calling and called party. The SBC acts as if it was the called VoIP phone and places a second call to the called party. The effect of this behaviour is that not only the signaling traffic, but also the media traffic (voice, video etc) crosses the SBC. Without an SBC, the media traffic travels directly between the VoIP phones. Private SBCs are used along with firewalls to enable VoIP calls to and from a protected enterprise network. Public VoIP service providers use SBCs to allow the use of VoIP protocols from private networks with internet connections using NAT.

Additionally, some SBCs can also allow VoIP calls to be set up between two phones using different VoIP signaling protocols ( SIP, H.323, Megaco/MGCP, etc...) as well as performing transcoding of the media stream when different codecs are in use. Many SBCs also provide firewall features for VoIP traffic (denial of service protection, call filtering, bandwidth management, etc...). The concept of the SBC is controversial to proponents of end-to-end systems and peer-to-peer networking."

Session Initiation Protocol "SIP is an alternative protocol to H.323 - the IP videoconference transmissions protocol that's been in use since its approval in 1996. Up until now, H.323 has been the VoIP industry standard, but its leadership has been questioned by the wide implementation of SIP in the past year(s).";

http://www.sipcenter.com/sip.nsf/html/What+Is+SIP+Introduction "SIP is a request-response protocol that closely resembles two other Internet protocols, HTTP and SMTP.[...] SIP's main purpose is to help session originators deliver invitations to potential session participants wherever they may be."

"SIP provides four basic functions:

"SIP depends on the Session Description Protocol (SDP) for carrying out the negotiation for codec identification.

The SIP hosts are identified by a SIP URL which is of the form sip:username@host. A SIP address can either designate an individual or a whole group. The client can either send the request to a SIP proxy server or it can send it directly to the IP address and port corresponding to the Uniform Request Identifier (URI).

Here a basic example of a SIP operation is given where a client is inviting a participant for a call. A SIP client creates an INVITE message for arora.32@osu.edu., which is normally sent to a proxy server. This proxy server tries to obtain the IP address of the SIP server that handles requests for the requested domain. The proxy server consults a Location Server to determine this next hop server. The Location server is a non SIP server that stores information about the next hop servers for different users. On getting the IP address of the next hop server, the proxy server forwards the INVITE to the next hop server. After the User Agent Server (UAS) has been reached, it sends a response back to the proxy server. The proxy server in-turn sends back a response to the client. The client then confirms that it has received the reponse by sending an ACK. The exchange of messages is shown in the figure below (Fig 3). In this case, we had assumed that the client's INVITE request was forwarded to the proxy server. However, if it had been forwarded to a redirect server, then the redirect server returns the IP address of the next hop server to the client.The client then directly communicates with the UAS.

SIP works in conjunction with RSVP (Resource Reservation Protocol), RTP/RTCP (Real-time Transport Protocol), RTSP (Real-time Streaming Protocol), SAP(Session Announcement Protocol) and SDP (Session Description Protocol). RTP/RTCP is used for transporting real time data, RSVP for reserving resources, RTSP for controlled delivery of streams, SAP for advertising multimedia sessions and SDP for describing multimedia sessions.

The present day voice gateways usually compose of two parts: the signaling gateway and the media gateway. The signaling gateway communicates with the media gateway using MGCP (Media Gateway Access Protocol). MGCP can interoperate with both SIP and H.323."

Line vs. trunk

Lines and trunks are links between telephony devices. A line is a link from a switch to a phone. A trunk is a link from a switch to a switch.

VoIP vs. ToIP?

ATA

analog telephone adapter (ATA)

(Not every phone supports every possible dialing plan, so consider this as a potential decision point when selecting your final phone.)

softphone "c'est un logiciel qui assure toutes les fonctions téléphoniques et qui utilise la carte son et le micro du PC de l'utilisateur, et aussi la carte ethernet du PC"

IAX

"IAX [pronounced "eeks" by those in the know] is the Inter-Asterisk eXchange protocol used by Asterisk, an open source PBX server from Digium. It is used to enable VoIP connections between Asterisk servers, and between servers and clients that also use the IAX protocol. IAX now most commonly refers to IAX2, the second version of the IAX protocol. The original IAX protocol has been deprecated almost universally in favor of IAX2."

SIPFoundry

"The mission of SIPfoundry, a Massachusetts-based non-profit organization, is dedicated to the development and adoption of open source Session Initiation Protocol (SIP)-based communication solutions.

SIPfoundry’s projects focus on all aspects of IP communications encompassing user agent solutions (SIP UA SDK, softphone clients, and codecs), Enterprise solutions (complete SIP IP PBX, presence, proxy, and media server solutions), carrier solutions (SIP proxy and presence solutions) as well as SIP interoperability testing solutions and activities. SIPfoundry is also the place where the development of sipX - The Open Source SIP PBX for Linux, takes place"

Glossary

FXO

Foreign Exchange Office; Used to connect a PBX to the telephone network.

FXS

Foreign eXchange Station; Used to connect a telephone to a PBX.

Q&A

What's the difference between a UAS and a B2BUA?

"The B2BUA is a SIP call controlling component. Unlike a SIP proxy server, which only maintains transaction state, the B2BUA maintains complete call state and participates in all call requests. For this reason it can perform number of functions that are not possible to implement using SIP proxy, such as for example accurate call accounting, pre-paid rating and billing, fail over call routing etc.

Unlike PBX-type solutions such as Asterisk for example, the B2BUA doesn't perform any media relaying or processing, therefore it doesn't introduce any additional packet loss, delay or jitter into the media path." (source)

I'm having severe echo problems with a POTS line

(from asterisk-users@lists.digium.com) "In the US, the spa3k has echo problems with pstn lines that are somewhat long, and with pstn lines that are based on some central office remote line concentrators.  The spa3k seems to work fairly well on short pstn lines, but I've not tried to figure out exactly how long a pstn must be before echo becomes a problem. [...] I gave up on the Sipura/Linksys SPA-3000's as well as the Digium TDM400, and installed a Sangoma A200d. That has been providing excellent audio and echo cancellation for roughly six months."

Why choose SIP vs. Asterisk's IAX(2)?

IAX versus SIP

"Probably the biggest technical hurdle SIP has to conquer is the challenge of carrying out transactions across a NAT layer. Because SIP encapsulates addressing information in its data frames, and NAT happens at a lower network layer, the addressing information is not modified, and thus the media streams will not have the correct addressing information needed to complete the connection when NAT is in place. In addition to this, the firewalls normally integrated with NAT will not consider the incoming media stream to be part of the SIP transaction, and will block the connection."

Resources