[Asterisk-code-review] res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics (...asterisk[master])

Joshua C. Colp asteriskteam at digium.com
Wed Mar 13 05:47:12 CDT 2019


Joshua C. Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11083 )

Change subject: res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics
......................................................................


Patch Set 9: Code-Review-1

(4 comments)

https://gerrit.asterisk.org/#/c/11083/9/main/rtp_engine.c 
File main/rtp_engine.c:

https://gerrit.asterisk.org/#/c/11083/9/main/rtp_engine.c@3769 
PS9, Line 3769: 	ret = 0;
You don't need to set ret = 0; here, for the first thing you can just use ret = instead of ret |=.


https://gerrit.asterisk.org/#/c/11083/9/main/rtp_engine.c@3784 
PS9, Line 3784: 		ast_log(LOG_WARNING, "Could not create rtp statistics info.\n");
I don't think this WARNING is useful. There's no real information available to allow someone to understand where it came from (like a channel) or why, so it can just become a scary WARNING message for users.


https://gerrit.asterisk.org/#/c/11083/9/main/rtp_engine.c@3831 
PS9, Line 3831: 	j_res = ast_rtp_convert_stats_json(&stats);
In the future you don't need to store things like this in a variable if you are immediately returning, you can just do a return ast_rtp_convert_stats_json(&stats);


https://gerrit.asterisk.org/#/c/11083/7/res/ari/resource_channels.c 
File res/ari/resource_channels.c:

https://gerrit.asterisk.org/#/c/11083/7/res/ari/resource_channels.c@1985 
PS7, Line 1985: 	if (ret == AST_RTP_GLUE_RESULT_FORBID) {
              : 		ast_ari_response_error(response, 404, "Not Found",
              : 			"RTP info not found");
              : 		return;
              : 	}
> I'm not clear how this should be done. […]
Instead of checking if ret == AST_RTP_GLUE_RESULT_FORBID, initialize rtp to NULL, and check if it's NULL here instead.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11083
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I4343eec070438cec13f2a4f22e7fd9e574381376
Gerrit-Change-Number: 11083
Gerrit-PatchSet: 9
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Wed, 13 Mar 2019 10:47:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: sungtae kim <pchero21 at gmail.com>
Comment-In-Reply-To: Joshua C. Colp <jcolp at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190313/287837e2/attachment.html>


More information about the asterisk-code-review mailing list