Book Image

Building Telephony Systems with OpenSIPS 1.6

By : Flavio E. Goncalves
Book Image

Building Telephony Systems with OpenSIPS 1.6

By: Flavio E. Goncalves

Overview of this book

<p>SIP is the most important VoIP protocol and OpenSIPS is clearly the open source leader in VoIP platforms based on pure SIP. The whole telecommunication industry is changing to an IP environment, and telephony in the way we know today will disappear 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.<br /><br />This book will give you a competitive edge by helping you to create a SIP infrastructure capable of handling tens of thousands of subscribers. You can extend the examples given in this book easily to other applications such as a SIP router, load balancing, IP PBX, and Hosted PBX as well. This book is an update of the title Building Telephony Systems with OpenSER.<br /><br />The book starts with the simplest configuration and evolves chapter by chapter teaching you how to add new features and modules. It will first teach you the basic concepts of SIP and SIP routing. Then, you will start applying the theory by installing OpenSIPS and creating the configuration file. You will learn about features such as authentication, PSTN connectivity, user portals, media server integration, billing, NAT traversal, and monitoring. The book uses a fictional VoIP provider to explain OpenSIPS. The idea is to have a simple but complete running VoIP provider by the end of the book.&nbsp;</p>
Table of Contents (17 chapters)
Building Telephony Systems with OpenSIPS 1.6
Credits
About the Author
About the Reviewers
Preface
Index

Preface

This book starts with the simplest configuration and evolves chapter by chapter, teaching you how to add new features and modules. It will first teach you the basic concepts of SIP and SIP routing. Then you will start applying the theory by installing OpenSIPS and creating the configuration file. You will learn about features such as authentication, PSTN connectivity, user portals, media server integration, billing, NAT traversal, and monitoring. The book uses a metaphor of a VoIP provider to explain OpenSIPS. The idea is to have a simple but complete running VoIP provider by the end of the book.

What this book covers

Chapter 1, Introduction to SIP teaches you the SIP protocol and its functionality along with SIP components, the SIP architecture and describes its main messages and processes.

Chapter 2, Introduction to OpenSIPS explains about OpenSIPS and its main characteristics and features. You will see the configuration file, its modules, the configuration blocks, and so forth.

Chapter 3, OpenSIPS Installation shows you how to install and prepare Linux for installing OpenSIPS with RADIUS and MySQL modules and getting started with OpenSIPS.

Chapter 4, Scripting and Routing Basics discusses the basics needed to construct a working routing script. It explains the global configuration parameters for scripting, the modules, and the routing statements available.

Chapter 5, Adding Authentication with MySQL teaches you how to integrate MySQL with OpenSIPS to authenticate users and handle inbound and outbound calls.

Chapter 6, Graphical User Interfaces for OpenSIPS explains the need for user and administration portals. It will teach you how to configure access, handle domains, and customize portals.

Chapter 7, Connectivity to PSTN teaches you how to connect SIP gateways with PSTN, build dynamic dialplans, and apply permissions.

Chapter 8, Media Services Integration teaches you how to connect OpenSIPS to external media servers for implementing user preferences like call forwarding, and integrating databases for simplified administration.

Chapter 9, SIP NAT Traversal describes various NAT types and devices. Here we will learn how to implement the Media Proxy solution to solve the NAT traversal problem.

Chapter 10, OpenSIPS Accounting and Billing teaches you how to implement the accounting feature with MySQL and RADIUS.

Chapter 11, Monitoring Tools discusses how to use built-in monitoring tools and implement testing techniques for OpenSIPS.

Who this book is for

This book targets readers who want to understand how to build a SIP provider from scratch using OpenSIPS. It is suitable for VoIP providers, large enterprises, and universities.

Our objective of writing this book is to take the user from the basics up to the level required to run an OpenSIPS server in a VoIP provider, in an enterprise. Some interesting topics have not been covered. This is because we consider them to be a bit advanced for an introductory book. We hope to cover them soon in another title to be announced.

Telephony and Linux experience will be helpful but is not essential. Readers need not have prior knowledge of OpenSIPS. This book will also help readers who were using OpenSER, but are now confused with OpenSIPS.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "You have to use www_authorize when your server is the endpoint of the request."A block of code is set as follows:

if (is_method("REGISTER")) { 
# Uncomment this if you want to use digest authentication 
if (!www_authorize("", "subscriber")) { 
www_challenge("", "0"); 
exit; 
}; 
save("location"); 
};

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/serMyAdmin">
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/opensips_MySQL" type="javax.sql.DataSource"
  url="jdbc:mysql://localhost:3306/opensips" username="opensips" password="opensipsrw"/>
</Context>

Any command-line input or output is written as follows:

tar –xzvf sermyadmin-install-2.x.tar.gz

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Now, choose Finish partitioning and write changes to disk".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/0745_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or web site name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.