[asterisk-commits] mnicholson: branch mnicholson/oldcdr r198179 - in /team/mnicholson/oldcdr: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 29 15:41:04 CDT 2009


Author: mnicholson
Date: Fri May 29 15:41:00 2009
New Revision: 198179

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198179
Log:
Merged revisions 198068 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198068 | mnicholson | 2009-05-29 13:53:01 -0500 (Fri, 29 May 2009) | 15 lines
  
  Use AST_CDR_NOANSWER instead of AST_CDR_NULL as the default CDR disposition.
  
  This change also involves the addition of an AST_CDR_FLAG_ORIGINATED flag that is used on originated channels to distinguish: them from dialed channels.
  
  (closes issue #12946)
  Reported by: meral
  Patches:
        null-cdr2.diff uploaded by mnicholson (license 96)
  Tested by: mnicholson, dbrooks
  
  (closes issue #15122)
  Reported by: sum
  Tested by: sum
........

Modified:
    team/mnicholson/oldcdr/   (props changed)
    team/mnicholson/oldcdr/include/asterisk/cdr.h
    team/mnicholson/oldcdr/main/cdr.c
    team/mnicholson/oldcdr/main/channel.c
    team/mnicholson/oldcdr/res/res_features.c

Propchange: team/mnicholson/oldcdr/
------------------------------------------------------------------------------
    automerge = on

Propchange: team/mnicholson/oldcdr/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 29 15:41:00 2009
@@ -1,1 +1,1 @@
-/branches/1.4:1-198027
+/branches/1.4:1-198178

Modified: team/mnicholson/oldcdr/include/asterisk/cdr.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/oldcdr/include/asterisk/cdr.h?view=diff&rev=198179&r1=198178&r2=198179
==============================================================================
--- team/mnicholson/oldcdr/include/asterisk/cdr.h (original)
+++ team/mnicholson/oldcdr/include/asterisk/cdr.h Fri May 29 15:41:00 2009
@@ -37,6 +37,7 @@
 #define AST_CDR_FLAG_ANSLOCKED      (1 << 8)
 #define AST_CDR_FLAG_DONT_TOUCH     (1 << 9)
 #define AST_CDR_FLAG_DIALED         (1 << 10)
+#define AST_CDR_FLAG_ORIGINATED		(1 << 11)
 
 /*! Disposition */
 #define AST_CDR_NULL                0

Modified: team/mnicholson/oldcdr/main/cdr.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/oldcdr/main/cdr.c?view=diff&rev=198179&r1=198178&r2=198179
==============================================================================
--- team/mnicholson/oldcdr/main/cdr.c (original)
+++ team/mnicholson/oldcdr/main/cdr.c Fri May 29 15:41:00 2009
@@ -862,7 +862,7 @@
 			ast_copy_string(cdr->channel, c->name, sizeof(cdr->channel));
 			set_one_cid(cdr, c);
 
-			cdr->disposition = (c->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NULL;
+			cdr->disposition = (c->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NOANSWER;
 			cdr->amaflags = c->amaflags ? c->amaflags :  ast_default_amaflags;
 			ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
 			/* Destination information */
@@ -1058,6 +1058,15 @@
 			continue;
 		}
 
+		/* don't post CDRs that are for dialed channels unless those
+		 * channels were originated from asterisk (pbx_spool, manager,
+		 * cli) */
+		if (ast_test_flag(cdr, AST_CDR_FLAG_DIALED) && !ast_test_flag(cdr, AST_CDR_FLAG_ORIGINATED)) {
+			ast_set_flag(cdr, AST_CDR_FLAG_POST_DISABLED);
+			continue;
+		}
+
+		chan = S_OR(cdr->channel, "<unknown>");
 		check_post(cdr);
 		if (option_verbose > 1 && ast_tvzero(cdr->end))
 			ast_verbose(VERBOSE_PREFIX_2 "CDR on channel '%s' lacks end\n", chan);
@@ -1106,7 +1115,7 @@
 			cdr->billsec = 0;
 			cdr->duration = 0;
 			ast_cdr_start(cdr);
-			cdr->disposition = AST_CDR_NULL;
+			cdr->disposition = AST_CDR_NOANSWER;
 		}
 	}
 }

Modified: team/mnicholson/oldcdr/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/oldcdr/main/channel.c?view=diff&rev=198179&r1=198178&r2=198179
==============================================================================
--- team/mnicholson/oldcdr/main/channel.c (original)
+++ team/mnicholson/oldcdr/main/channel.c Fri May 29 15:41:00 2009
@@ -3058,6 +3058,7 @@
 			ast_cdr_setaccount(chan, oh->account);	
 	}
 	ast_set_callerid(chan, cid_num, cid_name, cid_num);
+	ast_set_flag(chan->cdr, AST_CDR_FLAG_ORIGINATED);
 
 	if (ast_call(chan, data, 0)) {	/* ast_call failed... */
 		ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);

Modified: team/mnicholson/oldcdr/res/res_features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/oldcdr/res/res_features.c?view=diff&rev=198179&r1=198178&r2=198179
==============================================================================
--- team/mnicholson/oldcdr/res/res_features.c (original)
+++ team/mnicholson/oldcdr/res/res_features.c Fri May 29 15:41:00 2009
@@ -1743,7 +1743,7 @@
 			ast_copy_string(bridge_cdr->lastapp, S_OR(chan->appl, ""), sizeof(bridge_cdr->lastapp));
 			ast_copy_string(bridge_cdr->lastdata, S_OR(chan->data, ""), sizeof(bridge_cdr->lastdata));
 			ast_cdr_setcid(bridge_cdr, chan);
-			bridge_cdr->disposition = (chan->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NULL;
+			bridge_cdr->disposition = (chan->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NOANSWER;
 			bridge_cdr->amaflags = chan->amaflags ? chan->amaflags :  ast_default_amaflags;
 			ast_copy_string(bridge_cdr->accountcode, chan->accountcode, sizeof(bridge_cdr->accountcode));
 			/* Destination information */




More information about the asterisk-commits mailing list