[asterisk-users] Unable to set TOS to 184?

John A. Sullivan III jsullivan at opensourcedevel.com
Thu Oct 29 20:31:06 CDT 2009


On Thu, 2009-10-29 at 16:36 -0700, Bart Fisher wrote:
> I don't understand this message:
>  
> [2009-10-29 16:31:51] WARNING[28510]: rtp.c:1997 ast_rtp_settos:
> Unable to set TOS to 184
>  
> From what I have read the reason is asterisk can't set TOS if not
> running in root.  Mine is running as asterisk.
>  
> I found one post that says to run at boot:
>  
> #!/bin/bash 
> /sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 4569 -j DSCP
> --set-dscp-class ef
> /sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000
> -j DSCP --set-dscp-class ef
> /sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 5060 -j DSCP
> --set-dscp-class ef
>  
> Does this make sense? Is this the only method to end ths warning?
<snip>
> 
I'm pretty new to Asterisk so take this with a grain of salt. Is it
possible you used decimal (184) instead of hex notation (b8) in your
sip.conf? We're running 1.6.1.6 and it appears to be working just fine.
Here are the pertinent lines from our sip.conf:

tos_audio=0xb0 ; b8 (expedited forwarding) confuses the Linux pfifo_fast
so b0 works better for us
tos_sip=0xb0

The comment is also important in light of the iptables rules you have.
As someone else pointed out, you shouldn't need both.  I prefer to set
them in the application.  For example, if I ever change ports for
whatever reason, I won't have the problem of forgetting to also change
my iptables rules.  Now, I may be wrong about this so I wouldn't mind
feedback from someone who know better than I do, but I think expedited
forwarding (ef = 184 = b8) can shoot you in the foot in Linux.  If you
don't change the default packet queueing from pfifo-fast, I believe it
will not look at the DSCP bits but rather the ToS bits and will place ef
packets into band1 (normal priority) rather than band0 (high priority).
That's why we use b0 instead and then tell our DSCP enabled switches to
place the resultant DSCP values into the highest priority queue.  Hope
that makes sense.  If I'm wrong, please, someone call me out on it.
Thanks - John

-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan at opensourcedevel.com

http://www.spiritualoutreach.com
Making Christianity intelligible to secular society




More information about the asterisk-users mailing list