[Asterisk-code-review] func_channel: Added new OTHER_CHANNEL function (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Wed May 19 18:44:12 CDT 2021


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15908 )

Change subject: func_channel: Added new OTHER_CHANNEL function
......................................................................


Patch Set 5: Code-Review-1

(6 comments)

https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c 
File funcs/func_ochannel.c:

https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@83 
PS5, Line 83: 		ast_log(LOG_ERROR, "Channel '%s' not found!  Variable '%s' will be blank.\n", args.channel, args.var);
This log messages seems a little misleading. It implies a variable was added, but its value was left blank. However as the function returns right after this a variable is never added. How about something like " ... '%s' variable not set."

Also agree with rmudgett and make this a debug message instead.


https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@88 
PS5, Line 88: 		return -1;
There is a ref leak in this off nominal path. Add an ast_channel_unref(ochan); before returning, or move this entire 'if' block to before the call to ast_channel_get_by_name.


https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@92 
PS5, Line 92: 	ast_str_substitute_variables(buf, len, ochan, output);
I'm thinking maybe since the channel is being arbitrarily obtained this needs a lock around it?


https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@116 
PS5, Line 116: 		ast_log(LOG_WARNING, "Channel '%s' not found!  Variable '%s' will be blank.\n", args.channel, args.var);
Similar to above. The warning message seems not quite correct. Also I agree with rmudgett maybe make this a debug message instead.


https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@120 
PS5, Line 120: 		ast_log(LOG_WARNING, "No variable name was provided to %s function.\n", function);
ochan ref leak here too. Add unref, or move check.


https://gerrit.asterisk.org/c/asterisk/+/15908/5/funcs/func_ochannel.c@123 
PS5, Line 123: 
             : 	pbx_builtin_setvar_helper(ochan, data, value);
I'm thinking maybe since the channel is being arbitrarily obtained this needs a lock around it?



-- 
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: 5
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-CC: George Joseph <gjoseph at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Wed, 19 May 2021 23:44:12 +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/20210519/92521701/attachment.html>


More information about the asterisk-code-review mailing list