Ensure channel locks aren't held while calling ast_set_variables.

If the channel is locked when calling ast_set_variables and any of the
variables contained dialplan functions, there's a possiblilty of a deadlock.
To prevent this, either the explicit locks were removed or the call to
ast_set_variables moved out of the lock scope.  A warning to not hold
channel locks is also added to the documentation for ast_set_variables.

Resolves: #1936
This commit is contained in:
George Joseph
2026-05-20 09:47:00 -06:00
committed by Asterisk Development Team
parent 2a64ca82e6
commit 1982afca0d
4 changed files with 4 additions and 9 deletions
+2 -1
View File
@@ -2749,7 +2749,8 @@ void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_
* \param chan the channel
* \param vars a linked list of variables
*
* \pre chan is locked
* \warning The channel must not be locked if there's a possibility that
* a dialplan function would be invoked.
*
* \details
* Variable names can be for a regular channel variable or a dialplan function