[Asterisk-code-review] res_tonedetect: Tone detection module (asterisk[master])
Kevin Harwell
asteriskteam at digium.com
Thu Aug 19 14:45:51 CDT 2021
Attention is currently required from: N A.
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16234 )
Change subject: res_tonedetect: Tone detection module
......................................................................
Patch Set 3: Code-Review-1
(8 comments)
File res/res_tonedetect.c:
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/ab95373e_63126b86
PS3, Line 235: if (audiohook->status == AST_AUDIOHOOK_STATUS_DONE)
: return 0;
:
: /* Grab datastore which contains our gain information */
: if (!(datastore = ast_channel_datastore_find(chan, &detect_datastore, NULL)))
: return 0;
Add braces to if blocks
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/24d732d9_98510cba
PS3, Line 244: if (!frame || frame->frametype != AST_FRAME_VOICE)
: return 0;
:
: if (!(direction == AST_AUDIOHOOK_DIRECTION_READ ? &di->rx : &di->tx))
: return 0;
Add braces to if block
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/a0e1c40e_53d7b697
PS3, Line 372: size = sizeof(context) + sizeof(exten) + sizeof(pri) + 2;
s/sizeof/strlen
Also comment says "+ 1 for null terminator + 2 commas" so should this be + 3?
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/92fc2c78_b2bfddcf
PS3, Line 373: dest = ast_malloc(size + 1);
Add a NULL check here.
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/2599f6c2_93b14112
PS3, Line 460: return 0;
Unlock channel before returning
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/99549cbc_f87bf1a2
PS3, Line 463: return 0;
Unlock channel before returning
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/2a0a8ce3_06d5eaa5
PS3, Line 469: return -1;
Free the datastore and unlock channel before returning
https://gerrit.asterisk.org/c/asterisk/+/16234/comment/03a17348_f54e42cd
PS3, Line 618: }
frame needs to be freed once done.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16234
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie38c395000f4fd4d04e942e8658e177f8f499b26
Gerrit-Change-Number: 16234
Gerrit-PatchSet: 3
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Thu, 19 Aug 2021 19:45:51 +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/20210819/197c70cb/attachment.html>
More information about the asterisk-code-review
mailing list