[Home]

Summary:ASTERISK-30227: Audiosocket: provision to exit cleanly from app_audiosocket
Reporter:Péter Juhász (peter.juhasz)Labels:patch
Date Opened:2022-09-14 09:18:11Date Closed:2022-09-29 12:00:42
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:18.14.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) audiosocket_close.patch
Description:App_audiosocket was added to Asterisk 18, and it provides a way to ferry audio data to and from an external program. However, it does not provide a way to exit cleanly from the application: even though the audiosocket protocol defines the way to end a session (with a specific "end session" packet type), and res_asterisk.c checks for this end session packet, the audiosocket_run function in app_audiosocket.c doesn't handle this case, in fact it does not ever return from the endless loop, except with -1 -- which in turn terminates the call.

However, closing the audiosocket connection remotely should not necessarily mean that the dialplan must terminate as well. We may want to redirect the user to some queue, do cleanup etc.

Therefore, I propose that app_audiosocket handle this case. It appears to be possible, I even have an experimental patch.
Comments:By: Asterisk Team (asteriskteam) 2022-09-14 09:18:15.424-0500

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/].

By: Péter Juhász (peter.juhasz) 2022-09-14 09:23:24.956-0500

This is a rather horrible hack that makes it possible to exit cleanly from an audiosocket session. (I have not tested it with chan_audiosocket which also uses the function from res_audiosocket, but that never worked for me anyway.)

There are almost certainly better ways to achieve the same result, but this was the most compact way I could find without changing exported function signatures etc.

By: George Joseph (gjoseph) 2022-09-15 06:01:29.300-0500

You should submit this patch to Gerrit so it'll get some feedback.
https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process
https://wiki.asterisk.org/wiki/display/AST/Code+Review


By: Asterisk Team (asteriskteam) 2022-09-29 12:00:40.738-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines