* \brief Set the channel to next execute the specified dialplan location.
* \see ast_async_parseable_goto, ast_async_goto_if_exists
*
+ * \note If the AST_SOFTHANGUP_ASYNCGOTO flag is set,
+ * it can prevent the dialplan location from being overwritten by ast_explicit_goto.
* \note Do _NOT_ hold any channel locks when calling this function.
*/
int ast_async_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
/*!
* \note This function will handle locking the channel as needed.
+ * \note If the AST_SOFTHANGUP_ASYNCGOTO flag is set on the channel, this function will fail and return -1.
*/
int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
ast_channel_lock(chan);
+ if (ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_ASYNCGOTO) {
+ ast_channel_unlock(chan);
+ return -1;
+ }
if (!ast_strlen_zero(context))
ast_channel_context_set(chan, context);
if (!ast_strlen_zero(exten))