Book Image

Building Telephony Systems with OpenSER

Book Image

Building Telephony Systems with OpenSER

Overview of this book

Table of Contents (18 chapters)
Building Telephony Systems with OpenSER
Credits
About the Author
About the Reviewers
Preface
6
Building the User Portal with SerMyAdmin
Index

Implementing Call Forward on Busy or nanswered


This is the second part of this chapter. Now we will introduce two new important concepts. The first one is the failure_route and the second one is the append_branch used to fork the call. We will handle the following failure situations:

  • 408 – Timeout

  • 486 – Busy Here

  • 487 – Request Cancelled

To implement call forward on busy and call forward when unanswered, we will use the concept of the failure route.

In the logic below, just before sending the INVITE to the standard processing we will call the function t_on_failure("1"). This allows us to handle the SIP failure messages (with reply codes higher than 299, also called negative replies) in failure_route[1].

When receiving a call in this situation we will forward it to a voicemail system. Asterisk can make a good voicemail system. Let's see how to integrate Asterisk to record the voicemail messages. We will prefix the URI with b (busy) to inform the Asterisk server to play the busy message and u (unanswered...