[asterisk-commits] russell: trunk r58895 - in /trunk: ./ apps/app_meetme.c configs/sla.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 14 09:34:03 MST 2007


Author: russell
Date: Wed Mar 14 11:34:03 2007
New Revision: 58895

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58895
Log:
Merged revisions 58894 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58894 | russell | 2007-03-14 11:33:01 -0500 (Wed, 14 Mar 2007) | 8 lines

By default, don't attempt to do any CallerID handling at all with SLA because
it is known to not work properly in some situations.  However, add an option to
enable it for those that would like to use it anyway.

The short story behind this is that to properly handle CallerID with SLA, we
need the ability to change the CallerID on an existing call, and we are not
ready to handle that.

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c
    trunk/configs/sla.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=58895&r1=58894&r2=58895
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Mar 14 11:34:03 2007
@@ -496,7 +496,7 @@
 /*!
  * \brief A structure for data used by the sla thread
  */
-static struct sla {
+static struct {
 	/*! The SLA thread ID */
 	pthread_t thread;
 	ast_cond_t cond;
@@ -506,6 +506,9 @@
 	AST_LIST_HEAD_NOLOCK(, sla_failed_station) failed_stations;
 	AST_LIST_HEAD_NOLOCK(, sla_event) event_q;
 	unsigned int stop:1;
+	/*! Attempt to handle CallerID, even though it is known not to work
+	 *  properly in some situations. */
+	unsigned int attempt_callerid:1;
 } sla = {
 	.thread = AST_PTHREADT_NULL,
 };
@@ -3496,7 +3499,8 @@
 		return -1;
 	}
 
-	if (ast_dial_run(dial, ringing_trunk->trunk->chan, 1) != AST_DIAL_RESULT_TRYING) {
+	if (ast_dial_run(dial, sla.attempt_callerid ? ringing_trunk->trunk->chan : NULL, 1) 
+		!= AST_DIAL_RESULT_TRYING) {
 		struct sla_failed_station *failed_station;
 		ast_dial_destroy(dial);
 		if (!(failed_station = ast_calloc(1, sizeof(*failed_station))))
@@ -3956,7 +3960,7 @@
 		return NULL;
 	}
 
-	dial_res = ast_dial_run(dial, trunk_ref->chan, 1);
+	dial_res = ast_dial_run(dial, sla.attempt_callerid ? trunk_ref->chan : NULL, 1);
 	if (dial_res != AST_DIAL_RESULT_TRYING) {
 		ast_mutex_lock(args->cond_lock);
 		ast_cond_signal(args->cond);
@@ -4638,6 +4642,7 @@
 	struct ast_config *cfg;
 	const char *cat = NULL;
 	int res = 0;
+	const char *val;
 
 	ast_mutex_init(&sla.lock);
 	ast_cond_init(&sla.cond, NULL);
@@ -4645,9 +4650,11 @@
 	if (!(cfg = ast_config_load(SLA_CONFIG_FILE)))
 		return 0; /* Treat no config as normal */
 
+	if ((val = ast_variable_retrieve(cfg, "general", "attemptcallerid")))
+		sla.attempt_callerid = ast_true(val);
+
 	while ((cat = ast_category_browse(cfg, cat)) && !res) {
 		const char *type;
-		/* Reserve "general" for ... general stuff! */
 		if (!strcasecmp(cat, "general"))
 			continue;
 		if (!(type = ast_variable_retrieve(cfg, cat, "type"))) {

Modified: trunk/configs/sla.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sla.conf.sample?view=diff&rev=58895&r1=58894&r2=58895
==============================================================================
--- trunk/configs/sla.conf.sample (original)
+++ trunk/configs/sla.conf.sample Wed Mar 14 11:34:03 2007
@@ -6,8 +6,12 @@
 
 ; ---- General Options ----------------
 [general]
-; There are none!
 
+;attemptcallerid=no         ; Attempt CallerID handling.  The default value for this
+                            ; is "no" because CallerID handling with an SLA setup is
+                            ; known to not work properly in some situations.  However,
+                            ; feel free to enable it if you would like.  If you do, and
+                            ; you find problems, please do not report them.
 ; -------------------------------------
 
 



More information about the asterisk-commits mailing list