[Asterisk-code-review] func_channel: Added new OTHER_CHANNEL function (asterisk[16])
Richard Mudgett
asteriskteam at digium.com
Mon May 17 13:43:43 CDT 2021
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15908 )
Change subject: func_channel: Added new OTHER_CHANNEL function
......................................................................
Patch Set 4: Code-Review-1
(6 comments)
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c
File funcs/func_ochannel.c:
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@83
PS4, Line 83: ast_log(LOG_ERROR, "Channel '%s' not found! Variable '%s' will be blank.\n", args.channel, args.var);
I don't think this should be an error as it is quite possible for an arbitrary "other" channel to disappear at any time. A debug msg at best. Really should not have any msg.
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@86
PS4, Line 86: if (!args.var) {
: ast_log(LOG_WARNING, "No variable name was provided to %s function.\n", function);
: return -1;
: }
This check should be done before getting ochan. Otherwise we have a ref leak of ochan.
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@93
PS4, Line 93: if (ochan) {
: ast_channel_unref(ochan);
: }
At this point ochan is never NULL.
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@116
PS4, Line 116: ast_log(LOG_WARNING, "Channel '%s' not found! Variable '%s' will be blank.\n", args.channel, args.var);
I don't think this should be a warning as it is quite possible for an arbitrary "other" channel to disappear at any time. A debug msg at best. Really should not have any msg.
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@119
PS4, Line 119: if (!args.var) {
: ast_log(LOG_WARNING, "No variable name was provided to %s function.\n", function);
: return -1;
: }
This check should be done before getting ochan. Otherwise we have a ref leak of ochan.
https://gerrit.asterisk.org/c/asterisk/+/15908/4/funcs/func_ochannel.c@125
PS4, Line 125: if (ochan) {
: ast_channel_unref(ochan);
: }
At this point ochan is never NULL.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15908
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I7492645ae4307553d0f586d78e13a4f586231fdf
Gerrit-Change-Number: 15908
Gerrit-PatchSet: 4
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Mon, 17 May 2021 18:43:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210517/1abcebd0/attachment.html>
More information about the asterisk-code-review
mailing list