Detecting who hung up On Dial() when the calling channel is not answered

Hi,

I am using Dial() with A (Play an announcement to the called party, where x is the prompt to be played) and g (Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up) options,

When the called participant hangs up before the announcement is completed, dialplan goes to hangup extension instead of continuing whereas when the announcement is completed and the call is completely connected, it continues the dialplan. Is it possible to change this behaviour?

I need to be able to differentiate if the caller or called party hangs up while the announcement is being read. ${HANGUPCAUSE} is showing 16 in both cases.

Note: a (Immediately answer the calling channel when the called channel answers in all cases. Normally, the calling channel is answered when the called channel answers, but when options such as A() and M() are used, the calling channel is not answered until all actions on the called channel (such as playing an announcement) are completed. This option can be used to answer the calling channel before doing anything on the called channel. You will rarely need to use this option, the default behavior is adequate in most cases.) Option seems relevant. However, I didn’t exactly understand what it does and whether it’ll have a bad side effect.

The bad side effect is that the caller may get billed for a call that never gets bridged to the called party.

My feeling, from your description, is that this is a bug, and ought to be raised as such, with the appropriate supporting information (dialplan, and detailed logging). The bug reporting process has recently changed and I haven’t checked the details.

I doubt whether the early answer option will make a difference. I would expect it simply to determine whether or not AST_CONTROL_ANSWER was sent, not to make major changes in the internal state of Dial().

1 Like

There is functionality for getting information on who hung up[1]. Whether it works for this in particular, I do not know.

[1] Hangup Cause - Asterisk Project - Asterisk Project Wiki

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.