<p>Corey Farrell <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/6819">View Change</a></p><p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(7 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c">File cdr/cdr_beanstalkd.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@41">Patch Set #2, Line 41:</a> <code style="font-family:monospace,monospace">    <support_level>exended</support_level></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Nit: indent with tab instead of spaces.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@115">Patch Set #2, Line 115:</a> <code style="font-family:monospace,monospace">    if (reload && customfields) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to lose the check for customfields otherwise we'll leak bs_host / bs_tube if customfields is unset.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@123">Patch Set #2, Line 123:</a> <code style="font-family:monospace,monospace">    bs_host = DEFAULT_BEANSTALK_HOST;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">bs_host / bs_tube have to be allocated:<br>bs_host = ast_strdup(DEFAULT_BEANSTALK_HOST);</p><p style="white-space: pre-wrap; word-wrap: break-word;">Otherwise when you eventually call ast_free it will segfault.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@153">Patch Set #2, Line 153:</a> <code style="font-family:monospace,monospace">                if (customfields && !ast_strlen_zero(v->name) && !ast_strlen_zero(v->value)) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@200">Patch Set #2, Line 200:</a> <code style="font-family:monospace,monospace">    bs_socket = bs_connect(bs_host, bs_port);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_rwlock_rdlock needs to happen before this line (so bs_host is protected).</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@221">Patch Set #2, Line 221:</a> <code style="font-family:monospace,monospace">    ast_rwlock_rdlock(&config_lock);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Move this above.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6819/2/cdr/cdr_beanstalkd.c@276">Patch Set #2, Line 276:</a> <code style="font-family:monospace,monospace">    if (customfields) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Get rid of this conditional.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/6819">change 6819</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6819"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I5fe4089a34ab3b39230786d9bbfddafa56715f48 </div>
<div style="display:none"> Gerrit-Change-Number: 6819 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Nir Simionovich (GreenfieldTech - Israel) <nirs@greenfieldtech.net> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Nir Simionovich (GreenfieldTech - Israel) <nirs@greenfieldtech.net> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 17 Oct 2017 19:59:09 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>