autoservice: Don't start channel autoservice if the thread is a user interface.

Executing dialplan functions from either AMI or ARI by getting a variable
could place the channel into autoservice.  However, these user interface
threads do not handle the channel's media so we wind up with two threads
attempting to handle the media.

There can be one and only one thread handling a channel's media at a time.
Otherwise, we don't know which thread is going to handle the media frames.

ASTERISK-27625

Change-Id: If2dc94ce15ddabf923ed1e2a65ea0ef56e013e49
This commit is contained in:
Richard Mudgett
2018-06-18 18:04:54 -05:00
parent 99f439dc01
commit 5d34ca5b33
4 changed files with 80 additions and 0 deletions

View File

@@ -1195,4 +1195,22 @@ enum ast_fd_flag_operation {
int __ast_fd_set_flags(int fd, int flags, enum ast_fd_flag_operation op,
const char *file, int lineno, const char *function);
/*!
* \brief Set the current thread's user interface status.
*
* \param is_user_interface Non-zero to mark the thread as a user interface.
*
* \return 0 if successfuly marked current thread.
* \return Non-zero if marking current thread failed.
*/
int ast_thread_user_interface_set(int is_user_interface);
/*!
* \brief Indicates whether the current thread is a user interface
*
* \return True (non-zero) if thread is a user interface.
* \return False (zero) if thread is not a user interface.
*/
int ast_thread_is_user_interface(void);
#endif /* _ASTERISK_UTILS_H */