Book Image

Building Telephony Systems with OpenSIPS Second Edition - Second Edition

By : Flavio E. Goncalves, Bogdan-Andrei Iancu
Book Image

Building Telephony Systems with OpenSIPS Second Edition - Second Edition

By: Flavio E. Goncalves, Bogdan-Andrei Iancu

Overview of this book

OpenSIPS is a multifunctional, multipurpose signalling SIP server. SIP (Session Initiation Protocol) is nowadays the most important VoIP protocol and OpenSIPS is the open source leader in VoIP platforms based on SIP. OpenSIPS is used to set up SIP Proxy servers. The purpose of these servers is to receive, examine, and classify SIP requests. The whole telecommunication industry is changing to an IP environment, and telephony as we know it today will completely change in less than ten years. SIP is the protocol leading this disruptive revolution and it is one of the main protocols on next generation networks. While a VoIP provider is not the only kind of SIP infrastructure created using OpenSIPS, it is certainly one of the most difficult to implement. This book will give you a competitive edge by helping you to create a SIP infrastructure capable of handling tens of thousands of subscribers. Starting with an introduction to SIP and OpenSIPS, you will begin by installing and configuring OpenSIPS. You will be introduced to OpenSIPS Scripting language and OpenSIPS Routing concepts, followed by comprehensive coverage of Subscriber Management. Next, you will learn to install, configure, and customize the OpenSIPS control panel and explore dialplans and routing. You will discover how to manage the dialog module, accounting, NATTraversal, and other new SIP services. The final chapters of the book are dedicated to troubleshooting tools, SIP security, and advanced scenarios including TCP/TLS support, load balancing, asynchronous processing, and more. A fictional VoIP provider is used to explain OpenSIPS and by the end of the book, you will have a simple but complete system to run a VoIP provider.
Table of Contents (21 chapters)
Building Telephony Systems with OpenSIPS Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding the SIP architecture


SIP has borrowed many concepts from the HTTP protocol. It is a text-based protocol and uses the same Digest mechanism for authentication. You will also notice similar error messages such as 404 (Not found) and 301 (Redirect). As a protocol developed by the IETF, it uses an addressing scheme similar to Simple Mail Transfer Protocol (SMTP). The SIP address is just like an e-mail address. Another interesting feature used in SIP proxies are aliases; you can have multiple SIP addresses for a single subscriber such as the following:

In the SIP architecture, there are user agents and servers. SIP uses a peer-to-peer distributed model with a signaling server. The signaling server only handles the SIP signaling, while the user agent clients and servers handle signaling and media. This is depicted in the following figure:

In the traditional SIP model, a user agent, usually a SIP phone, will start communicating with its SIP proxy, seen here as the outgoing proxy (or its home proxy) to send the call using a message known as INVITE.

The outgoing proxy will see that the call is directed to an outside domain. According to RFC 3263, it will seek the DNS server for the address of the target domain and resolve the IP address. Then, the outgoing proxy will forward the call to the SIP proxy responsible for DomainB.

The incoming proxy will query its location table for the IP address of agentB if its address was inserted in the location table by a previous registration process. It will forward the call to agentB.

After receiving the SIP message, agentB will have all the information required to establish an RTP session (usually audio) with agentA sending a 200 OK response. Once agentA receives the response from agentB, a two-way media can be established. A BYE request message can terminate the session.

Here, you can see the main components of the SIP architecture. The entire SIP signaling flows through the SIP proxy server. On the other hand, the media is transported by the RTP protocol and flows directly from one endpoint to another. Some of the components will be briefly explained in the sequence.

In the preceding image, you can see the following components:

  • UAC (User Agent Client): A client or terminal that starts the SIP signaling

  • UAS (User Agent Server): A server that responds to the SIP signaling coming from a UAC

  • UA (User Agent): A logical entity that can act as both UAC or UAS, such as a SIP endpoint (IP phones, ATAs, softphones, and so on)

  • Proxy Server: Receives requests from a UA and transfers to another SIP proxy if this specific terminal is not under its domain

  • Redirect Server: Receives requests and responds to the caller with a message containing data about the destination (302, Moved Temporarily)

  • Registrar Server: Provides the callee's contact addresses to the proxy and redirect servers

The proxy, redirect, and registrar servers are usually available physically in the same computer and software.