diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-06-29 17:02:32 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-06-29 17:02:32 +0000 |
commit | ac35b92b628064a1fcf962895f0befd57aff0442 (patch) | |
tree | 0f2a4fb769643d0ae24dfed49468d80e8652aabf /channels/chan_local.c | |
parent | 35c533156cf94b005bd7c561d69e40dc5e837dd6 (diff) |
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
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 695949fdc..5e72a6153 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -238,6 +238,12 @@ static int local_setoption(struct ast_channel *ast, int option, void * data, int return -1; } + if (!strcmp(write_info->function, "CHANNEL") + && !strncasecmp(write_info->data, "hangup_handler_", 15)) { + /* Block CHANNEL(hangup_handler_xxx) writes to the other local channel. */ + return 0; + } + /* get the tech pvt */ if (!(p = ast_channel_tech_pvt(ast))) { return -1; |