summaryrefslogtreecommitdiff
path: root/cdr
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-10-23 16:52:11 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-10-23 16:52:11 +0000
commit2966ca288c2d0b97199c09f37e8d3f8cb6b94638 (patch)
tree31c4d1516cc7d81872997cfee3f0fd01dcd3ed22 /cdr
parent3975617f87860ec463e6d04a1c020986950ec758 (diff)
cdr_adaptive_odbc: Also apply a filter when the CDR value is empty.
Extra CDR records are written if a filtered CDR value is empty because the filter is not checked. (closes issue ASTERISK-22272) Reported by: Jordi Llull Chavarria ........ Merged revisions 401577 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401579 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401581 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_adaptive_odbc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index a590fb32a..0a9cfdbdd 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -720,6 +720,14 @@ static int odbc_log(struct ast_cdr *cdr)
continue;
}
first = 0;
+ } else if (entry->filtervalue
+ && ((!entry->negatefiltervalue && entry->filtervalue[0] != '\0')
+ || (entry->negatefiltervalue && entry->filtervalue[0] == '\0'))) {
+ ast_verb(4, "CDR column '%s' was not set and does not match filter of"
+ " %s'%s'. Cancelling this CDR.\n",
+ entry->cdrname, entry->negatefiltervalue ? "!" : "",
+ entry->filtervalue);
+ goto early_release;
}
}