[asterisk-commits] juggie: branch juggie/NoLossCDR r82379 - /team/juggie/NoLossCDR/main/cdr.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 14 10:30:04 CDT 2007
Author: juggie
Date: Fri Sep 14 10:30:04 2007
New Revision: 82379
URL: http://svn.digium.com/view/asterisk?view=rev&rev=82379
Log:
commiting some stuff so someone else can take a look
Modified:
team/juggie/NoLossCDR/main/cdr.c
Modified: team/juggie/NoLossCDR/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cdr.c?view=diff&rev=82379&r1=82378&r2=82379
==============================================================================
--- team/juggie/NoLossCDR/main/cdr.c (original)
+++ team/juggie/NoLossCDR/main/cdr.c Fri Sep 14 10:30:04 2007
@@ -81,10 +81,12 @@
#define SAFE_SHUTDOWN_DEFAULT 1
#define MAX_QUEUE_SIZE_DEFAULT 1000
+#define RETRY_DELAY_DEFAULT 30
static int enabled; /*! Is the CDR subsystem enabled ? */
static int safeshutdown;
static int queuesize;
+static int retrydelay;
int check_cdr_enabled()
{
@@ -834,7 +836,7 @@
break;
} else if (be_res == AST_CDR_POST_RETRY) {
ast_debug(1, "cdr insert into %s temporarily failed, retrying\n", i->name);
- tv = ast_tvadd(ast_tvnow(), ast_samp2tv(30000, 1000));
+ tv = ast_tvadd(ast_tvnow(), ast_samp2tv(retrydelay * 1000, 1000));
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;
ast_cond_timedwait(&i->cdr_retry_cond, &i->cdr_queue.lock, &ts);
@@ -894,13 +896,16 @@
const char *enabled_value;
const char *safeshutdown_value;
const char *queuesize_value;
+ const char *retrydelay_value;
const char *end_before_h_value;
int cfg_queuesize;
+ int cfg_retrydelay;
int was_enabled;
int res=0;
safeshutdown = SAFE_SHUTDOWN_DEFAULT;
queuesize = MAX_QUEUE_SIZE_DEFAULT;
+ retrydelay = RETRY_DELAY_DEFAULT;
was_enabled = enabled;
enabled = 1;
@@ -919,6 +924,15 @@
else
queuesize = cfg_queuesize;
}
+ if ((retrydelay_value = ast_variable_retrieve(config, "general", "retrydelay"))) {
+ if (sscanf(retrydelay_value, "%d", &cfg_retrydelay) < 1)
+ ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", retrydelay_value);
+ else if (retrydelay_value < 0)
+ ast_log(LOG_WARNING, "Invalid maximum queue size '%d' specified, using default\n", cfg_retrydelay);
+ else
+ retrydelay = cfg_retrydelay;
+ }
+
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);
More information about the asterisk-commits
mailing list