]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Correct CDR dispositions for BUSY/FAILED
authorJeff Peeler <jpeeler@digium.com>
Fri, 18 Dec 2009 22:29:51 +0000 (22:29 +0000)
committerJeff Peeler <jpeeler@digium.com>
Fri, 18 Dec 2009 22:29:51 +0000 (22:29 +0000)
This patch is simple in that it reorders the disposition defines so that the fix
for issue 12946 works properly (the default CDR disposition was changed to
AST_CDR_NOANSWER). Also, the AST_CDR_FLAG_ORIGINATED flag was set in ast_call to
ensure all CDR records are written.

The side effects of CDR changes are scary, so I'm documenting the test cases
performed to attempt to catch any regressions. The following tests were all
performed using 1.4 rev 195881 vs head (235571) + patch:

A calls B
C calls B (busy)
Hangup C
Hangup A

(Both SIP and features)
A calls B
A blind transfers to C
Hangup C

(Both SIP and features)
A calls B
A attended transfers to C
Hangup C

A calls B
A attended transfers to C (SIP)
C blind transfers to A (features)
Hangup A

All of the test scenario CDRs matched.

The following tests were performed just with the patch to ensure proper operation
(with unanswered=yes):

exten =>s,1,Answer
exten =>s,n,ResetCDR(w)
exten =>s,n,ResetCDR(w)

exten =>s,1,ResetCDR(w)
exten =>s,n,ResetCDR(w)

(closes issue #16180)
Reported by: aatef
Patches:
      bug16180.patch uploaded by jpeeler (license 325)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@235635 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/cdr.h
main/channel.c

index 738292e98308b271bc026a2d0344bc4aad496435..ee4d0b3027dfafd49b75a3f611b422b5ab8d26e2 100644 (file)
 #define AST_CDR_FLAG_ORIGINATED                (1 << 11)
 
 /*! Disposition */
-#define AST_CDR_NULL                0
-#define AST_CDR_FAILED                         (1 << 0)
-#define AST_CDR_BUSY                           (1 << 1)
-#define AST_CDR_NOANSWER                       (1 << 2)
+#define AST_CDR_NOANSWER                       0
+#define AST_CDR_NULL                (1 << 0)
+#define AST_CDR_FAILED                         (1 << 1)
+#define AST_CDR_BUSY                           (1 << 2)
 #define AST_CDR_ANSWERED                       (1 << 3)
 
 /*! AMA Flags */
index 75d4f72dbfa6e604291b97567bc0818aa2b94d00..23a2ba121dd8218bf8e04e4a883ddbbcfcb9f91c 100644 (file)
@@ -3470,8 +3470,10 @@ int ast_call(struct ast_channel *chan, char *addr, int timeout)
        /* Stop if we're a zombie or need a soft hangup */
        ast_channel_lock(chan);
        if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan)) {
-               if (chan->cdr)
+               if (chan->cdr) {
                        ast_set_flag(chan->cdr, AST_CDR_FLAG_DIALED);
+                       ast_set_flag(chan->cdr, AST_CDR_FLAG_ORIGINATED);
+               }
                if (chan->tech->call)
                        res = chan->tech->call(chan, addr, timeout);
                ast_set_flag(chan, AST_FLAG_OUTGOING);