[Asterisk-code-review] res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics (...asterisk[master])
sungtae kim
asteriskteam at digium.com
Sun Mar 10 15:56:45 CDT 2019
sungtae kim 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 8:
(4 comments)
Thank you for your kind reviewing.
I've updated commit. But I'm not clear about res/ari/resource_channels.c:1989. Can I get some help?
https://gerrit.asterisk.org/#/c/11083/7/main/rtp_engine.c
File main/rtp_engine.c:
https://gerrit.asterisk.org/#/c/11083/7/main/rtp_engine.c@3767
PS7, Line 3767: SET_AST_JSON_OBJ(j_res, "txcount", ast_json_integer_create(stats->txcount));
> I think jj_res should just not be created if any of these fail. […]
Agree. Changed it to check the return values to make sure it was actually created.
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@1969
PS7, Line 1969:
> Channel is not locked during this period of time and should be, otherwise you have no guarantee that […]
Thanks, added chan lock/unlock.
https://gerrit.asterisk.org/#/c/11083/7/res/ari/resource_channels.c@1984
PS7, Line 1984: ret = glue->get_rtp_info(chan, &rtp);
> You need to ensure ao2_cleanup is called on rtp or else the RTP instance will leak.
Thanks, added RAII_VAR() for that.
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;
: }
> Even if forbid there are cases where rtp will be present, so check for that instead.
I'm not clear how this should be done. Could I get some help?
--
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: 8
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Sun, 10 Mar 2019 20:56:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua 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/20190310/6741c3f9/attachment.html>
More information about the asterisk-code-review
mailing list