aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-30 06:26:16 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-30 06:26:16 +0000
commit5ccd44963802ead9756af246243eb39384eea044 (patch)
treee7092725bdc5ef9ca65c6dff1984e877710b625a
parent60636c259914d27a04b43c8bc26dece1871d876a (diff)
convert internal timing to be stored as a flag in the ast_options flags
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16477 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--asterisk.c7
-rw-r--r--channel.c6
-rw-r--r--include/asterisk/options.h6
3 files changed, 9 insertions, 10 deletions
diff --git a/asterisk.c b/asterisk.c
index 9f3b2342e..5f25b0841 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -161,9 +161,6 @@ int option_debug = 0; /*!< Debug level */
double option_maxload = 0.0; /*!< Max load avg on system */
int option_maxcalls = 0; /*!< Max number of active calls */
-int option_internal_timing = 0;
-
-
/*! @} */
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
@@ -1975,7 +1972,7 @@ static void ast_readconfig(void)
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TRANSMIT_SILENCE);
/* Enable internal timing */
} else if (!strcasecmp(v->name, "internal_timing")) {
- option_internal_timing = ast_true(v->value);
+ ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_INTERNAL_TIMING);
} else if (!strcasecmp(v->name, "maxcalls")) {
if ((sscanf(v->value, "%d", &option_maxcalls) != 1) || (option_maxcalls < 0)) {
option_maxcalls = 0;
@@ -2110,7 +2107,7 @@ int main(int argc, char *argv[])
ast_set_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG);
break;
case 'I':
- option_internal_timing = 1;
+ ast_set_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING);
break;
case 'i':
ast_set_flag(&ast_options, AST_OPT_FLAG_INIT_KEYS);
diff --git a/channel.c b/channel.c
index 717a92de0..e392c3a1a 100644
--- a/channel.c
+++ b/channel.c
@@ -2033,9 +2033,9 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
int ast_internal_timing_enabled(struct ast_channel *chan)
{
- int ret = option_internal_timing && chan->timingfd > -1;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Internal timing is %s (option_internal_timing=%d chan->timingfd=%d)\n", ret? "enabled": "disabled", option_internal_timing, chan->timingfd);
+ int ret = ast_opt_internal_timing && chan->timingfd > -1;
+ if (option_debug > 3)
+ ast_log(LOG_DEBUG, "Internal timing is %s (option_internal_timing=%d chan->timingfd=%d)\n", ret? "enabled": "disabled", ast_opt_internal_timing, chan->timingfd);
return ret;
}
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index ba8b8b291..86d524092 100644
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -71,7 +71,9 @@ enum ast_option_flags {
/*! Suppress some warnings */
AST_OPT_FLAG_DONT_WARN = (1 << 18),
/*! End CDRs before the 'h' extension */
- AST_OPT_END_CDR_BEFORE_H_EXTEN = (1 << 19)
+ AST_OPT_END_CDR_BEFORE_H_EXTEN = (1 << 19),
+ /*! Use Zaptel Timing for generators if available */
+ AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20)
};
/*! These are the options that set by default when Asterisk starts */
@@ -97,6 +99,7 @@ enum ast_option_flags {
#define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
#define ast_opt_dont_warn ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
#define ast_opt_end_cdr_before_h_exten ast_test_flag(&ast_options, AST_OPT_END_CDR_BEFORE_H_EXTEN)
+#define ast_opt_internal_timing ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
extern struct ast_flags ast_options;
@@ -104,7 +107,6 @@ extern int option_verbose;
extern int option_debug; /*!< Debugging */
extern int option_maxcalls; /*!< Maximum number of simultaneous channels */
extern double option_maxload;
-extern int option_internal_timing; /*!< Flag for internal timing (RTP) */
extern char defaultlanguage[];
extern time_t ast_startuptime;