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...