[asterisk-bugs] [JIRA] (ASTERISK-28219) res_ari: Channel create and dial may cause "BUG! Must supply a channel name.." error

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Sep 14 10:30:12 CDT 2022


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

Asterisk Team updated ASTERISK-28219:
-------------------------------------

    Target Release Version/s: 20.0.0

> res_ari: Channel create and dial may cause "BUG! Must supply a channel name.." error
> ------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28219
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28219
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_ari_channels
>    Affects Versions: 16.1.0
>            Reporter: Anil Gupta
>      Target Release: 20.0.0
>
>         Attachments: create-bug.js
>
>
> Hello!
> If /ari/channels/create is called without the optional parameter `originator` it results in the following error:
> [Dec 21 12:03:50] ERROR[10769]: channel.c:1311 ast_channel_by_name_cb: BUG! Must supply a channel name or partial name to match!
> I am not sure if this happens after a certain threshold of hits or randomly. However, it is easy to reproduce by repeatedly hitting the API. I'll attach a nodejs script in a short while to help reproduce this.
> Looking at the code in res/ari/resource_channels.c:ast_ari_channels_create() it seems the originator is queried with ast_channel_get_by_name(originator) and cleaned up by ast_channel_cleanup(originator) without checking if the parameter was provided or not. Wrapping these two lines in
> if (!ast_strlen_zero(args->originator)) {
> //
> }
> resolves the issue.
> ASTERISK-27797 might be the result of this as the ARI trace attached there indicates that /ari/channels/create is called without the `originator` parameter.
> Furthermore, /ari/channels/$channelId/dial behaves the same if the optional parameter `caller` is not provided.



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



More information about the asterisk-bugs mailing list