Summary:ASTERISK-20676: [patch] ${HANGUPCAUSE_KEYS()} returns nothing if I don't Dial()
Reporter:Mathieu Decaffmeyer (matthewbe)Labels:patch
Date Opened:2012-11-11 18:36:49.000-0600Date Closed:
Versions:11.0.0 13.18.4 Frequency of
Environment:Attachments:( 0) channel.diff
Description:HANGUPCAUSE_KEYS() returns the correct value after a Dial().
But in the other cases, it returns nothing:

In my Hangup Handler:


So if I don't transfer the user with Dial(), and the user will disconnect before I transfer him, there is not any hangup cause available.
Comments:By: Matt Jordan (mjordan) 2012-11-12 08:35:25.700-0600

Can you please attach your entire dialplan illustrating how you are attempting to use the HANGUPCAUSE_KEYS?

By: Mathieu Decaffmeyer (matthewbe) 2012-11-12 09:22:12.489-0600

I simply execute this in the begenning of my dialplan:
same => n,Set(CHANNEL(hangup_handler_push)=subHangUp,s,1)

exten => s,1,Verbose(1, Hangup handler)
same => n,Verbose(1, Asterisk cause of hangup: ${HANGUPCAUSE}) ; prints 0
same => n,Verbose(1, Channels with hangup cause information: ${HANGUPCAUSE_STRING})

I talked about this problem on IRC freenode #asterisk, and other users are experiencing the same thing. But I don't even know if this is normal or if it is an error and that HANGUPCAUSE_KEYS() should indeed return something even if I don't Dial().

By: Matt Jordan (mjordan) 2012-11-12 10:31:21.552-0600

That still doesn't show the dialplan that causes the hangup handler to be executed.  What channel type are you testing with?  How are you hanging up the channel?

Please provide an entire portion of dialplan illustrating the problem and attach it to the issue.

By: Kinsey Moore (kmoore) 2012-12-03 15:04:21.092-0600

Could you test out the patch I have attached to the issue?  I think it should address the issue you're having.

By: Rusty Newton (rnewton) 2013-01-08 12:23:07.932-0600

Does Kinsey's patch address your issue? Can you confirm, or else provide the additional debug requested by Matthew Jordan?

By: Joshua C. Colp (jcolp) 2017-12-19 05:21:42.854-0600

Did you ever try the provided patch?

By: Mathieu Decaffmeyer (matthewbe) 2017-12-19 06:20:59.232-0600

Sorry, this was many years ago. I didn't have the opportunity to test the patch and I am no longer active on that Asterisk project.

By: Joshua C. Colp (jcolp) 2017-12-19 06:47:22.316-0600

[~matthewbe] Understood, I think the issue is still present and since a patch is attached I'll keep this open anyway.