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

The SIP registration process


The SIP registration process is shown as follows:

The SIP protocol employs a component called Registrar. It is a server that accepts REGISTER requests and saves the information received in these packets on the location server for their managed domains. The SIP protocol has a discovery capacity; in other words, if a user starts a session with another user, the SIP protocol has to discover an existent host where the user can be reached. The discovery process is done (among others) by a Registrar server that receives the request and finds the location to send it. This is based in a location database maintained by the Registrar server per domain. The Registrar server can accept other types of information, not only the client's IP addresses. It can receive other information such as Call Processing Language (CPL) scripts on the server.

Before a telephone can receive calls, it needs to be registered with the location database. In this database, we will have all the phones associated with their respective IP addresses. In our example, you will see the sip user, [email protected], registered with the IP address, 200.180.1.1.

RFC 3665 defines best practices to implement a minimum set of functionalities for a SIP IP communications network. In the following table, the flows are defined according to RFC 3665 for registration transactions. According to RFC 3665, there are five basic flows associated with the process of registering a user agent.

Message flow

Description

A successful new registration: After sending the Register request, the user agent will be challenged against its credentials. We will see this in detail in Chapter 5, Subscriber Management.

An update of the contact list: As it is not a new registration, the message already contains the Digest and a 401 message won't be sent. To change the contact list, the user agent just needs to send a new register message with the new contact in the CONTACT header field.

A request for the current contact list: In this case, the user agent will send the CONTACT header field empty, indicating that the user wishes to query the server for the current contact list. In the 200 OK message, the SIP server will send the current contact list in the CONTACT header field.

The cancellation of a registration: The user agent now sends the message with an EXPIRES header field of 0 and a CONTACT header field configured as * to apply to all the existing contacts.

Unsuccessful Registration: The UAC sends a REGISTER request and receives a 401 Unauthorized Message in exactly the same way as the successful registration. In the sequence, it produces a hash and tries to authenticate. The server, detecting an invalid password, sends a 401 Unauthorized message again. The process will be repeated for the number of retries configured in the UAC.