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

Friendly Automation (JIRA) noreply at issues.asterisk.org
Mon Dec 6 10:24:34 CST 2021


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

Friendly Automation commented on ASTERISK-28219:
------------------------------------------------

Change 17618 merged by Kevin Harwell:
channel: Short-circuit ast_channel_get_by_name() on empty arg.

[https://gerrit.asterisk.org/c/asterisk/+/17618|https://gerrit.asterisk.org/c/asterisk/+/17618]

> 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
>            Assignee: Anil Gupta
>         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