[svn-commits] murf: trunk r89623 - in /trunk: ./ apps/ configs/ include/asterisk/ main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Nov 27 00:47:09 CST 2007
Author: murf
Date: Tue Nov 27 00:47:08 2007
New Revision: 89623
URL: http://svn.digium.com/view/asterisk?view=rev&rev=89623
Log:
Merged revisions 89622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r89622 | murf | 2007-11-26 23:24:02 -0700 (Mon, 26 Nov 2007) | 1 line
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.
........
Modified:
trunk/ (props changed)
trunk/apps/app_dial.c
trunk/configs/cdr.conf.sample
trunk/include/asterisk/cdr.h
trunk/main/cdr.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=89623&r1=89622&r2=89623
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Nov 27 00:47:08 2007
@@ -50,6 +50,7 @@
#include "asterisk/app.h"
#include "asterisk/causes.h"
#include "asterisk/rtp.h"
+#include "asterisk/cdr.h"
#include "asterisk/manager.h"
#include "asterisk/privacy.h"
#include "asterisk/stringfields.h"
@@ -820,7 +821,26 @@
}
}
-
+ 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)
ast_poll_channel_del(in, epollo->chan);
Modified: trunk/configs/cdr.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/cdr.conf.sample?view=diff&rev=89623&r1=89622&r2=89623
==============================================================================
--- trunk/configs/cdr.conf.sample (original)
+++ trunk/configs/cdr.conf.sample Tue Nov 27 00:47:08 2007
@@ -12,6 +12,16 @@
; Define whether or not to use CDR logging. Setting this to "no" will override
; any loading of backend CDR modules. Default is "yes".
;enable=yes
+
+; Define whether or not to log unanswered calls. Setting this to "yes" will
+; report every attempt to ring a phone in dialing attempts, when it was not
+; answered. For example, if you try to dial 3 extensions, and this option is "yes",
+; you will get 3 CDR's, one for each phone that was rung. Default is "no". Some
+; find this information horribly useless. Others find it very valuable. Note, in "yes"
+; mode, you will see one CDR, with one of the call targets on one side, and the originating
+; channel on the other, and then one CDR for each channel attempted. This may seem
+; redundant, but cannot be helped.
+;unanswered = no
; Define the CDR batch mode, where instead of posting the CDR at the end of
; every call, the data will be stored in a buffer to help alleviate load on the
Modified: trunk/include/asterisk/cdr.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/cdr.h?view=diff&rev=89623&r1=89622&r2=89623
==============================================================================
--- trunk/include/asterisk/cdr.h (original)
+++ trunk/include/asterisk/cdr.h Tue Nov 27 00:47:08 2007
@@ -100,6 +100,7 @@
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);
Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=89623&r1=89622&r2=89623
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Tue Nov 27 00:47:08 2007
@@ -83,6 +83,7 @@
#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;
@@ -98,6 +99,11 @@
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
@@ -976,8 +982,6 @@
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))
@@ -1241,6 +1245,7 @@
ast_cli(a->fd, "CDR logging: %s\n", enabled ? "enabled" : "disabled");
ast_cli(a->fd, "CDR mode: %s\n", batchmode ? "batch" : "simple");
if (enabled) {
+ ast_cli(a->fd, "CDR output unanswered calls: %s\n", unanswered ? "yes" : "no");
if (batchmode) {
if (batch)
cnt = batch->size;
@@ -1291,6 +1296,7 @@
{
struct ast_config *config;
const char *enabled_value;
+ const char *unanswered_value;
const char *batched_value;
const char *scheduleronly_value;
const char *batchsafeshutdown_value;
@@ -1325,6 +1331,9 @@
if (config) {
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);
More information about the svn-commits
mailing list