Handling Call Disconnection with Dial and Park in Asterisk: How to Differentiate Caller vs. Callee Disconnect?

I am currently working on implementing a feature using the Dial command with the g option to determine whether the caller or the callee has disconnected. Everything works fine in most cases, but I encountered an issue when the channel that initiated the call performs a Park. In this scenario, it is interpreted as the other party disconnecting, and the post-Dial processing proceeds.

I believe that if a Park is performed by the caller, it should be treated as a disconnect by the caller, and no further processing should occur after the Dial, even with the g option set.

However, assuming this is the intended behavior, is there any way to determine who actually disconnected when a Park is performed?
For example, is there a way to set a custom context before parking the call to differentiate this scenario?
Alternatively, is there any variable that could indicate whether the call was parked or disconnected within the h extension?

[featuremap]
parkcall => *9

I want to determine whether a channel was hung up because it was placed in Park during the h extension processing.

I considered using the ParkerDialString from the AMI ParkedCall event to flag the channel, as mentioned in the documentation: AMI ParkedCall Event. However, since this string is not the channel name, I couldn’t assign a variable to the channel.

Does anyone have a good method to achieve this?

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