[svn-commits] juggie: branch juggie/NoLossCDR r78601 - in /team/juggie/NoLossCDR: ./ main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Aug 8 09:39:31 CDT 2007
Author: juggie
Date: Wed Aug 8 09:39:31 2007
New Revision: 78601
URL: http://svn.digium.com/view/asterisk?view=rev&rev=78601
Log:
readd some removed code
Modified:
team/juggie/NoLossCDR/ (props changed)
team/juggie/NoLossCDR/main/cdr.c
Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
automerge = *
Modified: team/juggie/NoLossCDR/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cdr.c?view=diff&rev=78601&r1=78600&r2=78601
==============================================================================
--- team/juggie/NoLossCDR/main/cdr.c (original)
+++ team/juggie/NoLossCDR/main/cdr.c Wed Aug 8 09:39:31 2007
@@ -79,9 +79,11 @@
static AST_RWLIST_HEAD_STATIC(be_list, ast_cdr_beitem);
#define SAFE_SHUTDOWN_DEFAULT 1
+#define MAX_QUEUE_SIZE_DEFAULT 1000
static int enabled; /*! Is the CDR subsystem enabled ? */
static int safeshutdown;
+static int queuesize;
int check_cdr_enabled()
{
@@ -791,7 +793,7 @@
post_cdr(cdr);
}
-
+/* todo, add a delay after a failure */
static void *do_cdr(void *data)
{
struct ast_cdr_beitem *i = data;
@@ -881,10 +883,14 @@
struct ast_config *config;
const char *enabled_value;
const char *safeshutdown_value;
+ const char *queuesize_value;
+ const char *end_before_h_value;
+ int cfg_queuesize;
int was_enabled;
int res=0;
safeshutdown = SAFE_SHUTDOWN_DEFAULT;
+ queuesize = MAX_QUEUE_SIZE_DEFAULT;
was_enabled = enabled;
enabled = 1;
@@ -895,6 +901,17 @@
if ((safeshutdown_value = ast_variable_retrieve(config, "general", "safeshutdown"))) {
safeshutdown = ast_true(safeshutdown_value);
}
+ if ((queuesize_value = ast_variable_retrieve(config, "general", "size"))) {
+ if (sscanf(queuesize_value, "%d", &cfg_queuesize) < 1)
+ ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", queuesize_value);
+ else if (queuesize_value < 0)
+ ast_log(LOG_WARNING, "Invalid maximum queue size '%d' specified, using default\n", cfg_queuesize);
+ else
+ queuesize = cfg_queuesize;
+ }
+ if ((end_before_h_value = ast_variable_retrieve(config, "general", "endbeforehexten")))
+ ast_set2_flag(&ast_options, ast_true(end_before_h_value), AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN);
+
}
if (enabled) {
More information about the svn-commits
mailing list