diff options
-rw-r--r-- | asterisk.c | 7 | ||||
-rw-r--r-- | channel.c | 6 | ||||
-rw-r--r-- | include/asterisk/options.h | 6 |
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); @@ -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; |