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:
Richard Mudgett
2012-06-29 17:02:32 +00:00
parent 35c533156c
commit ac35b92b62
14 changed files with 628 additions and 183 deletions

View File

@@ -1490,7 +1490,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
res = ast_channel_make_compatible(caller, outbound);
if (res < 0) {
ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(caller), ast_channel_name(outbound));
ast_hangup(outbound);
ast_autoservice_chan_hangup_peer(caller, outbound);
goto outrun;
}
@@ -1513,7 +1513,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
}
res = ast_bridge_call(caller, outbound, &config);
ast_hangup(outbound);
ast_autoservice_chan_hangup_peer(caller, outbound);
}
outrun: