I have a custom destination we use to speak some information to our customers before transferring the caller to our Avaya box to progress. There is a desire to know if this process fails because the transfer to number is formulaic (not static) based on the the dnid. This could lead to a failed transfer without us knowing.
A way to know if there is an issue, I was thinking, was to alert us if the Hang Up Cause is not equal to 16. My problem with that is I wont know the Hang Up Cause until after the transfer (and script) are finished.
Any ideas on how I can do something like setup an email if hang up cause <> 16? OR does anyone have an alternative ideas to accomplish the same result (alert on failed transfer)?
Add a hangup hander the channel which checks hangup cause and sends notifications. See the part of this post about “How do I perform a custom action on hangup?” for basic concept.
The hangup handler would be attached to the asterisk channel and will reflect the hangup status for that channel. I don’t know if you could work with that or not.
As I recall it transfer failures are indicated by a specific channel variable and the lack of a hangup, not by a specific type of hangup. In any case SIP hangups on established calls aren’t required to provide a reason code. (Transfers on unanswered calls are final; any failure is only signalled to the transferee.)