aboutsummaryrefslogtreecommitdiffstats
path: root/main/cdr.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-27 06:24:02 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-27 06:24:02 +0000
commit6c6ed9fc34a674121fba4b3b34e7f01986efa928 (patch)
tree1ee0dade3bbe83acc24c3d210d3c7812105980ba /main/cdr.c
parent820612d2f8bb542a9c9aa14d6aea10dee452c9fd (diff)
closes issue #11379; OK, this is an attempt to make both sides happy. To the cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89622 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 5aa7a24f1..0bed0cfda 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -89,6 +89,7 @@ static pthread_t cdr_thread = AST_PTHREADT_NULL;
#define BATCH_SAFE_SHUTDOWN_DEFAULT 1
static int enabled; /*! Is the CDR subsystem enabled ? */
+static int unanswered;
static int batchmode;
static int batchsize;
static int batchtime;
@@ -102,6 +103,11 @@ AST_MUTEX_DEFINE_STATIC(cdr_pending_lock);
static ast_cond_t cdr_pending_cond;
+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
*/
@@ -984,8 +990,6 @@ static void post_cdr(struct ast_cdr *cdr)
struct ast_cdr_beitem *i;
for ( ; cdr ; cdr = cdr->next) {
- if (cdr->disposition < AST_CDR_ANSWERED && (ast_strlen_zero(cdr->channel) || ast_strlen_zero(cdr->dstchannel)))
- continue; /* people don't want to see unanswered single-channel events */
chan = S_OR(cdr->channel, "<unknown>");
check_post(cdr);
if (ast_tvzero(cdr->end))
@@ -1247,6 +1251,7 @@ static int handle_cli_status(int fd, int argc, char *argv[])
ast_cli(fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled");
ast_cli(fd, "CDR mode: %s\n", batchmode ? "batch" : "simple");
if (enabled) {
+ ast_cli(fd, "CDR output unanswered calls: %s\n", unanswered ? "yes" : "no");
if (batchmode) {
if (batch)
cnt = batch->size;
@@ -1298,6 +1303,7 @@ static int do_reload(void)
{
struct ast_config *config;
const char *enabled_value;
+ const char *unanswered_value;
const char *batched_value;
const char *scheduleronly_value;
const char *batchsafeshutdown_value;
@@ -1329,6 +1335,9 @@ static int do_reload(void)
if ((enabled_value = ast_variable_retrieve(config, "general", "enable"))) {
enabled = ast_true(enabled_value);
}
+ if ((unanswered_value = ast_variable_retrieve(config, "general", "unanswered"))) {
+ unanswered = ast_true(unanswered_value);
+ }
if ((batched_value = ast_variable_retrieve(config, "general", "batch"))) {
batchmode = ast_true(batched_value);
}