Properly Defining DSCP for PJSIP endpoints and trunks

I have a FreePBX 15 deployed with PJSIP throughout. No chan_sip used. I noticed that there are some spotty call quality issues. My sites all have prioritized DSCP 46 traffic on their routers and switches to help transport a bit. When I look in the FreePBX, here is what I see.

Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress....................>
==========================================================================================

Transport:  0.0.0.0-tcp               tcp      3     96  0.0.0.0:6062
Transport:  0.0.0.0-tls               tls      3     96  0.0.0.0:6061
Transport:  0.0.0.0-udp               udp      3     96  0.0.0.0:6060
Transport:  0.0.0.0-ws                 ws      3     96  0.0.0.0:5060
Transport:  0.0.0.0-wss               wss      3     96  0.0.0.0:5060

I assume that tos is analagous to DSCP, correct? In this case I need to set it for 46, EF, 0xB8. Where exactly is this setting found in FreePBX 15?

I can’t help with recommended settings, but if you need to change them you must do so by editing conf files.

Look in /etc/asterisk/pjsip.transports.conf for the format, and if you wish to make changes edit pjsip.transports_custom_post.conf with something like:

[0.0.0.0-udp](+type=transport)
tos=xxxx
cos=yyyy

https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service

Save changes and restart Asterisk. Use pjsip show transport 0.0.0.0-udp to confirm changes stick.

You need to consult the operator of the networks involved for the correct settings, as it depends on how they configure their routers. It is possible that some up market ISPs will support them within their own public infrastructure, but I don’t believe they are supported across arbitrary parts of the internet.

You may well find that your IT department has to add support for them.

Sorry, I ran across a similar post after I asked this question. :man_facepalming:

I looked in the config file and see currently tos=cos3, which equates to a DSCP value of 96 I believe. I’m wondering if I should just change the QoS priority on the site equipment, flipping it from EF to what the FreePBX is using. Might be less disruptive, since I don’t want to restart the FreePBX today. And don’t want to wait until after hours to see if it helps with some sporadic call quality issues.

I’m lucky (and at times unlucky) that I administer the CPE as well. So I can modify things to prioritize this 96 DSCP field value instead. As for where it hands off to the ISP’s equipment, I suppose I won’t have a lot of control over that. I thought the DSCP 46 value was baked into a lot of these deployments. If I’m not mistaken the older FreePBX 13 I had using chan_sip had that as the default?

I added DSCP CS3 aka 24 aka 0x60 as a QoS priority on the site switches and firewall appliances. Should help alleviate potential bottlenecks regarding my CPE. Will monitor and observe today.

UPDATE: Digging deeper I see now that DSCP EF is for the RTP audio packets, and that setting remains the same in the FreePBX 15 config. And DSCP CS3 is for the SIP packets. So this exercise probably wasn’t necessary on my part. Since the DSCP EF packets were already prioritized, and that is the voice audio traffic.

Network QoS Settings:
---------------------------
IP ToS SIP:             CS3
IP ToS RTP audio:       EF
IP ToS RTP video:       AF41
IP ToS RTP text:        CS0
802.1p CoS SIP:         4
802.1p CoS RTP audio:   5
802.1p CoS RTP video:   6
802.1p CoS RTP text:    5
Jitterbuffer enabled:   No

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.