[asterisk-commits] trunk r16477 - in /trunk: asterisk.c channel.c include/asterisk/options.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 29 23:26:18 MST 2006


Author: russell
Date: Thu Mar 30 00:26:16 2006
New Revision: 16477

URL: http://svn.digium.com/view/asterisk?rev=16477&view=rev
Log:
convert internal timing to be stored as a flag in the ast_options flags

Modified:
    trunk/asterisk.c
    trunk/channel.c
    trunk/include/asterisk/options.h

Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=16477&r1=16476&r2=16477&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Thu Mar 30 00:26:16 2006
@@ -160,9 +160,6 @@
 
 double option_maxload = 0.0;			/*!< Max load avg on system */
 int option_maxcalls = 0;			/*!< Max number of active calls */
-
-int option_internal_timing = 0;
-
 
 /*! @} */
 
@@ -1975,7 +1972,7 @@
 			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 @@
 			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);

Modified: trunk/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/channel.c?rev=16477&r1=16476&r2=16477&view=diff
==============================================================================
--- trunk/channel.c (original)
+++ trunk/channel.c Thu Mar 30 00:26:16 2006
@@ -2033,9 +2033,9 @@
 
 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;
 }
 

Modified: trunk/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/options.h?rev=16477&r1=16476&r2=16477&view=diff
==============================================================================
--- trunk/include/asterisk/options.h (original)
+++ trunk/include/asterisk/options.h Thu Mar 30 00:26:16 2006
@@ -71,7 +71,9 @@
 	/*! 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 @@
 #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_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;



More information about the asterisk-commits mailing list