0xb8
So I learned this morning that ToS is old-school. According to RFC 2474 we now have the Differentiated Services Field. I came to this realization as I was looking for the ToS bits in Ethereal, which decodes that octet as the Differentiated Services Code Point (DSCP). I found this great article on Precedence and DSCP which explains both ToS and the newer DS Field very well. Go ahead, we'll wait for you to read it.
RFC 2598 defines the Expedited Forwarding PHB, which is what "most" VOIP implementations use, supposedly. The DSCP for Expedited Forwarding is 0x2e. However, the whole octet includes the two unused bits, so left shift twice and you get 0xb8. This is the magic number to use in Asterisk:
; sip.conf and/or iax.conf
[general]
tos=0xb8 ; Expedited Forwarding DSCP
You'll need to restart Asterisk in order for this to take effect; reload is not sufficient.
The Expedited Forwarding DSCP is backwards-compatible with the old ToS field. It breaks down to precedence 5 and the low delay and throughput fields set.
I was rather surprised and disappointed to learn neither that X-Lite, which I use on my iBook, nor Twinkle, which I use in Linux, seem to have any way to set the ToS field, and just use 0x0. If you know how to set ToS on either of those programs I'd sure like to hear it.


