[Home]

Summary:ASTERISK-27797: channel.c: BUG! Must supply a channel name or partial name to match!
Reporter:shaurya jain (shaurya)Labels:patch webrtc
Date Opened:2018-04-11 03:41:02Date Closed:2020-01-14 11:13:30.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:pjproject/pjsip
Versions:15.3.0 Frequency of
Occurrence
Frequent
Related
Issues:
is related toASTERISK-28219 res_ari: Channel create and dial may cause "BUG! Must supply a channel name.." error
Environment:ubuntu 16.04,ARI,webrtcAttachments:( 0) 1523426524.229297
( 1) AGI_log.txt
( 2) channel_by_name_assert.diff
Description:Hi Team,

We are still facing the concern although there is no call disconnection or major issue regarding this but it leads to unwanted ERRORS on console.

[Apr 11 14:02:23] NOTICE[32364][C-00011eaa] res_stasis_playback.c: 1523426524.229297: Playback stopped for sound:11/mixivr
[Apr 11 14:02:24] ERROR[32444] channel.c: BUG! Must supply a channel name or partial name to match!
[Apr 11 14:02:24] ERROR[32623] channel.c: BUG! Must supply a channel name or partial name to match!

Attached are the ARI logs as you asked in previous note which can show you the exact ARI request and call flow.

Let me know the proceedings in this regards.
Comments:By: Asterisk Team (asteriskteam) 2018-04-11 03:41:03.925-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.

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

By: shaurya jain (shaurya) 2018-04-11 03:43:36.957-0500

ARI logs

By: Kevin Harwell (kharwell) 2018-04-12 15:50:57.664-0500

[~shaurya] I've been unsuccessful at replicating your problem just by using the given ARI log. Following through the log I tried the following after creating a channel in ARI application (used a SIP phone to dial into the application):

1. Issued a playback command
2. Set a variable
3. Issued an moh command (put the channel on hold)
4. Retrieved a variable
5. Took the channel off hold
6. Issued command for the channel to continue in the dialplan

I never saw the error message. Actually, I even adding some more logging that would log information whenever the function was called that contained the error message (whether or not there as an error at all). I was curious what might have called into that function using the above process. Nothing was logged. It appears as if that function was not called at all. At least by following the steps above. So now it makes me wonder if there is something else causing the problem.

In order to move forward we'll require additional debug (a full Asterisk debug log with matching ARI logging when the problem occurrs) to continue with triage of your issue. Please follow the instructions on the wiki [1] for how to collect debugging information from Asterisk. For expediency, where possible, attach the debug with a '.txt' file extension so that the debug will be usable for further analysis.

Also please post the relevant dialplan where the call continues to as it's possible something in the dialplan after ARI is done with it causes the problem.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

By: Abhay Gupta (agupta) 2018-04-13 05:58:35.608-0500

I find this code wrong .
In channels.c , struct ast_channel *ast_channel_get_by_name_prefix we call  ast_channel_by_name_cb first and then check for lname
if (ast_strlen_zero(l_name)) {
               /* We didn't have a name to search for so quit. */
               return NULL;
       }

now in the function ast_channnel_by_name_cb if arg i.e name is of length zero then we have this code

if (ast_strlen_zero(name)) {
               ast_log(LOG_ERROR, "BUG! Must supply a channel name or partial name to match!\n");
               return CMP_STOP;
       }

The placement of function calling is obviously wrong .

By: Kevin Harwell (kharwell) 2018-04-13 14:06:15.160-0500

[~shaurya] You've just attached more ARI logging and not the full Asterisk debug log. Please read the link I mentioned above and attach the Asterisk debug log as well.

Also please post the dialplan where the channel continues. It appears that after leaving the stasis it re-enters it again.

(!) *WARNING* only apply the attached patch [^channel_by_name_assert.diff] on a test machine as asterisk will now crash and output a backtrace upon reaching the error message if you follow the below instructions.

If it's possible please apply the attached patch [^channel_by_name_assert.diff]. You'll also need to re-configure asterisk with '--enable-dev-mode' and then in menuselect enable DO_CRASH under compiler options. Once it crashes please attach the backtrace output to the issue.

This will allow us to trace back the method that initiated the call causing the error.

By: Kevin Harwell (kharwell) 2018-04-13 14:10:20.885-0500

[~agupta] You're correct in that the check for an empty string done afterwards _ast_channel_get_by_name_prefix_ is useless. However, moving it prior to the _ast_channel_by_name_cb_ may or may not be correct. Doing that could possibly be the fix here. However, we first need to know what initiated the call into that method to begin with and find out whether or not it should be passing in an empty name like that.

By: Asterisk Team (asteriskteam) 2018-04-28 12:00:01.594-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