Summary:ASTERISK-20198: Store hangup cause information on the callee channels in addition to the calling channels
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2012-08-07 14:19:22Date Closed:2012-08-15 12:57:49
Versions:11 Frequency of
Description:Currently, hang up cause information is stored on the calling channel.  Hence, in a parallel dial situations, you have to use the HANGUPCAUSE_KEYS function to get the list of channels that have hangup cause information, and then parse that list and look up each individual channel using the HANGUPCAUSE function.

This is perfectly valid and acceptable.

On the other hand, pre-dial and hangup handlers potentially make this situation much easier.  If the hangup cause information was stored on the callee channels in addition to the calling channel, then a hangup handler could be attached to each callee channel and the information queried there.



exten => borked,1,NoOp()
same => n,Dial(SIP/foo&SIP/bar,10,b(default^set_handler^1))
same => n,Hangup()

exten => set_handler,1,NoOp()
same => n,Set(CHANNEL(hangup_handler_push)=default,outbound_handler,1)
same => n,Return()

exten => outbound_handler,1,NoOp()
; This will get run for both SIP/foo and SIP/bar when each of them
; is hung up.  Ideally, we'd be able to get our own information out
; of HANGUPCAUSE_KEYS... but sadly, no bueno
; HANGUPCAUSE_STRING is an empty string :-(
same => n,Return()

Comments:By: Kinsey Moore (kmoore) 2012-08-13 07:56:59.624-0500

Would you also expect this information to be available on a dialed local channel? (catching further branched dials beyond the local dial)

By: Matt Jordan (mjordan) 2012-08-13 10:08:31.413-0500

I think so.  Obviously if the local channel optimizes away, then whatever is the resulting channel should have that information.

If the local channel doesn't optimize away, I'm not sure how its hang up cause is handled.  I'd assume it would have *something*, however.

By: Kinsey Moore (kmoore) 2012-08-15 12:57:49.602-0500

Local channels will not aggregate hangup cause information on the local channel.  They will only pass it through to the caller channel.  This will be documented on the Who Hung Up? Asterisk 11 wiki page.