summaryrefslogtreecommitdiff
path: root/main/channel_internal_api.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-06-29 17:02:32 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-06-29 17:02:32 +0000
commitac35b92b628064a1fcf962895f0befd57aff0442 (patch)
tree0f2a4fb769643d0ae24dfed49468d80e8652aabf /main/channel_internal_api.c
parent35c533156cf94b005bd7c561d69e40dc5e837dd6 (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 'main/channel_internal_api.c')
-rw-r--r--main/channel_internal_api.c5
1 files changed, 5 insertions, 0 deletions
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;