<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6700">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cdr.c: Use current ao2 flag names<br><br>Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e<br>---<br>M main/cdr.c<br>1 file changed, 18 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/cdr.c b/main/cdr.c<br>index 1817e80..e06c1e8 100644<br>--- a/main/cdr.c<br>+++ b/main/cdr.c<br>@@ -785,11 +785,11 @@<br> const struct cdr_object *cdr;<br> const char *key;<br> <br>- switch (flags & (OBJ_POINTER | OBJ_KEY | OBJ_PARTIAL_KEY)) {<br>- case OBJ_KEY:<br>+ switch (flags & OBJ_SEARCH_MASK) {<br>+ case OBJ_SEARCH_KEY:<br> key = obj;<br> break;<br>- case OBJ_POINTER:<br>+ case OBJ_SEARCH_OBJECT:<br> cdr = obj;<br> key = cdr->uniqueid;<br> break;<br>@@ -810,14 +810,14 @@<br> const char *right_key = arg;<br> int cmp;<br> <br>- switch (flags & (OBJ_POINTER | OBJ_KEY | OBJ_PARTIAL_KEY)) {<br>- case OBJ_POINTER:<br>+ switch (flags & OBJ_SEARCH_MASK) {<br>+ case OBJ_SEARCH_OBJECT:<br> right_key = right->uniqueid;<br> /* Fall through */<br>- case OBJ_KEY:<br>+ case OBJ_SEARCH_KEY:<br> cmp = strcmp(left->uniqueid, right_key);<br> break;<br>- case OBJ_PARTIAL_KEY:<br>+ case OBJ_SEARCH_PARTIAL_KEY:<br> /*<br> * We could also use a partial key struct containing a length<br> * so strlen() does not get called for every comparison instead.<br>@@ -1572,7 +1572,7 @@<br> !success && (channel_id = ao2_iterator_next(&it_cdrs));<br> ao2_ref(channel_id, -1)) {<br> RAII_VAR(struct cdr_object *, cand_cdr_master,<br>- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),<br>+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),<br> ao2_cleanup);<br> struct cdr_object *cand_cdr;<br> <br>@@ -1722,7 +1722,7 @@<br> !success && (channel_id = ao2_iterator_next(&it_cdrs));<br> ao2_ref(channel_id, -1)) {<br> RAII_VAR(struct cdr_object *, cand_cdr_master,<br>- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),<br>+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),<br> ao2_cleanup);<br> struct cdr_object *cand_cdr;<br> <br>@@ -1963,9 +1963,9 @@<br> <br> /* Figure out who is running this show */<br> if (caller) {<br>- cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_KEY);<br>+ cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_SEARCH_KEY);<br> } else {<br>- cdr = ao2_find(active_cdrs_by_channel, peer->uniqueid, OBJ_KEY);<br>+ cdr = ao2_find(active_cdrs_by_channel, peer->uniqueid, OBJ_SEARCH_KEY);<br> }<br> <br> if (!cdr) {<br>@@ -2119,7 +2119,7 @@<br> <br> /* Handle Party A */<br> if (!cdr) {<br>- cdr = ao2_find(active_cdrs_by_channel, uniqueid, OBJ_KEY);<br>+ cdr = ao2_find(active_cdrs_by_channel, uniqueid, OBJ_SEARCH_KEY);<br> }<br> if (!cdr) {<br> ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", name);<br>@@ -2225,7 +2225,7 @@<br> RAII_VAR(struct module_config *, mod_cfg,<br> ao2_global_obj_ref(module_configs), ao2_cleanup);<br> RAII_VAR(struct cdr_object *, cdr,<br>- ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY),<br>+ ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY),<br> ao2_cleanup);<br> struct cdr_object *it_cdr;<br> struct bridge_leave_data leave_data = {<br>@@ -2382,7 +2382,7 @@<br> it_channels = ao2_iterator_init(bridge->channels, 0);<br> while ((channel_id = ao2_iterator_next(&it_channels))) {<br> RAII_VAR(struct cdr_object *, cand_cdr,<br>- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),<br>+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),<br> ao2_cleanup);<br> <br> if (!cand_cdr) {<br>@@ -2528,7 +2528,7 @@<br> struct ast_bridge_snapshot *bridge = update->bridge;<br> struct ast_channel_snapshot *channel = update->channel;<br> RAII_VAR(struct cdr_object *, cdr,<br>- ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY),<br>+ ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY),<br> ao2_cleanup);<br> RAII_VAR(struct module_config *, mod_cfg,<br> ao2_global_obj_ref(module_configs), ao2_cleanup);<br>@@ -2596,7 +2596,7 @@<br> (unsigned int)stasis_message_timestamp(message)->tv_sec,<br> (unsigned int)stasis_message_timestamp(message)->tv_usec);<br> <br>- cdr = ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY);<br>+ cdr = ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY);<br> if (!cdr) {<br> ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", channel->name);<br> ast_assert(0);<br>@@ -4246,8 +4246,8 @@<br> stasis_message_router_add(stasis_router, ast_parked_call_type(), handle_parked_call_message, NULL);<br> stasis_message_router_add(stasis_router, cdr_sync_message_type(), handle_cdr_sync_message, NULL);<br> <br>- active_cdrs_by_channel = ao2_container_alloc(NUM_CDR_BUCKETS,<br>- cdr_object_channel_hash_fn, cdr_object_channel_cmp_fn);<br>+ active_cdrs_by_channel = ao2_container_alloc_hash(AO2_ALLOC_OPT_LOCK_MUTEX, 0,<br>+ NUM_CDR_BUCKETS, cdr_object_channel_hash_fn, NULL, cdr_object_channel_cmp_fn);<br> if (!active_cdrs_by_channel) {<br> return -1;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6700">change 6700</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/6700"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e </div>
<div style="display:none"> Gerrit-Change-Number: 6700 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>