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

Corey Farrell asteriskteam at digium.com
Fri Oct 20 00:23:09 CDT 2017


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

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


Patch Set 1: Code-Review-1

(12 comments)

Caught another error when checking the CEL review.

https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c
File cel/cel_beanstalkd.c:

https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@4
PS1, Line 4:  * Copyright (C) 2008 - 2009, Digium, Inc.
2017, copyright is yours.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@32
PS1, Line 32:  * \arg \ref AstCDR
            :  * \arg \ref AstAMI
            :  * \arg \ref Config_ami
Probably AstCEL instead of these 3.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@97
PS1, Line 97: 	char start_time[80] = "";
No need to initialize since it's unconditionally set.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@183
PS1, Line 183: 		ast_log(LOG_WARNING, "Configuration file '%s' is invalid. CEL manager Module not activated.\n",
Not "CEL manager Module"


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@185
PS1, Line 185: 		enablecel = 0;
If you want the behavior to be consistent with cdr_beanstalkd then you should not set enablecel=0 here, just leave the previous configuration if new config file is broken.  That or make cdr_beanstalkd disable itself on invalid config.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@188
PS1, Line 188: 		ast_log(LOG_WARNING, "Failed to load configuration file. CEL manager Module not activated.\n");
Ditto.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@189
PS1, Line 189: 		enablecel = 0;
Before this you should ast_cel_backend_unregister if enablecel was previously set.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@196
PS1, Line 196: 		ast_rwlock_wrlock(&config_lock);
Need to lock before freeing the values.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@254
PS1, Line 254: 	ast_rwlock_wrlock(&config_lock);
No locking here.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@255
PS1, Line 255: 	ast_cel_backend_unregister(CEL_BACKEND_NAME);
Unregister the cel backend before freeing bs_host / bs_tube.


https://gerrit.asterisk.org/#/c/6841/1/cel/cel_beanstalkd.c@270
PS1, Line 270: 	ast_free(bs_host);
             : 	ast_free(bs_tube);
             : 	ast_rwlock_wrlock(&config_lock);
This should not be done here.


https://gerrit.asterisk.org/#/c/6841/1/main/cel.c
File main/cel.c:

https://gerrit.asterisk.org/#/c/6841/1/main/cel.c@253
PS1, Line 253: 	.skip_category = "(^manager$|^radius$|^beanstalk$)", /*!< Config sections used by existing modules. Do not add to this list. */
New CEL modules are expected to have their own config files.  cel_custom does this instead of using the main cel.conf.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3a087faeeac045d69a2a018e60e29831ddb95ab
Gerrit-Change-Number: 6841
Gerrit-PatchSet: 1
Gerrit-Owner: Nir Simionovich (GreenfieldTech - Israel) <nirs at greenfieldtech.net>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Comment-Date: Fri, 20 Oct 2017 05:23:09 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171020/f8789464/attachment.html>


More information about the asterisk-code-review mailing list