My provider called me to say that my rtp packages aren’t marked correctly for QoS. They use TOS (type of service) 46 (or ef or 0xb8) to prioritize the rtp stream.
I grabed some packages with tcpdump and really there isn’t. I have seen that FreePBX mark same rtp with old chan_sip by default but not with chan_pjsip. I found a tip in this forum (QoS / ToS / DSCP not configurable and defaulting to no priority with PJSIP) to add an entry ‘tos_audio=ef’ in file ‘pjsip_endpoint_custom_post.conf’. This is an uncomfortable solution for the trunk.
Then I checked that all packages from my internal devices to FreePBX server are marked also, but no one from server to the device.
Itsn’t it possible to mark rtp packages via pjsip by default by adding the line ‘tos_audio=ef’ in ‘pjsip_endpoint.conf’ in each extension.
You can set the tos (and cos) at the transport level by editing the file /etc/asterisk/pjsip.transports_custom_post.conf and adding the lines:
Then reload with
fwconsole r and confirm the setting with:
[[email protected] ~]# asterisk -x “pjsip show transports”
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress....................>
Transport: 0.0.0.0-tcp tcp 0 0 0.0.0.0:5160
Transport: 0.0.0.0-tls tls 0 0 0.0.0.0:5161
Transport: 0.0.0.0-udp udp 184 184 0.0.0.0:5160
You can do the same with TCP and TLS if necessary by adding sections:
Thank you for your answer. That’s the half way only. I entered your proposed transport tos and cos values. PJSIP shows 184 on both also.
BUT this is SIP signaling and not the audio stream package of RTP. My UDP (and TLS) packages with SIP have a DSCP value “ef” now (checked with tcpdump). The RTP package from FreePBX to client device have still value ‘cs0’.
I think this is settable in section “endpoint” per extension only with “tos_audio=ef”.