aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-14 16:33:01 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-14 16:33:01 +0000
commitce9eb02aafd02607a09828713431fe5ace7fde8f (patch)
treeda8011124ceaa253d8daf004be58b47c7a1bfee5 /apps/app_meetme.c
parent0c424af77eb66420d5915efc0554a389e6c3bd76 (diff)
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. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58894 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r--apps/app_meetme.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index d1ac07985..e9f74b936 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -502,7 +502,7 @@ struct sla_ringing_station {
/*!
* \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;
@@ -512,6 +512,9 @@ static struct sla {
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,
};
@@ -3486,7 +3489,8 @@ static int sla_ring_station(struct sla_ringing_trunk *ringing_trunk, struct sla_
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))))
@@ -3946,7 +3950,7 @@ static void *dial_trunk(void *data)
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);
@@ -4628,6 +4632,7 @@ static int sla_load_config(void)
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);
@@ -4635,9 +4640,11 @@ static int sla_load_config(void)
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"))) {