aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.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 /apps/app_dial.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 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index c1bb40b95..73d2d4c15 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -57,6 +57,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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"
@@ -762,7 +763,26 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
}
}
-
+ if (peer && !ast_cdr_log_unanswered()) {
+ /* suppress the CDR's that didn't win */
+ struct dial_localuser *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 dial_localuser *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);
+ }
+ }
+ }
+
return peer;
}