Summary:ASTERISK-06194: PATCH: Set IP TOS separately for SIP packets, RTP audio packets, and RTP video packets
Reporter:Jeffrey C. Ollie (jcollie)Labels:
Date Opened:2006-01-25 22:41:27.000-0600Date Closed:2008-01-15 16:29:48.000-0600
Versions:Frequency of
Environment:Attachments:( 0) qos-1.2-patch.txt
( 1) qos-trunk-patch.txt
( 2) qos-trunk-patch-2.txt
( 3) qos-trunk-patch-8938.txt
Description:Currently, Asterisk lets you set the same IP TOS for all packets that a SIP channel could generate (SIP call signalling packets, RTP audio packets, and RTP video packets).  However, different types of packets have different quality of
service requirements.  For more information, see the "Enterprise QoS Solution Reference Network Design Guide" from Cisco:



Attached are patches for branch/1.2 and trunk that allow chan_sip to set different IP TOS values for the different kids of packets.
Comments:By: Olle Johansson (oej) 2006-01-26 02:04:43.000-0600

I do like this patch! THank you.

Some comments:

1) The error messages needs to be corrected, they refer to the old values
2) We should create a README.tos and move your explanation from sip.conf there and refer to it. The sip.conf.sample is growing into an unmanagable file as is.
3) We cannot change the default behaviour of today really. So let's enable the new recommended
values in sip.conf.sample and keep it at zero in the source. (It's a policy of the dev team to be very careful in changing default behaviour).

We won't add new features to 1.2, so keep updating the trunk version.

By: Jeffrey C. Ollie (jcollie) 2006-01-26 14:26:12.000-0600

Here's a new patch against rev 8749 of trunk that addresses your comments.

By: Olle Johansson (oej) 2006-01-26 14:41:45.000-0600

That's fast. THank you. I will look at it over the weekend.

By: Olle Johansson (oej) 2006-01-28 08:38:31.000-0600

Do we have to deprecate the old tos setting values or can we match them to the new values? Removing them harms backwards compatibility. If we need to, we have to, but if it is possible to have a translation path that would be good.

We will have to implement the same setting values in chan_iax2.c as well.

By: Olle Johansson (oej) 2006-01-28 08:40:39.000-0600

Sorry, did not see the changes in acl.c. The old settings is already there. But this means that other configs that use tos settings will get the output as well. We need to update the iax.conf sample config I guess, maybe others.

By: Jeffrey C. Ollie (jcollie) 2006-01-30 15:03:31.000-0600

Updated patch...  README.tos now addresses sip.conf, iax.conf, and iaxprov.conf, the only places that I could find TOS settings in the config files.  Also updated chan_iax2.c and iax2-provision.c to give proper errors.  Also updated iax2-provision.c to use ast_str2tos rather than it's own (outdated) copy of the TOS parsing code.

By: Olle Johansson (oej) 2006-01-31 07:24:37.000-0600

Opening a new branch for this issue to keep the patch up to date while waiting for review


By: Olle Johansson (oej) 2006-01-31 07:25:08.000-0600

Btw, the new settings also comply with SIP forum's PBX interoperability recommendations.

By: Jeffrey C. Ollie (jcollie) 2006-01-31 07:44:16.000-0600

I found a draft of the "IP PBX / Service Provider Interoperability" document that OEJ mentions at:


The QoS information is in Section 13 on page 16.  The main page for the SIP Forum's IP PBX / SP Interop TG can be found at:


The archives of their mailing list can be found here:


By: Olle Johansson (oej) 2006-02-09 08:21:58.000-0600

I am amazed by the number of test reports we get.

Updated to current trunk.

By: Jeffrey C. Ollie (jcollie) 2006-02-09 08:43:57.000-0600

Hmm... yes, would be nice to get test reports from someone else.  I've been running a patched 1.2 in production (unfortunately on a relatively lightly loaded system) with no ill effects for a while now.

By: Olle Johansson (oej) 2006-03-04 17:03:42.000-0600

Any idea what we can use for UDPTL for T.38 - the same as Audio or something else?

By: Jeffrey C. Ollie (jcollie) 2006-03-06 21:38:58.000-0600

I can't find anything that specifically states what DSCP packets containing T.38 data should be marked with.  However, it appears that Cisco devices would use the same DSCP as they would use for audio data.  So I would think that EF would be the best choice.

By: Olle Johansson (oej) 2006-03-07 01:08:28.000-0600

Thanks for the feedback.

By: Olle Johansson (oej) 2006-03-07 15:21:29.000-0600

This is ready for svn trunk.

By: Olle Johansson (oej) 2006-03-07 15:22:08.000-0600

The code is in the /team/oej/iptos branch.

By: Jared Smith (jsmith) 2006-03-13 13:08:19.000-0600

I've tested this as part of Olle's test-this-branch branch, and it looks great!  I  only have 2 minor concerns:

1)  The debug messages point to the wrong README file (README.tos instead of ip-tos.txt)
2)  If I issue an "IAX2 reload" from the Asterisk CLI, I get the following debug message, even though tos isn't set to lowdelay in iax.conf:

Mar 13 12:03:38 WARNING[32280]: acl.c:262 ast_str2tos: tos value lowdelay is deprecated.  See doc/README.tos for more information.

Other than those two little things, I think this is probably ready for trunk (in my humble opinion).

By: Olle Johansson (oej) 2006-03-27 21:29:59.000-0600

Committed to svn trunk revision 15435

- Changed the settings to IANA registered types
- Made a conversion table to/from string to value

Thanks for your work!

By: Olle Johansson (oej) 2006-03-27 21:30:58.000-0600

- removing branch "team/oej/iptos"

By: Digium Subversion (svnbot) 2008-01-15 16:29:48.000-0600

Repository: asterisk
Revision: 8973

A   team/oej/iptos/

r8973 | oej | 2008-01-15 16:29:47 -0600 (Tue, 15 Jan 2008) | 2 lines

Issue ASTERISK-6194 - update of IP TOS settings for IAX and SIP