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

Implementing call forward on busy or unanswered


This is the second part of this chapter. Now we will introduce a new important concept called failure_route. We will handle the following failure situations:

  • 408—Request Timeout (phone not registered or disconnected)

  • 480—Temporarily Unavailable (no answer)

  • 486—Busy Here

  • 487—Request Cancelled

In order to implement "call forward on busy" and "call forward when unanswered", we will use the concept of failure route. In the logic that follows, we will call the function t_on_failure("1") just before sending the INVITE to the standard processing. This allows us to handle the SIP failure messages (with reply codes higher than 299—also called negative replies).

We could use the same logic used for blind call forwarding—setting an AVP to redirect call forward to a URI pointing to the destination. To simplify, when receiving a call in this situation, we will forward it to a voicemail system. If you want to implement call forwarding to a specific destination...