mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Hangup handlers - Dialplan subroutines that run when the channel hangs up.
Hangup handlers are an alternative to the h extension. They can be used in addition to the h extension. The idea is to attach a Gosub routine to a channel that will execute when the call hangs up. Whereas which h extension gets executed depends on the location of dialplan execution when the call hangs up, hangup handlers are attached to the call channel. You can attach multiple handlers that will execute in the order of most recently added first. (closes issue ASTERISK-19549) Reported by: Mark Murawski Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2002/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -313,6 +313,16 @@ int ast_autoservice_stop(struct ast_channel *chan)
|
||||
return res;
|
||||
}
|
||||
|
||||
void ast_autoservice_chan_hangup_peer(struct ast_channel *chan, struct ast_channel *peer)
|
||||
{
|
||||
if (chan && !ast_autoservice_start(chan)) {
|
||||
ast_hangup(peer);
|
||||
ast_autoservice_stop(chan);
|
||||
} else {
|
||||
ast_hangup(peer);
|
||||
}
|
||||
}
|
||||
|
||||
int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
|
||||
{
|
||||
struct asent *as;
|
||||
|
Reference in New Issue
Block a user