From ac35b92b628064a1fcf962895f0befd57aff0442 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 29 Jun 2012 17:02:32 +0000 Subject: 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 --- main/channel_internal_api.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main/channel_internal_api.c') diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 1922db9a9..b91e2e253 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -137,6 +137,7 @@ struct ast_channel { struct ast_readq_list readq; struct ast_jb jb; /*!< The jitterbuffer state */ struct timeval dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */ + struct ast_hangup_handler_list hangup_handlers;/*!< Hangup handlers on the channel. */ struct ast_datastore_list datastores; /*!< Data stores on the channel */ struct ast_autochan_list autochans; /*!< Autochans on the channel */ unsigned long insmpl; /*!< Track the read/written samples for monitor use */ @@ -884,6 +885,10 @@ struct ast_format *ast_channel_writeformat(struct ast_channel *chan) { return &chan->writeformat; } +struct ast_hangup_handler_list *ast_channel_hangup_handlers(struct ast_channel *chan) +{ + return &chan->hangup_handlers; +} struct ast_datastore_list *ast_channel_datastores(struct ast_channel *chan) { return &chan->datastores; -- cgit v1.2.3