Ubiquiti EdgeRouter QoS with 3CX Softphones question

Status
Not open for further replies.

L Monroe

Free User
Joined
Jul 17, 2010
Messages
33
Reaction score
3
Hi everyone,

Our 3CX is hosted on AWS in the cloud, but we all use 3CX Softphone either on Windows or on our cell phones. We use Ubiquiti EdgeRouter and I'm trying to set up traffic shaping to prioritize VoIP/SIP traffic and had a question. In the example, it sets a traffic queue to prioritize traffic marked with IP DSCP value 46 and 24 which it said are for SIP but then said to check with your manufacturer in case they use something different. Since I have to prioritize the SIP using DSCP values, I was just wondering which I'd use for the 3CX Softphone? I found online on other 3CX threads that this seems to be correct but wanted to confirm. Thanks!
 
Softphone and mobile app will use 3cx tunnel port 5090 tcp and udp
 
Softphone and mobile app will use 3cx tunnel port 5090 tcp and udp

Yes I'm aware of that, but that's not what my question was? I asked if it's DSCP classification 24 and 46 for SIP not what ports SIP uses.
 
Yes , I believe 24 and 46 are for sip, but the clients do not use sip protocol
 
DSCP code 46 is normally what IP phone manufacturers configure handsets as default. As with above I would just go with this.

One point however, are you using the 3CX App stand alone (without handset) and with or without the 3CX tunnel as the tunnel has been known to mask traffic traversing it entirety so this maybe a pointless exercise.
 
Well, I've made a short tcpdump on my router and it seems the UDP packets sent by 3CX PBX and also the packets sent by the iOS 3CX app have DSCP value 0 while it actually should be 46 (decimal).
:(

The 3CX PBX is hosted on Amazon Lightsail and was set up with the automatic script by 3CX. There probably is a iptables rule missing, that sets the DSCP value.

AFAIK iOS apps also can set DSCP value of their packets. IIRC I already had VoIP apps that send their packages with DSCP 46.

EDIT:
Indeed on the PBX server there are no iptables rules set. You can set them with:
Bash:
sudo iptables -t mangle -A OUTPUT -p udp -m multiport --sports sip,5090 -j DSCP --set-dscp 56
sudo iptables -t mangle -A OUTPUT -p tcp -m multiport --sports sip,5090 -j DSCP --set-dscp 56

If you want to make the rules persistent after a reboot:
Bash:
sudo su
apt-get install iptables-persistent
iptables-save > /etc/iptables/rules.v4
 
Last edited:
  • Like
Reactions: Evolute IT
Hi,
could not edit last post anymore, so here my updated rules:
Bash:
sudo iptables -t mangle -A OUTPUT -p udp -m multiport --sports sip,5090,9000:10999 -j DSCP --set-dscp 46
sudo iptables -t mangle -A OUTPUT -p tcp -m multiport --sports https,sip,sip-tls,5090 -j DSCP --set-dscp 46

Changelog:
  • Added https to tcp rule (WebRTC)
  • Added sip-tls to tcp rule
  • Added ports 9000-10999 to udp rule (RTP)
See: https://www.3cx.com/docs/manual/firewall-router-configuration/

EDIT: Changed DSCP value to 46 (see: https://www.cisco.com/c/en/us/td/do...ration/guide/nexus1000v_qos/qos_6dscp_val.pdf )
 
Last edited:
Last edited:
The Linux guide changes DSCP value of all traffic, which is not the way it is intended :rolleyes: Also the correct DSCP value apparantly is 46.
 
Hello,
I'm facing the same situation.
have you implemented the solution proposed here?
does it work without any unpleasant surprises?

One day 3CX will have to natively implement QoS since we are led to use more and more software instead of office phones.

there is a parameter in 3CX: MSRTPTOS, but obviously it doesn't work, even after server reboot and re-provisioning.

BR.
 
I made the iptables changes on my 3CX hosted on Amazon cloud. But actually that is useless because routers override the value again. So the packets that arrive at my site do not have the DSCP value anymore.

But what I am still missing is that the iOS app uses correct DSCP values, so my own switches/routers could prioritize the traffic in-house.
 
If you have so much traffic on your internal network that you need to QoS your voice to solve them then you have other issues, likely with network design.
 
I do not have that much traffic, this is just a nice to have feature. Or in other words: there is no reason not to use the correct DSCP value.
 
There are lots of 'nice to have' features that 3CX is missing, the ideas forums are littered with them. QoS is designed to solve the problem of bandwidth contention and in almost all cases is a band-aid for when you can't resolve the issue (such as being somewhere with limited internet options). It's also not magical so if you know enough understand how QoS works and what it can and can't do, then you should know enough to configure it manually as you are going to have configure your network infrastructure anyways. On the contrary, having a QoS easy button in 3CX is more likely to create scenarios with people putting 3CX (or any VoIP solution for that matter) in a poor network environment, checking the QoS box and then complaining calls sound like crap.

As another poster pointed out true QoS requires end to end honoring of the tags and many providers will strip or overwrite the tags anyways, especially for cloud installs. So it's really a small minority of 3CX users that would benefit from this vs a real PBX issue such as the lack of outbound CID control for E911 purposes for example.
 
From my point of view, it makes sense to ask the 3CX to do its part of the job, namely to properly mark its packages.
Thus, less work is required from network equipment that is sometimes heavily used, and we keep the possibility of deploying 3CX client on a partially adapted network.
Typically, on a Ubiquiti Unifi infrastructure, switches correctly transfer packets, but are unable to mark them...
In fact, I am in favour of making things simpler, without being simplistic.
And for end-to-end QoS, in practice the bottleneck is the customer's Internet access, what interests me is that the traffic is correctly prioritized at my customer's site, beyond that, the infrastructures are more than enough to make it work well.

sorry for sometimes poor translations.
 
Status
Not open for further replies.

Members Online Now

No members online now.

Forum statistics

Threads
111,832
Messages
589,285
Members
164,662
Latest member
DejanMDS