[Asterisk-code-review] This patch adds a beanstalk CDR backend. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Tue Oct 17 14:59:09 CDT 2017


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/6819 )

Change subject: This patch adds a beanstalk CDR backend.
......................................................................


Patch Set 2: Code-Review-1

(7 comments)

https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c
File cdr/cdr_beanstalkd.c:

https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@41
PS2, Line 41:     <support_level>exended</support_level>
Nit: indent with tab instead of spaces.


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@115
PS2, Line 115:     if (reload && customfields) {
Need to lose the check for customfields otherwise we'll leak bs_host / bs_tube if customfields is unset.


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@123
PS2, Line 123:     bs_host = DEFAULT_BEANSTALK_HOST;
bs_host / bs_tube have to be allocated:
bs_host = ast_strdup(DEFAULT_BEANSTALK_HOST);

Otherwise when you eventually call ast_free it will segfault.


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@153
PS2, Line 153:                 if (customfields && !ast_strlen_zero(v->name) && !ast_strlen_zero(v->value)) {
This appears to be directly from cdr_manager.  I'm unsure what you're looking for custom fields to do.  Unless you've tested this I think it would be better to just remove support for custom fields from this module, leave that for someone who needs the feature to add it?  Personally I would expect each mapping to create a field in the JSON object sent to beanstalkd.  Your current code just merges them all into AMI format and that is encoded as a single JSON string.


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@200
PS2, Line 200:     bs_socket = bs_connect(bs_host, bs_port);
ast_rwlock_rdlock needs to happen before this line (so bs_host is protected).


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@221
PS2, Line 221:     ast_rwlock_rdlock(&config_lock);
Move this above.


https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@276
PS2, Line 276:     if (customfields) {
Get rid of this conditional.



-- 
To view, visit https://gerrit.asterisk.org/6819
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5fe4089a34ab3b39230786d9bbfddafa56715f48
Gerrit-Change-Number: 6819
Gerrit-PatchSet: 2
Gerrit-Owner: Nir Simionovich (GreenfieldTech - Israel) <nirs at greenfieldtech.net>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Nir Simionovich (GreenfieldTech - Israel) <nirs at greenfieldtech.net>
Gerrit-Comment-Date: Tue, 17 Oct 2017 19:59:09 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171017/348e4bc8/attachment.html>


More information about the asterisk-code-review mailing list