summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-03-10 14:36:16 +0000
committerJoshua Colp <jcolp@digium.com>2008-03-10 14:36:16 +0000
commitaf7e1964f2a18f7aa1ee6acb6b3c53dc3bcf1f83 (patch)
tree9acc63d035d6b98d272790db611985a077286de2
parentf5bee50ad1182c524e176cd0997a5d6f5c27a7f3 (diff)
Merged revisions 107016 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r107016 | file | 2008-03-10 11:33:02 -0300 (Mon, 10 Mar 2008) | 7 lines Move where unanswered CDRs are dropped to the CDR core, not everything uses app_dial. (closes issue #11516) Reported by: ys Patches: branch_1.4_cdr.diff uploaded by ys (license 281) Tested by: anest, jcapp, dartvader ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_dial.c17
-rw-r--r--include/asterisk/cdr.h1
-rw-r--r--main/cdr.c11
3 files changed, 6 insertions, 23 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index dfd6f8306..ecc437ba6 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -836,23 +836,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
if (!*to || ast_check_hangup(in))
ast_cdr_noanswer(in->cdr);
}
- if (peer && !ast_cdr_log_unanswered()) {
- /* suppress the CDR's that didn't win */
- struct chanlist *o;
- for (o = outgoing; o; o = o->next) {
- struct ast_channel *c = o->chan;
- if (c && c != peer && c->cdr)
- ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);
- }
- } else if (!peer && !ast_cdr_log_unanswered()) {
- /* suppress the CDR's that didn't win */
- struct chanlist *o;
- for (o = outgoing; o; o = o->next) {
- struct ast_channel *c = o->chan;
- if (c && c->cdr)
- ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);
- }
- }
#ifdef HAVE_EPOLL
for (epollo = outgoing; epollo; epollo = epollo->next) {
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index e8727ab4c..02d2eb35d 100644
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -106,7 +106,6 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
int ast_cdr_serialize_variables(struct ast_cdr *cdr, struct ast_str **buf, char delim, char sep, int recur);
void ast_cdr_free_vars(struct ast_cdr *cdr, int recur);
int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr);
-int ast_cdr_log_unanswered(void);
typedef int (*ast_cdrbe)(struct ast_cdr *cdr);
diff --git a/main/cdr.c b/main/cdr.c
index 929ebcef4..183252438 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -102,11 +102,6 @@ int check_cdr_enabled()
return enabled;
}
-int ast_cdr_log_unanswered(void)
-{
- return unanswered;
-}
-
/*! Register a CDR driver. Each registered CDR driver generates a CDR
\return 0 on success, -1 on failure
*/
@@ -985,6 +980,12 @@ static void post_cdr(struct ast_cdr *cdr)
struct ast_cdr_beitem *i;
for ( ; cdr ; cdr = cdr->next) {
+ if (!unanswered && cdr->disposition < AST_CDR_ANSWERED && (ast_strlen_zero(cdr->channel) || ast_strlen_zero(cdr->dstchannel))) {
+ /* For people, who don't want to see unanswered single-channel events */
+ ast_set_flag(cdr, AST_CDR_FLAG_POST_DISABLED);
+ continue;
+ }
+
chan = S_OR(cdr->channel, "<unknown>");
check_post(cdr);
if (ast_tvzero(cdr->end))