From d170e5e82926132c72b22079ce0ef996a1f0fab2 Mon Sep 17 00:00:00 2001
From: Jonathan Rose <jrose@digium.com>
Date: Wed, 27 Jul 2011 21:22:12 +0000
Subject: [PATCH] reverting 329840 due to failing tests.  Going to change this
 feature to be purely optional.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 CHANGES                |  1 -
 include/asterisk/cdr.h | 10 ----------
 main/cdr.c             | 25 -------------------------
 main/pbx.c             |  4 +---
 4 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/CHANGES b/CHANGES
index cf8c59be7c..869f2d0e41 100644
--- a/CHANGES
+++ b/CHANGES
@@ -70,7 +70,6 @@ CDR
 --------------------------
  * The filter option in cdr_adaptive_odbc now supports negating the argument,
    thus allowing records which do NOT match the specified filter.
- * Added ability to log CONGESTION calls to CDR
 
 CODECS
 --------------------------
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index 2134e0ffbb..5442fdb0cf 100644
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -58,7 +58,6 @@ enum {
 	AST_CDR_FAILED   = (1 << 1),
 	AST_CDR_BUSY     = (1 << 2),
 	AST_CDR_ANSWERED = (1 << 3),
-	AST_CDR_CONGESTION = (1 << 4),
 };
 
 /*!
@@ -267,15 +266,6 @@ void ast_cdr_answer(struct ast_cdr *cdr);
  */
 extern void ast_cdr_noanswer(struct ast_cdr *cdr);
 
-/*!
- * \brief A call was set to congestion
- * \param cdr the cdr you wish to associate with the call
- * Markst he channel disposition as "CONGESTION"
- * Will skip CDR's in chain with ANS_LOCK bit set. (see
- * forkCDR() application
- */
-extern void ast_cdr_congestion(struct ast_cdr *cdr);
-
 /*!
  * \brief Busy a call
  * \param cdr the cdr you wish to associate with the call
diff --git a/main/cdr.c b/main/cdr.c
index 5d77ea2228..85c513e16d 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -776,26 +776,6 @@ void ast_cdr_noanswer(struct ast_cdr *cdr)
 	}
 }
 
-void ast_cdr_congestion(struct ast_cdr *cdr)
-{
-	char *chan;
-
-	while (cdr) {
-		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
-			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
-
-			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED)) {
-				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
-			}
-
-			if (cdr->disposition < AST_CDR_CONGESTION) {
-				cdr->disposition = AST_CDR_CONGESTION;
-			}
-		}
-		cdr = cdr->next;
-	}
-}
-
 /* everywhere ast_cdr_disposition is called, it will call ast_cdr_failed()
    if ast_cdr_disposition returns a non-zero value */
 
@@ -812,9 +792,6 @@ int ast_cdr_disposition(struct ast_cdr *cdr, int cause)
 		case AST_CAUSE_NO_ANSWER:
 			ast_cdr_noanswer(cdr);
 			break;
-		case AST_CAUSE_NORMAL_CIRCUIT_CONGESTION:
-			ast_cdr_congestion(cdr);
-			break;
 		case AST_CAUSE_NORMAL:
 			break;
 		default:
@@ -984,8 +961,6 @@ char *ast_cdr_disp2str(int disposition)
 		return "BUSY";
 	case AST_CDR_ANSWERED:
 		return "ANSWERED";
-	case AST_CDR_CONGESTION:
-		return "CONGESTION";
 	}
 	return "UNKNOWN";
 }
diff --git a/main/pbx.c b/main/pbx.c
index 7ac3326350..a2054646db 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -9321,10 +9321,8 @@ static int pbx_builtin_congestion(struct ast_channel *chan, const char *data)
 	ast_indicate(chan, AST_CONTROL_CONGESTION);
 	/* Don't change state of an UP channel, just indicate
 	   congestion in audio */
-	if (chan->_state != AST_STATE_UP) {
+	if (chan->_state != AST_STATE_UP)
 		ast_setstate(chan, AST_STATE_BUSY);
-		ast_cdr_congestion(chan->cdr);
-	}
 	wait_for_hangup(chan, data);
 	return -1;
 }
-- 
GitLab