This book will be your companion when working with OpenSIPS using a case study for an Internet Telephony Service Provider (ITSP). With the help of this book, you should be able to build a system that is able to authenticate, route, bill, and monitor VoIP calls. Topics and advanced scenarios such as TCP/TLS support, load balancing, asynchronous processing, and more are discussed in depth in this book. You will create dynamic dialplans, route calls using advanced routing, integrate OpenSIPS with a media server, account calls and generate CDRs, provision the system using a Web GUI, and use tools to monitor and check the health of your server. You will also learn some advanced topics such as support for TLS/TCP and the newest technology called asynchronous callbacks.
By the end of this book, you should be able to build a system that is able to authenticate, route, bill, and monitor VoIP calls. Whenever you are thinking big on telephony, OpenSIPS is your savior and this book is your friend!
Chapter 1, Introduction to SIP, introduces you to the SIP server. You will see how to recognize a SIP request and reply according to RFC 3261, identify the mandatory SIP headers, and describe the SIP routing process for initial and sequential requests.
Chapter 2, Introducing OpenSIPS, shows you how OpenSIPS is used in the market, the basic architecture of the system, use cases, and the main target market.
Chapter 3, Installing OpenSIPS, shows you how to download the OpenSIPS source and its dependencies, compile and install OpenSIPS with MySQL and Radius support, and configure the Linux system to start OpenSIPS at boot time.
Chapter 4, OpenSIPS Language and Routing Concepts, introduces you to the OpenSIPS scripting language and OpenSIPS routing concepts. After reading this chapter, you should be able to recognize the OpenSIPS script language, describe its mains commands, process initial requests, and drop or route requests.
Chapter 5, Subscriber Management, shows you how to manage subscribers in the system using the subscriber, location, group, and address databases. You will learn how to implement a multidomain system that is able to support multitenant implementations.
Chapter 6, OpenSIPS Control Panel, demonstrates how to install a web GUI to help with the provisioning of users, dialplan, routes, and other information that is required to run OpenSIPS. You will see how to install, use, configure, and customize the OpenSIPS control panel.
Chapter 7, Dialplan and Routing, enables you to integrate OpenSIPS with PSTN through gateways, selecting the best gateway, and failing over automatically if a response code is negative.
Chapter 8, Managing Dialogs, shows you how to activate the dialog module, limit the number of simultaneous calls, disconnect hanged calls, impose a maximum duration time for a call, and implement SIP session timers integrated with the dialog module.
Chapter 9, Accounting, demonstrates how account calls generate a CDR (Call Detail Record), account correctly forwarded calls, prevent calls without BYE, and add extra fields to the CDR.
Chapter 10, SIP NAT Traversal, helps you implement an OpenSIPS solution for clients behind NAT. You will see how to implement OpenSIPS in a data center such as Amazon AWS where all the servers are behind NAT.
Chapter 11, Implementing SIP Services, implements services such as call forward, forward on busy, and forward on no answer in cooperation with a media server and SIP phone.
Chapter 12, Monitoring Tools, enables you to detect performance issues using the built-in statistics. These include protocol issues using SIP trace, database issues using the benchmark module, script issues using the script trace, and software and hardware issues using GDB.
Chapter 13, OpenSIPS Security, shows you how to increase the security of your OpenSIPS installation.
Chapter 14, Advanced Topics with OpenSIPS 2.1, covers some advanced topics that can be important for specific installations. Topics such as asynchronous processing, TCP and TLS support, binary replication, and NoSQL integration for clusters are discussed.
All you need for this book is a working installation of OpenSIPS on either Linux or Debian. We will go through the installation of OpenSIPS in detail in this book.
System integrators who need to scale their VoIP projects, universities, and other entities who need to provide large-scale communication systems based on the SIP protocol can make the best use of this book.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "It also contains a parameter called branch
that identifies this transaction."
A block of code is set as follows:
P-Asserted-Identity: "John" sip:[email protected] P-Asserted-Identity: tel:+554833328560
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
if (is_method("INVITE")) {
setflag(ACC_DO); # Do accounting
setflag(ACC_FAILED); # Account failed transactions
}
Any command-line input or output is written as follows:
opensipsctl fifo ps opensipsctl fifo debug 4
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In the following Select your location screen, choose your location to be used in the installation process."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>
, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
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.
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 could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted 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 website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>
, and we will do our best to address the problem.