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
This commit is contained in:
Richard Mudgett
2017-01-31 16:38:49 -06:00
parent 6bed318a66
commit a199f94908
3 changed files with 61 additions and 4 deletions

View File

@@ -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 */