diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-28 03:28:52 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-28 03:28:52 +0000 |
commit | 7c697789d6cce6e95c7297bfcddbc600efe83eed (patch) | |
tree | 2b87d0a9e58db877d4d925a55015ca72d877001d /channels/iax2-provision.c | |
parent | 0d346196f902203b34c480881c27367ae49b522d (diff) |
improve IP TOS support for SIP and IAX2 (issue #6355, code from jcollie plus modifications)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15435 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-provision.c')
-rw-r--r-- | channels/iax2-provision.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c index 990c0f002..da43dc4e6 100644 --- a/channels/iax2-provision.c +++ b/channels/iax2-provision.c @@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/md5.h" #include "asterisk/astdb.h" #include "asterisk/utils.h" +#include "asterisk/acl.h" #include "iax2.h" #include "iax2-provision.h" #include "iax2-parser.h" @@ -328,20 +329,8 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, } else ast_log(LOG_WARNING, "Ignoring invalid codec '%s' for '%s' at line %d\n", v->value, s, v->lineno); } else if (!strcasecmp(v->name, "tos")) { - if (sscanf(v->value, "%d", &x) == 1) - cur->tos = x & 0xff; - else if (!strcasecmp(v->value, "lowdelay")) - cur->tos = IPTOS_LOWDELAY; - else if (!strcasecmp(v->value, "throughput")) - cur->tos = IPTOS_THROUGHPUT; - else if (!strcasecmp(v->value, "reliability")) - cur->tos = IPTOS_RELIABILITY; - else if (!strcasecmp(v->value, "mincost")) - cur->tos = IPTOS_MINCOST; - else if (!strcasecmp(v->value, "none")) - cur->tos = 0; - else - ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno); + if (ast_str2tos(v->value, &cur->tos)) + ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/iptos.txt for more information.\n", v->lineno); } else if (!strcasecmp(v->name, "user")) { strncpy(cur->user, v->value, sizeof(cur->user) - 1); if (strcmp(cur->user, v->value)) @@ -453,7 +442,7 @@ static int iax_show_provisioning(int fd, int argc, char *argv[]) ast_cli(fd, "Alternate: %s\n", iax_server(iabuf, sizeof(iabuf), cur->altserver)); ast_cli(fd, "Flags: %s\n", iax_provflags2str(iabuf, sizeof(iabuf), cur->flags)); ast_cli(fd, "Format: %s\n", ast_getformatname(cur->format)); - ast_cli(fd, "TOS: %d\n", cur->tos); + ast_cli(fd, "TOS: 0x%x\n", cur->tos); found++; } } |