diff options
-rw-r--r-- | main/cdr.c | 36 | ||||
-rw-r--r-- | menuselect/Makefile | 5 | ||||
-rw-r--r-- | menuselect/configure.ac | 4 |
3 files changed, 26 insertions, 19 deletions
diff --git a/main/cdr.c b/main/cdr.c index 0b571fe0e..df5ce5497 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -2094,7 +2094,12 @@ static void handle_dial_message(void *data, struct stasis_subscription *sub, str if (!peer && !caller) { return; } - if (filter_channel_snapshot(peer) || (caller && filter_channel_snapshot(caller))) { + + if (peer && filter_channel_snapshot(peer)) { + return; + } + + if (caller && filter_channel_snapshot(caller)) { return; } @@ -2868,32 +2873,39 @@ int ast_cdr_backend_unsuspend(const char *name) int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be) { - struct cdr_beitem *i = NULL; + struct cdr_beitem *i; + struct cdr_beitem *cur; - if (!name) + if (!name) { return -1; + } if (!be) { ast_log(LOG_WARNING, "CDR engine '%s' lacks backend\n", name); + + return -1; + } + + i = ast_calloc(1, sizeof(*i)); + if (!i) { return -1; } + i->be = be; + ast_copy_string(i->name, name, sizeof(i->name)); + ast_copy_string(i->desc, desc, sizeof(i->desc)); + AST_RWLIST_WRLOCK(&be_list); - AST_RWLIST_TRAVERSE(&be_list, i, list) { - if (!strcasecmp(name, i->name)) { + AST_RWLIST_TRAVERSE(&be_list, cur, list) { + if (!strcasecmp(name, cur->name)) { ast_log(LOG_WARNING, "Already have a CDR backend called '%s'\n", name); AST_RWLIST_UNLOCK(&be_list); + ast_free(i); + return -1; } } - if (!(i = ast_calloc(1, sizeof(*i)))) - return -1; - - i->be = be; - ast_copy_string(i->name, name, sizeof(i->name)); - ast_copy_string(i->desc, desc, sizeof(i->desc)); - AST_RWLIST_INSERT_HEAD(&be_list, i, list); AST_RWLIST_UNLOCK(&be_list); diff --git a/menuselect/Makefile b/menuselect/Makefile index cdd7ebedb..c2c9373f4 100644 --- a/menuselect/Makefile +++ b/menuselect/Makefile @@ -64,10 +64,7 @@ all: $(ALL_TGTS) $(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h -makeopts: makeopts.in -autoconfig.h: autoconfig.h.in - -makeopts autoconfig.h: +makeopts: configure @./configure $(CONFIGURE_SILENT) @echo "****" @echo "**** The configure script was just executed, so 'make' needs to be" diff --git a/menuselect/configure.ac b/menuselect/configure.ac index 5945f5c9f..2dd4ed652 100644 --- a/menuselect/configure.ac +++ b/menuselect/configure.ac @@ -61,9 +61,7 @@ AH_TOP( #endif ) -AH_BOTTOM( -#endif -) +AH_BOTTOM([#endif]) # Checks for programs. AC_PROG_CC |