diff -Naur asterisk-84147.orig/channels/chan_h323.c asterisk-84147.patched-tos/channels/chan_h323.c --- asterisk-84147.orig/channels/chan_h323.c 2007-09-24 09:14:10.000000000 +0700 +++ asterisk-84147.patched-tos/channels/chan_h323.c 2007-10-02 10:22:21.000000000 +0700 @@ -54,11 +54,6 @@ #include #include #include -#if defined(BSD) -#ifndef IPTOS_MINCOST -#define IPTOS_MINCOST 0x02 -#endif -#endif #include #include #include diff -Naur asterisk-84147.orig/channels/chan_iax2.c asterisk-84147.patched-tos/channels/chan_iax2.c --- asterisk-84147.orig/channels/chan_iax2.c 2007-09-24 09:14:11.000000000 +0700 +++ asterisk-84147.patched-tos/channels/chan_iax2.c 2007-10-02 10:22:51.000000000 +0700 @@ -108,9 +108,6 @@ thread is actually doing. */ #define DEBUG_SCHED_MULTITHREAD -#ifndef IPTOS_MINCOST -#define IPTOS_MINCOST 0x02 -#endif #ifdef SO_NO_CHECK static int nochecksums = 0; diff -Naur asterisk-84147.orig/channels/chan_mgcp.c asterisk-84147.patched-tos/channels/chan_mgcp.c --- asterisk-84147.orig/channels/chan_mgcp.c 2007-09-24 09:14:11.000000000 +0700 +++ asterisk-84147.patched-tos/channels/chan_mgcp.c 2007-10-02 10:23:08.000000000 +0700 @@ -79,10 +79,6 @@ #include "asterisk/abstract_jb.h" #include "asterisk/event.h" -#ifndef IPTOS_MINCOST -#define IPTOS_MINCOST 0x02 -#endif - /* * Define to work around buggy dlink MGCP phone firmware which * appears not to know that "rt" is part of the "G" package. diff -Naur asterisk-84147.orig/channels/chan_sip.c asterisk-84147.patched-tos/channels/chan_sip.c --- asterisk-84147.orig/channels/chan_sip.c 2007-09-27 10:18:09.000000000 +0700 +++ asterisk-84147.patched-tos/channels/chan_sip.c 2007-10-02 10:15:30.000000000 +0700 @@ -156,9 +156,6 @@ #define XMIT_ERROR -2 #define VIDEO_CODEC_MASK 0x1fc0000 /*!< Video codecs from H.261 thru AST_FORMAT_MAX_VIDEO */ -#ifndef IPTOS_MINCOST -#define IPTOS_MINCOST 0x02 -#endif /* #define VOCAL_DATA_HACK */ diff -Naur asterisk-84147.orig/channels/iax2-provision.c asterisk-84147.patched-tos/channels/iax2-provision.c --- asterisk-84147.orig/channels/iax2-provision.c 2007-08-17 09:17:56.000000000 +0700 +++ asterisk-84147.patched-tos/channels/iax2-provision.c 2007-10-02 10:21:51.000000000 +0700 @@ -51,10 +51,6 @@ #include "iax2-provision.h" #include "iax2-parser.h" -#ifndef IPTOS_MINCOST -#define IPTOS_MINCOST 0x02 -#endif - static int provinit = 0; struct iax_template { diff -Naur asterisk-84147.orig/configs/dundi.conf.sample asterisk-84147.patched-tos/configs/dundi.conf.sample --- asterisk-84147.orig/configs/dundi.conf.sample 2007-06-06 12:51:58.000000000 +0700 +++ asterisk-84147.patched-tos/configs/dundi.conf.sample 2007-10-01 12:48:58.000000000 +0700 @@ -27,6 +27,9 @@ ;bindaddr=0.0.0.0 ;port=4520 ; +; See doc/qos.tex for a description of the tos parameter. +;tos=ef +; ; Our entity identifier (Should generally be the MAC address of the ; machine it's running on. Defaults to the first eth address, but you ; can override it here, as long as you set it to the MAC of *something* diff -Naur asterisk-84147.orig/doc/tex/qos.tex asterisk-84147.patched-tos/doc/tex/qos.tex --- asterisk-84147.orig/doc/tex/qos.tex 2007-07-30 07:47:59.000000000 +0700 +++ asterisk-84147.patched-tos/doc/tex/qos.tex 2007-10-02 10:11:16.000000000 +0700 @@ -53,9 +53,7 @@ The tos* parameters also take numeric values. The lowdelay, throughput, reliability, mincost, and none values are -deprecated because they set the IP TOS using the outdated "IP -precedence" model as defined in RFC 791 and RFC 1349. They still -work in this version of Asterisk, but will be removed in future releases. +removed in current releases. \subsubsection{802.1p CoS values} diff -Naur asterisk-84147.orig/include/asterisk/acl.h asterisk-84147.patched-tos/include/asterisk/acl.h --- asterisk-84147.orig/include/asterisk/acl.h 2007-07-23 08:02:27.000000000 +0700 +++ asterisk-84147.patched-tos/include/asterisk/acl.h 2007-10-02 10:12:25.000000000 +0700 @@ -75,6 +75,7 @@ int ast_str2cos(const char *value, unsigned int *cos); int ast_str2tos(const char *value, unsigned int *tos); + const char *ast_tos2str(unsigned int tos); #if defined(__cplusplus) || defined(c_plusplus) diff -Naur asterisk-84147.orig/main/acl.c asterisk-84147.patched-tos/main/acl.c --- asterisk-84147.orig/main/acl.c 2007-07-23 08:02:28.000000000 +0700 +++ asterisk-84147.patched-tos/main/acl.c 2007-10-02 10:21:15.000000000 +0700 @@ -53,15 +53,6 @@ #include #endif -/* netinet/ip.h may not define the following (See RFCs 791 and 1349) */ -#if !defined(IPTOS_LOWCOST) -#define IPTOS_LOWCOST 0x02 -#endif - -#if !defined(IPTOS_MINCOST) -#define IPTOS_MINCOST IPTOS_LOWCOST -#endif - #include "asterisk/acl.h" #include "asterisk/logger.h" #include "asterisk/channel.h" diff -Naur asterisk-84147.orig/pbx/pbx_dundi.c asterisk-84147.patched-tos/pbx/pbx_dundi.c --- asterisk-84147.orig/pbx/pbx_dundi.c 2007-09-27 10:18:09.000000000 +0700 +++ asterisk-84147.patched-tos/pbx/pbx_dundi.c 2007-10-02 10:13:58.000000000 +0700 @@ -4697,26 +4697,8 @@ 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")) {