-------------
* Added skinny show device, skinny show line, and skinny show settings CLI commands.
* Proper codec support in chan_skinny.
+ * Added settings for IP and Ethernet QoS requests
+
+MGCP changes
+------------
+ * Added separate settings for media QoS in mgcp.conf
DUNDi changes
-------------
* chan_local.c: the comma delimiter inside the channel name has been changed to a
semicolon, in order to make the Local channel driver compatible with the comma
delimiter change in applications.
+* H323: The "tos" setting has changed name to "tos_audio" and "cos" to "cos_audio"
+ to be compatible with settings in sip.conf. The "tos" and "cos" configuration
+ is deprecated and will stop working in the next release of Asterisk.
Configuration:
if (h323debug)
ast_debug(1, "Created RTP channel\n");
- ast_rtp_setqos(pvt->rtp, tos, cos);
+ ast_rtp_setqos(pvt->rtp, tos, cos, "H323 RTP");
if (h323debug)
ast_debug(1, "Setting NAT on RTP to %d\n", pvt->options.nat);
} else {
memcpy(&bindaddr.sin_addr, hp->h_addr, sizeof(bindaddr.sin_addr));
}
- } else if (!strcasecmp(v->name, "tos")) {
+ } else if (!strcasecmp(v->name, "tos")) { /* Needs to be removed in next release */
+ ast_log(LOG_WARNING, "The \"tos\" setting is deprecated in this version of Asterisk. Please change to \"tos_audio\".\n");
if (ast_str2tos(v->value, &tos)) {
- ast_log(LOG_WARNING, "Invalid tos value at line %d, for more info read doc/qos.tex\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
}
- } else if (!strcasecmp(v->name, "cos")) {
+ } else if (!strcasecmp(v->name, "tos_audio")) {
+ if (ast_str2tos(v->value, &tos)) {
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ }
+ } else if (!strcasecmp(v->name, "cos")) {
+ ast_log(LOG_WARNING, "The \"cos\" setting is deprecated in this version of Asterisk. Please change to \"cos_audio\".\n");
+ if (ast_str2cos(v->value, &cos)) {
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ }
+ } else if (!strcasecmp(v->name, "cos_audio")) {
if (ast_str2cos(v->value, &cos)) {
- ast_log(LOG_WARNING, "Invalid cos value at line %d, for more info read doc/qos.tex\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
}
} else if (!strcasecmp(v->name, "gatekeeper")) {
if (!strcasecmp(v->value, "DISABLE")) {
tosval = ast_variable_retrieve(cfg, "general", "tos");
if (tosval) {
if (ast_str2tos(tosval, &tos))
- ast_log(LOG_WARNING, "Invalid tos value, see doc/qos.tex for more information.\n");
+ ast_log(LOG_WARNING, "Invalid tos value, refer to QoS documentation\n");
}
/* Seed initial cos value */
tosval = ast_variable_retrieve(cfg, "general", "cos");
if (tosval) {
if (ast_str2cos(tosval, &cos))
- ast_log(LOG_WARNING, "Invalid cos value, see doc/qos.tex for more information.\n");
+ ast_log(LOG_WARNING, "Invalid cos value, refer to QoS documentation\n");
}
while(v) {
if (!strcasecmp(v->name, "bindport")){
ast_context_create(NULL, regcontext, "IAX2");
} else if (!strcasecmp(v->name, "tos")) {
if (ast_str2tos(v->value, &tos))
- ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/qos.tex for more information.'\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos")) {
if (ast_str2cos(v->value, &cos))
- ast_log(LOG_WARNING, "Invalid cos value at line %d, see doc/qos.tex for more information.'\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "accountcode")) {
ast_copy_string(accountcode, v->value, sizeof(accountcode));
} else if (!strcasecmp(v->name, "mohinterpret")) {
static ast_group_t cur_pickupgroup = 0;
static unsigned int tos = 0;
-
+static unsigned int tos_audio = 0;
static unsigned int cos = 0;
+static unsigned int cos_audio = 0;
static int immediate = 0;
sub->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
if (sub->rtp && sub->owner)
ast_channel_set_fd(sub->owner, 0, ast_rtp_fd(sub->rtp));
- if (sub->rtp)
+ if (sub->rtp) {
+ ast_rtp_setqos(sub->rtp, tos_audio, cos_audio, "MGCP RTP");
ast_rtp_setnat(sub->rtp, sub->nat);
+ }
#if 0
ast_rtp_set_callback(p->rtp, rtpready);
ast_rtp_set_data(p->rtp, p);
capability &= ~format;
} else if (!strcasecmp(v->name, "tos")) {
if (ast_str2tos(v->value, &tos))
- ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/qos.tex for more information.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "tos_audio")) {
+ if (ast_str2tos(v->value, &tos_audio))
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos")) {
if (ast_str2cos(v->value, &cos))
- ast_log(LOG_WARNING, "Invalid cos value at line %d, see doc/qos.tex for more information.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos_audio")) {
+ if (ast_str2cos(v->value, &cos_audio))
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "port")) {
if (sscanf(v->value, "%d", &ourport) == 1) {
bindaddr.sin_port = htons(ourport);
} else {
ast_verb(2, "MGCP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
- ast_netsock_set_qos(mgcpsock, tos, cos);
+ ast_netsock_set_qos(mgcpsock, tos, cos, "MGCP");
}
}
ast_mutex_unlock(&netlock);
#define DEFAULT_COS_SIP 4
#define DEFAULT_COS_AUDIO 5
#define DEFAULT_COS_VIDEO 6
-#define DEFAULT_COS_TEXT 0
+#define DEFAULT_COS_TEXT 5
#define DEFAULT_ALLOW_EXT_DOM TRUE
#define DEFAULT_REALM "asterisk"
#define DEFAULT_NOTIFYRINGING TRUE
ast_free(p);
return NULL;
}
- ast_rtp_setqos(p->rtp, global_tos_audio, global_cos_audio);
+ ast_rtp_setqos(p->rtp, global_tos_audio, global_cos_audio, "SIP RTP");
ast_rtp_setdtmf(p->rtp, ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
ast_rtp_setdtmfcompensate(p->rtp, ast_test_flag(&p->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
ast_rtp_set_rtptimeout(p->rtp, global_rtptimeout);
ast_rtp_set_rtpholdtimeout(p->rtp, global_rtpholdtimeout);
ast_rtp_set_rtpkeepalive(p->rtp, global_rtpkeepalive);
if (p->vrtp) {
- ast_rtp_setqos(p->vrtp, global_tos_video, global_cos_video);
+ ast_rtp_setqos(p->vrtp, global_tos_video, global_cos_video, "SIP VRTP");
ast_rtp_setdtmf(p->vrtp, 0);
ast_rtp_setdtmfcompensate(p->vrtp, 0);
ast_rtp_set_rtptimeout(p->vrtp, global_rtptimeout);
ast_rtp_set_rtpkeepalive(p->vrtp, global_rtpkeepalive);
}
if (p->trtp) {
- ast_rtp_setqos(p->trtp, global_tos_text, global_cos_text);
+ ast_rtp_setqos(p->trtp, global_tos_text, global_cos_text, "SIP TRTP");
ast_rtp_setdtmf(p->trtp, 0);
ast_rtp_setdtmfcompensate(p->trtp, 0);
}
registry_count++;
} else if (!strcasecmp(v->name, "tos_sip")) {
if (ast_str2tos(v->value, &global_tos_sip))
- ast_log(LOG_WARNING, "Invalid tos_sip value at line %d, recommended value is 'cs3'. See doc/qos.tex.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos_sip value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "tos_audio")) {
if (ast_str2tos(v->value, &global_tos_audio))
- ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, recommended value is 'ef'. See doc/qos.tex.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "tos_video")) {
if (ast_str2tos(v->value, &global_tos_video))
- ast_log(LOG_WARNING, "Invalid tos_video value at line %d, recommended value is 'af41'. See doc/qos.tex.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos_video value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "tos_text")) {
if (ast_str2tos(v->value, &global_tos_text))
- ast_log(LOG_WARNING, "Invalid tos_text value at line %d, recommended value is 'af41'. See doc/qos.tex.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos_text value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos_sip")) {
- ast_str2cos(v->value, &global_cos_sip);
+ if (ast_str2cos(v->value, &global_cos_sip))
+ ast_log(LOG_WARNING, "Invalid cos_sip value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos_audio")) {
- ast_str2cos(v->value, &global_cos_audio);
+ if (ast_str2cos(v->value, &global_cos_audio))
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos_video")) {
- ast_str2cos(v->value, &global_cos_video);
+ if (ast_str2cos(v->value, &global_cos_video))
+ ast_log(LOG_WARNING, "Invalid cos_video value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos_text")) {
- ast_str2cos(v->value, &global_cos_text);
+ if (ast_str2cos(v->value, &global_cos_text))
+ ast_log(LOG_WARNING, "Invalid cos_text value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "bindport")) {
int i;
if (sscanf(v->value, "%d", &i) == 1) {
} else {
ast_verb(2, "SIP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
- ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip);
+ ast_netsock_set_qos(sipsock, global_tos_sip, global_cos_sip, "SIP");
}
}
}
#include "asterisk/sched.h"
#include "asterisk/io.h"
#include "asterisk/rtp.h"
+#include "asterisk/netsock.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/cli.h"
#define DEFAULT_SKINNY_BACKLOG 2
#define SKINNY_MAX_PACKET 1000
+static unsigned int tos = 0;
+static unsigned int tos_audio = 0;
+static unsigned int tos_video = 0;
+static unsigned int cos = 0;
+static unsigned int cos_audio = 0;
+static unsigned int cos_video = 0;
+
static int keep_alive = 120;
static char vmexten[AST_MAX_EXTENSION]; /* Voicemail pilot number */
static char used_context[AST_MAX_EXTENSION]; /* Voicemail pilot number */
ast_channel_set_fd(sub->owner, 3, ast_rtcp_fd(sub->vrtp));
}
if (sub->rtp) {
+ ast_rtp_setqos(sub->rtp, tos_audio, cos_audio, "Skinny RTP");
ast_rtp_setnat(sub->rtp, l->nat);
}
if (sub->vrtp) {
+ ast_rtp_setqos(sub->vrtp, tos_video, cos_video, "Skinny VRTP");
ast_rtp_setnat(sub->vrtp, l->nat);
}
/* Set Frame packetization */
ast_copy_string(regcontext, v->value, sizeof(regcontext));
} else if (!strcasecmp(v->name, "dateformat")) {
memcpy(date_format, v->value, sizeof(date_format));
+ } else if (!strcasecmp(v->name, "tos")) {
+ if (ast_str2tos(v->value, &tos))
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "tos_audio")) {
+ if (ast_str2tos(v->value, &tos_audio))
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "tos_video")) {
+ if (ast_str2tos(v->value, &tos_video))
+ ast_log(LOG_WARNING, "Invalid tos_video value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos")) {
+ if (ast_str2cos(v->value, &cos))
+ ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos_audio")) {
+ if (ast_str2cos(v->value, &cos_audio))
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos_video")) {
+ if (ast_str2cos(v->value, &cos_video))
+ ast_log(LOG_WARNING, "Invalid cos_video value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "allow")) {
ast_parse_allow_disallow(&default_prefs, &default_capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) {
}
ast_verb(2, "Skinny listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
+ ast_netsock_set_qos(skinnysock, tos, cos, "Skinny");
ast_pthread_create_background(&accept_t,NULL, accept_thread, NULL);
}
}
#include "asterisk/sched.h"
#include "asterisk/io.h"
#include "asterisk/rtp.h"
+#include "asterisk/netsock.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/cli.h"
static enum autoprovision autoprovisioning = AUTOPROVISIONING_NO;
static int unistim_keepalive;
static int unistimsock = -1;
+static unsigned int tos = 0;
+static unsigned int tos_audio = 0;
+static unsigned int cos = 0;
+static unsigned int cos_audio = 0;
static struct io_context *io;
static struct sched_context *sched;
static struct sockaddr_in public_ip = { 0, };
sub->owner->fds[0] = ast_rtp_fd(sub->rtp);
sub->owner->fds[1] = ast_rtcp_fd(sub->rtp);
}
- if (sub->rtp)
+ if (sub->rtp) {
+ ast_rtp_setqos(sub->rtp, tos_audio, cos_audio, "UNISTIM RTP");
ast_rtp_setnat(sub->rtp, sub->parent->parent->nat);
+ }
/* Create the RTP connection */
ast_rtp_get_us(sub->rtp, &us);
unistim_keepalive = atoi(v->value);
else if (!strcasecmp(v->name, "port"))
unistim_port = atoi(v->value);
- else if (!strcasecmp(v->name, "autoprovisioning")) {
+ else if (!strcasecmp(v->name, "tos")) {
+ if (ast_str2tos(v->value, &tos))
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "tos_audio")) {
+ if (ast_str2tos(v->value, &tos_audio))
+ ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos")) {
+ if (ast_str2cos(v->value, &cos))
+ ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "cos_audio")) {
+ if (ast_str2cos(v->value, &cos_audio))
+ ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
+ } else if (!strcasecmp(v->name, "autoprovisioning")) {
if (!strcasecmp(v->value, "no"))
autoprovisioning = AUTOPROVISIONING_NO;
else if (!strcasecmp(v->value, "yes"))
"UNISTIM Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), htons(bindaddr.sin_port));
}
+ ast_netsock_set_qos(unistimsock, tos, cos, "UNISTIM");
}
return 0;
}
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 (ast_str2tos(v->value, &cur->tos))
- ast_log(LOG_WARNING, "Invalid tos value at line %d, see doc/qos.tex for more information.\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "user")) {
strncpy(cur->user, v->value, sizeof(cur->user) - 1);
if (strcmp(cur->user, v->value))
;bindaddr=0.0.0.0
;port=4520
;
-; See doc/qos.tex for a description of the tos parameter.
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of the tos parameter.
;tos=ef
;
; Our entity identifier (Should generally be the MAC address of the
[general]
port = 1720
;bindaddr = 1.2.3.4 ; this SHALL contain a single, valid IP address for this machine
-;tos=ef
+;
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
+;tos_audio=ef ; Sets TOS for RTP audio packets.
+;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
;
; You may specify a global default AMA flag for iaxtel calls. It must be
; one of 'default', 'omit', 'billing', or 'documentation'. These flags
;
;authdebug=no
;
-; See doc/qos.tex for a description of the tos parameters.
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
;tos=ef
;cos=5
;
;
flags=register,heartbeat
;
-; See doc/qos.tex for a description of this parameter.
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of this parameter.
;tos=ef
;
; Example iaxy provisioning
;port = 2427
;bindaddr = 0.0.0.0
-; See doc/qos.tex for a description of the tos parameters.
-;tos=ef
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
+;tos=cs3 ; Sets TOS for signaling packets.
+;tos_audio=ef ; Sets TOS for RTP audio packets.
+;cos=3 ; Sets 802.1p priority for signaling packets.
+;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
-; See doc/qos.tex for a description of these parameters.
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.
;tos_video=af41 ; Sets TOS for RTP video packets.
;tos_text=af41 ; Sets TOS for RTP text packets.
-;cos_sip=4 ; Sets CoS for SIP packets.
-;cos_audio=6 ; Sets CoS for RTP audio packets.
-;cos_video=5 ; Sets CoS for RTP video packets.
-;cos_text=0 ; Sets CoS for RTP text packets.
+;cos_sip=3 ; Sets 802.1p priority for SIP packets.
+;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
+;cos_video=4 ; Sets 802.1p priority for RTP video packets.
+;cos_text=3 ; Sets 802.1p priority for RTP text packets.
;maxexpiry=3600 ; Maximum allowed time of incoming registrations
; and subscriptions (seconds)
;allow=all ; see doc/rtp-packetization for framing options
;disallow=
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
+;tos=cs3 ; Sets TOS for signaling packets.
+;tos_audio=ef ; Sets TOS for RTP audio packets.
+;tos_video=af41 ; Sets TOS for RTP video packets.
+;cos=3 ; Sets 802.1p priority for signaling packets.
+;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
+;cos_video=4 ; Sets 802.1p priority for RTP video packets.
+
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
;jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
; skinny channel. Defaults to "no". An enabled jitterbuffer will
[general]
port=5000 ; UDP port
+;
+; See qos.tex or Quality of Service section of asterisk.pdf for a description of these parameters.
+;tos=cs3 ; Sets TOS for signaling packets.
+;tos_audio=ef ; Sets TOS for RTP audio packets.
+;cos=3 ; Sets 802.1p priority for signaling packets.
+;cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
+;
;keepalive=120 ; in seconds, default = 120
;public_ip= ; if asterisk is behind a nat, specify your public IP
;autoprovisioning=no ; Allow undeclared phones to register an extension. See README for important
\subsubsection{Introduction}
-Asterisk can set the Type of Service (TOS) byte on outgoing IP packets
-for various protocols. The TOS byte is used by the network to provide
-some level of Quality of Service (QoS) even if the network is
-congested with other traffic.
+Asterisk support different QoS settings on application level on various protocol
+on any of signaling and media. Type of Service (TOS) byte can be set on
+outgoing IP packets for various protocols. The TOS byte is used by the network
+to provide some level of Quality of Service (QoS) even if the network is
+congested with other traffic.
-Also asterisk running on Linux can set 802.1p CoS marks in VLAN packets
-for all used VoIP protocols. It is useful when you are working in switched
-enviropment. For maping skb-$>$priority and VLAN CoS mark you need to use
-command "vconfig set\_egress\_map [vlan-device] [skb-priority] [vlan-qos]".
+Also asterisk running on Linux can set 802.1p CoS marks in VLAN packets for all
+used VoIP protocols. It is useful when you are working in switched environment.
+In fact asterisk only set priority for Linux socket. For mapping this priority
+and VLAN CoS mark you need to use this command:
-\subsubsection{SIP}
+\begin{verbatim}
+vconfig set_egress_map [vlan-device] [skb-priority] [vlan-qos]
+\end{verbatim}
-In sip.conf, there are three parameters that control the TOS settings:
-"tos\_sip", "tos\_audio" and "tos\_video". tos\_sip controls what TOS SIP
-call signalling packets are set to. tos\_audio controls what TOS RTP audio
-packets are set to. tos\_video controls what TOS RTP video packets are
-set to.
+In table behind shown all voice channels and other modules of asterisk, that
+support QoS settings for network traffic and type of traffic which can have
+QoS settings.
+
+\begin{verbatim}
+ Channel Drivers
++==============+===========+=====+=====+=====+
+| | Signaling |Audio|Video| Text|
++==============+===========+=====+=====+=====+
+|chan_sip | + | + | + | + |
+|--------------+-----------+-----+-----+-----+
+|chan_skinny | + | + | + | |
+|--------------+-----------+-----+-----+-----+
+|chan_mgcp | + | + | | |
+|--------------+-----------+-----+-----+-----+
+|chan_unistim | + | + | | |
+|--------------+-----------+-----+-----+-----+
+|chan_h323 | | + | | |
+|--------------+-----------+-----+-----+-----+
+|chan_iax2 | + |
++==============+=============================+
+ Other
++==============+=============================+
+| dundi.conf | + (tos setting) |
+|--------------+-----------------------------+
+| iaxprov.conf | + (tos setting) |
++==============+=============================+
+\end{verbatim}
+
+
+\subsubsection{IP TOS values}
+
+The allowable values for any of the tos* parameters are:
+CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13, AF21, AF22, AF23,
+AF31, AF32, AF33, AF41, AF42, AF43 and ef (expedited forwarding),
-There are four parameters to control 802.1p CoS: "cos\_sip", "cos\_audio",
-"cos\_video" and "cos\_text". It's behavior the same as writen above.
+The tos* parameters also take numeric values.
-There is a "tos" parameter that is supported for backwards
-compatibility. The tos parameter should be avoided in sip.conf
-because it sets all three tos settings in sip.conf to the same value.
+NOTE, that on Linux system you can not use ef value if your asterisk running
+from user other then root.
+
+The lowdelay, throughput, reliability, mincost, and none values are removed
+in current releases.
+
+\subsubsection{802.1p CoS values}
+
+As far as 802.1p uses 3 bites from VLAN header, there are parameter can take
+integer values from 0 to 7.
+
+\subsubsection{Recommended values}
+Recommended values shown above and also included in sample configuration files:
+\begin{verbatim}
++============+=========+======+
+| | tos | cos |
++============+=========+======+
+|Signaling | cs3 | 3 |
+|Audio | ef | 5 |
+|Video | af41 | 4 |
+|Text | af41 | 3 |
+|Other | ef | |
++============+=========+======+
+\end{verbatim}
\subsubsection{IAX2}
+
In iax.conf, there is a "tos" parameter that sets the global default TOS
for IAX packets generated by chan\_iax2. Since IAX connections combine
signalling, audio, and video into one UDP stream, it is not possible
based upon the type of packet. However different IAXy devices can
have different TOS settings.
-\subsubsection{H.323}
-Also support TOS and CoS.
-
-\subsubsection{MGCP}
-Also support TOS and CoS.
-
-\subsubsection{IP TOS values}
-
-The allowable values for any of the tos* parameters are:
-CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13,
-AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43 and
-ef (expedited forwarding),
-
-The tos* parameters also take numeric values.
-
-The lowdelay, throughput, reliability, mincost, and none values are
-removed in current releases.
+\subsubsection{SIP}
-\subsubsection{802.1p CoS values}
+In sip.conf, there are three parameters that control the TOS settings:
+"tos\_sip", "tos\_audio", "tos\_video" and "tos\_text". tos\_sip controls
+what TOS SIP call signaling packets are set to. tos\_audio, tos\_video
+and tos\_text controls what TOS RTP audio, video or text accordingly
+packets are set to.
-As 802.1p uses 3 bites from VLAN header, there are parameter can take
-integer values from 0 to 7.
+There are four parameters to control 802.1p CoS: "cos\_sip", "cos\_audio",
+"cos\_video" and "cos\_text". It behavior the same as written above.
+\subsubsection{Other RTP channels}
-\begin{verbatim}
-+==============+============+==============+
-|Configuration | Parameter | Recommended |
-|File | Setting | |
-+--------------+------------+--------------+
-| | tos_sip | cs3 |
-| | tos_audio | ef |
-| | tos_video | af41 |
-| sip.conf | tos_text | af41 |
-| | cos_sip | 4 |
-| | cos_audio | 6 |
-| | cos_video | 5 |
-| | cos_text | 0 |
-+--------------+------------+--------------+
-| iax.conf | tos | ef |
-| | cos | 6 |
-+--------------+------------+--------------+
-| iaxprov.conf | tos | ef |
-+--------------+------------+--------------+
-| mgcp.conf | tos | ef |
-| | cos | 6 |
-+--------------+------------+--------------+
-| h323.conf | tos | ef |
-| | cos | 6 |
-+==============+============+==============+
-\end{verbatim}
+chan\_mgcp, chan\_h323, chan\_skinny and chan\_unistim also support TOS and
+CoS via setting tos and cos parameters in correspond to module config
+files. Naming style and behavior same as for chan\_sip.
\subsubsection{Reference}
Service for VoIP networks see the "Enterprise QoS Solution Reference
Network Design Guide" version 3.3 from Cisco at:
\url{http://www.cisco.com/application/pdf/en/us/guest/netsol/ns432/c649/ccmigration\_09186a008049b062.pdf}
-
struct ast_netsock *ast_netsock_find(struct ast_netsock_list *list,
struct sockaddr_in *sa);
-int ast_netsock_set_qos(int netsocket, int tos, int cos);
+int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc);
int ast_netsock_sockfd(const struct ast_netsock *ns);
int ast_rtp_sendcng(struct ast_rtp *rtp, int level);
-int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos);
+int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos, char *desc);
/*! \brief Setting RTP payload types from lines in a SDP description: */
void ast_rtp_pt_clear(struct ast_rtp* rtp);
return NULL;
}
- ast_netsock_set_qos(netsocket, tos, cos);
+ ast_netsock_set_qos(netsocket, tos, cos, "IAX2");
ast_enable_packet_fragmentation(netsocket);
return ns;
}
-int ast_netsock_set_qos(int netsocket, int tos, int cos)
+int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc)
{
int res;
if ((res = setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))))
- ast_log(LOG_WARNING, "Unable to set TOS to %d\n", tos);
- else
- ast_verb(2, "Using TOS bits %d\n", tos);
+ ast_log(LOG_WARNING, "Unable to set %s TOS to %d, may be you have no root privileges\n", desc, tos);
+ else if (tos)
+ ast_verb(2, "Using %s TOS bits %d\n", desc, tos);
#if defined(linux)
if (setsockopt(netsocket, SOL_SOCKET, SO_PRIORITY, &cos, sizeof(cos)))
- ast_log(LOG_WARNING, "Unable to set CoS to %d\n", cos);
- else
- ast_verb(2, "Using CoS mark %d\n", cos);
+ ast_log(LOG_WARNING, "Unable to set %s CoS to %d\n", desc, cos);
+ else if (cos)
+ ast_verb(2, "Using %s CoS mark %d\n", desc, cos);
#endif
return res;
return ast_rtp_new_with_bindaddr(sched, io, rtcpenable, callbackmode, ia);
}
-int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos)
+int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos, char *desc)
{
- return ast_netsock_set_qos(rtp->s, tos, cos);
+ return ast_netsock_set_qos(rtp->s, tos, cos, desc);
}
void ast_rtp_set_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
int ast_udptl_setqos(struct ast_udptl *udptl, int tos, int cos)
{
- return ast_netsock_set_qos(udptl->fd, tos, cos);
+ return ast_netsock_set_qos(udptl->fd, tos, cos, "UDPTL");
}
void ast_udptl_set_peer(struct ast_udptl *udptl, struct sockaddr_in *them)
ast_log(LOG_WARNING, "Invalid global endpoint identifier '%s' at line %d\n", v->value, v->lineno);
} else if (!strcasecmp(v->name, "tos")) {
if (ast_str2tos(v->value, &tos))
- ast_log(LOG_WARNING, "Invalid tos value at line %d, please read docs/qos.tex\n", v->lineno);
+ ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "department")) {
ast_copy_string(dept, v->value, sizeof(dept));
} else if (!strcasecmp(v->name, "organization")) {
return AST_MODULE_LOAD_FAILURE;
}
- ast_netsock_set_qos(netsocket, tos, 0);
+ ast_netsock_set_qos(netsocket, tos, 0, "DUNDi");
if (start_network_thread()) {
ast_log(LOG_ERROR, "Unable to start network thread\n");