[asterisk-bugs] [JIRA] (ASTERISK-30497) ChannelRedirect aborting hangup handler execution

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Apr 19 03:33:03 CDT 2023


    [ https://issues.asterisk.org/jira/browse/ASTERISK-30497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=261798#comment-261798 ] 

Asterisk Team commented on ASTERISK-30497:
------------------------------------------

WARNING

JIRA will be going read-only at the end of April, 2023. We will be starting fresh on Github at https://github.com/asterisk/asterisk at that time. No issues or patches will be copied to Github. If you file an issue on JIRA at this time you will need to recreate it on Github after this date. The same applies if you have a patch.

WARNING

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

> ChannelRedirect aborting hangup handler execution
> -------------------------------------------------
>
>                 Key: ASTERISK-30497
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30497
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_channelredirect
>    Affects Versions: 18.17.0
>            Reporter: Egil Hjelmeland
>
> A ChannelRedirect on a channel that is in the process of hanging up can prevent 
> hangup handler on the channel to complete. I believe this is a bug.
> I improved the situation for our part with the following patch 
> {code:none}
> $ git diff 18.17.1 main/pbx.c
> diff --git a/main/pbx.c b/main/pbx.c
> index c655f1bcfc..68d3044cdb 100644
> --- a/main/pbx.c
> +++ b/main/pbx.c
> @@ -7016,6 +7016,13 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
>         struct ast_channel *newchan;
>  
>         ast_channel_lock(chan);
> +
> +       if (ast_channel_softhangup_internal_flag(chan) & ~AST_SOFTHANGUP_ASYNCGOTO) {
> +               ast_log(LOG_WARNING, "ast_async_goto refusing on dying channel %s\n", ast_channel_name(chan));
> +               ast_channel_unlock(chan);
> +               return -1;
> +       }
> +
>         /* Channels in a bridge or running a PBX can be sent directly to the specified destination */
>         if (ast_channel_is_bridged(chan) || ast_channel_pbx(chan)) {
>                 if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP)) {
> {code}
> Not sure if this is the right upstream fix for the problem.
> Background: For my employer I have been crafting a queuing application to our liking through dialplan programming, relying heavily on ChannelRedirect to manipulate queue call legs, func_odbc to keep track of call(_leg) states, and hangup handlers to clean up call(_leg) records in the database.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list