[asterisk-bugs] [JIRA] (ASTERISK-30227) Audiosocket: provision to exit cleanly from app_audiosocket

Péter Juhász (JIRA) noreply at issues.asterisk.org
Wed Sep 14 09:24:08 CDT 2022


     [ https://issues.asterisk.org/jira/browse/ASTERISK-30227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Péter Juhász updated ASTERISK-30227:
------------------------------------

    Attachment: audiosocket_close.patch

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.

> Audiosocket: provision to exit cleanly from app_audiosocket
> -----------------------------------------------------------
>
>                 Key: ASTERISK-30227
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30227
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Applications/General
>    Affects Versions: 18.14.0
>            Reporter: Péter Juhász
>              Labels: patch
>         Attachments: audiosocket_close.patch
>
>
> 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.



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



More information about the asterisk-bugs mailing list