[Asterisk-code-review] cdr.c: Use current ao2 flag names (asterisk[13])
Jenkins2
asteriskteam at digium.com
Mon Oct 9 18:33:30 CDT 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6698 )
Change subject: cdr.c: Use current ao2 flag names
......................................................................
cdr.c: Use current ao2 flag names
Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e
---
M main/cdr.c
1 file changed, 18 insertions(+), 18 deletions(-)
Approvals:
Corey Farrell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/main/cdr.c b/main/cdr.c
index e09efe2..26c5805 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -785,11 +785,11 @@
const struct cdr_object *cdr;
const char *key;
- switch (flags & (OBJ_POINTER | OBJ_KEY | OBJ_PARTIAL_KEY)) {
- case OBJ_KEY:
+ switch (flags & OBJ_SEARCH_MASK) {
+ case OBJ_SEARCH_KEY:
key = obj;
break;
- case OBJ_POINTER:
+ case OBJ_SEARCH_OBJECT:
cdr = obj;
key = cdr->uniqueid;
break;
@@ -810,14 +810,14 @@
const char *right_key = arg;
int cmp;
- switch (flags & (OBJ_POINTER | OBJ_KEY | OBJ_PARTIAL_KEY)) {
- case OBJ_POINTER:
+ switch (flags & OBJ_SEARCH_MASK) {
+ case OBJ_SEARCH_OBJECT:
right_key = right->uniqueid;
/* Fall through */
- case OBJ_KEY:
+ case OBJ_SEARCH_KEY:
cmp = strcmp(left->uniqueid, right_key);
break;
- case OBJ_PARTIAL_KEY:
+ case OBJ_SEARCH_PARTIAL_KEY:
/*
* We could also use a partial key struct containing a length
* so strlen() does not get called for every comparison instead.
@@ -1576,7 +1576,7 @@
!success && (channel_id = ao2_iterator_next(&it_cdrs));
ao2_ref(channel_id, -1)) {
RAII_VAR(struct cdr_object *, cand_cdr_master,
- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),
+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),
ao2_cleanup);
struct cdr_object *cand_cdr;
@@ -1726,7 +1726,7 @@
!success && (channel_id = ao2_iterator_next(&it_cdrs));
ao2_ref(channel_id, -1)) {
RAII_VAR(struct cdr_object *, cand_cdr_master,
- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),
+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),
ao2_cleanup);
struct cdr_object *cand_cdr;
@@ -1960,9 +1960,9 @@
/* Figure out who is running this show */
if (caller) {
- cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_KEY);
+ cdr = ao2_find(active_cdrs_by_channel, caller->uniqueid, OBJ_SEARCH_KEY);
} else {
- cdr = ao2_find(active_cdrs_by_channel, peer->uniqueid, OBJ_KEY);
+ cdr = ao2_find(active_cdrs_by_channel, peer->uniqueid, OBJ_SEARCH_KEY);
}
if (!cdr) {
@@ -2116,7 +2116,7 @@
/* Handle Party A */
if (!cdr) {
- cdr = ao2_find(active_cdrs_by_channel, uniqueid, OBJ_KEY);
+ cdr = ao2_find(active_cdrs_by_channel, uniqueid, OBJ_SEARCH_KEY);
}
if (!cdr) {
ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", name);
@@ -2222,7 +2222,7 @@
RAII_VAR(struct module_config *, mod_cfg,
ao2_global_obj_ref(module_configs), ao2_cleanup);
RAII_VAR(struct cdr_object *, cdr,
- ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY),
+ ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY),
ao2_cleanup);
struct cdr_object *it_cdr;
struct bridge_leave_data leave_data = {
@@ -2379,7 +2379,7 @@
it_channels = ao2_iterator_init(bridge->channels, 0);
while ((channel_id = ao2_iterator_next(&it_channels))) {
RAII_VAR(struct cdr_object *, cand_cdr,
- ao2_find(active_cdrs_by_channel, channel_id, OBJ_KEY),
+ ao2_find(active_cdrs_by_channel, channel_id, OBJ_SEARCH_KEY),
ao2_cleanup);
if (!cand_cdr) {
@@ -2525,7 +2525,7 @@
struct ast_bridge_snapshot *bridge = update->bridge;
struct ast_channel_snapshot *channel = update->channel;
RAII_VAR(struct cdr_object *, cdr,
- ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY),
+ ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY),
ao2_cleanup);
RAII_VAR(struct module_config *, mod_cfg,
ao2_global_obj_ref(module_configs), ao2_cleanup);
@@ -2593,7 +2593,7 @@
(unsigned int)stasis_message_timestamp(message)->tv_sec,
(unsigned int)stasis_message_timestamp(message)->tv_usec);
- cdr = ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_KEY);
+ cdr = ao2_find(active_cdrs_by_channel, channel->uniqueid, OBJ_SEARCH_KEY);
if (!cdr) {
ast_log(AST_LOG_WARNING, "No CDR for channel %s\n", channel->name);
ast_assert(0);
@@ -4216,8 +4216,8 @@
stasis_message_router_add(stasis_router, ast_parked_call_type(), handle_parked_call_message, NULL);
stasis_message_router_add(stasis_router, cdr_sync_message_type(), handle_cdr_sync_message, NULL);
- active_cdrs_by_channel = ao2_container_alloc(NUM_CDR_BUCKETS,
- cdr_object_channel_hash_fn, cdr_object_channel_cmp_fn);
+ active_cdrs_by_channel = ao2_container_alloc_hash(AO2_ALLOC_OPT_LOCK_MUTEX, 0,
+ NUM_CDR_BUCKETS, cdr_object_channel_hash_fn, NULL, cdr_object_channel_cmp_fn);
if (!active_cdrs_by_channel) {
return -1;
}
--
To view, visit https://gerrit.asterisk.org/6698
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e
Gerrit-Change-Number: 6698
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171009/af4ca974/attachment.html>
More information about the asterisk-code-review
mailing list