<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6699">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
Joshua Colp: 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 4bcfc05..fe54029 100644<br>--- a/main/cdr.c<br>+++ b/main/cdr.c<br>@@ -788,11 +788,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>@@ -813,14 +813,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>@@ -1575,7 +1575,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>@@ -1725,7 +1725,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>@@ -1966,9 +1966,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>@@ -2122,7 +2122,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>@@ -2228,7 +2228,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>@@ -2385,7 +2385,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>@@ -2531,7 +2531,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>@@ -2599,7 +2599,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>@@ -4249,8 +4249,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/6699">change 6699</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/6699"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </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: 6699 </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>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>