aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-15 23:20:40 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-15 23:20:40 +0000
commit1fa7b3672e5f09607934d7c51258af6a7880fecf (patch)
tree54c1bfffaf5270d358da12f64129464467618fc7 /pbx
parentbf38822b6f590035feaa578ee4435b3bcd13df05 (diff)
Switch dundi to new tos config format.
Remove old unused defines for old style. Closes issue 10860, patch by IgorG. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85764 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_dundi.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 860690f09..5bace5d8d 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -115,7 +115,7 @@ static struct sched_context *sched;
static int netsocket = -1;
static pthread_t netthreadid = AST_PTHREADT_NULL;
static pthread_t precachethreadid = AST_PTHREADT_NULL;
-static int tos = 0;
+static unsigned int tos = 0;
static int dundidebug = 0;
static int authdebug = 0;
static int dundi_ttl = DUNDI_DEFAULT_TTL;
@@ -4661,7 +4661,6 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
struct ast_config *cfg;
struct ast_variable *v;
char *cat;
- int format;
int x;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
char hn[MAXHOSTNAMELEN] = "";
@@ -4738,26 +4737,8 @@ static int set_config(char *config_file, struct sockaddr_in* sin, int reload)
else
ast_log(LOG_WARNING, "Invalid global endpoint identifier '%s' at line %d\n", v->value, v->lineno);
} else if (!strcasecmp(v->name, "tos")) {
- if (sscanf(v->value, "%d", &format) == 1)
- tos = format & 0xff;
- else if (!strcasecmp(v->value, "lowdelay"))
- tos = IPTOS_LOWDELAY;
- else if (!strcasecmp(v->value, "throughput"))
- tos = IPTOS_THROUGHPUT;
- else if (!strcasecmp(v->value, "reliability"))
- tos = IPTOS_RELIABILITY;
-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(SOLARIS)
- else if (!strcasecmp(v->value, "mincost"))
- tos = IPTOS_MINCOST;
-#endif
- else if (!strcasecmp(v->value, "none"))
- tos = 0;
- else
-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(SOLARIS)
- ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno);
-#else
- ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', or 'none'\n", v->lineno);
-#endif
+ if (ast_str2tos(v->value, &tos))
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, please read docs/qos.tex\n", v->lineno);
} else if (!strcasecmp(v->name, "department")) {
ast_copy_string(dept, v->value, sizeof(dept));
} else if (!strcasecmp(v->name, "organization")) {