From a199f94908601be10c0b43e3b3b7d67c41c5025f Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 31 Jan 2017 16:38:49 -0600 Subject: res_agi: Prevent an AGI from eating frames it should not. (Re-do) A dialplan intercept routine is equivalent to an interrupt routine. As such, the routine must be done quickly and you do not have access to the media stream. These restrictions are necessary because the media stream is the responsibility of some other code and interfering with or delaying that processing is bad. A possible future dialplan processing architecture change may allow the interception routine to run in a different thread from the main thread handling the media and remove the execution time restriction. * Made res_agi.c:run_agi() running an AGI in an interception routine run in DeadAGI mode. No touchy channel frames. ASTERISK-25951 ASTERISK-26343 ASTERISK-26716 Change-Id: I638f147ca7a7f2590d7194a8ef4090eb191e4e43 --- include/asterisk/channel.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 8605dfbb4..c237a009f 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -4697,4 +4697,21 @@ enum ast_channel_error { */ enum ast_channel_error ast_channel_errno(void); +/*! + * \brief Am I currently running an intercept dialplan routine. + * \since 13.14.0 + * + * \details + * A dialplan intercept routine is equivalent to an interrupt + * routine. As such, the routine must be done quickly and you + * do not have access to the media stream. These restrictions + * are necessary because the media stream is the responsibility + * of some other code and interfering with or delaying that + * processing is bad. + * + * \retval 0 Not in an intercept routine. + * \retval 1 In an intercept routine. + */ +int ast_channel_get_intercept_mode(void); + #endif /* _ASTERISK_CHANNEL_H */ -- cgit v1.2.3