QoS value for asterisk

I want QoS value for asterisk.How I can get DSCP Packet Markings value for calls in asterisk ? What kind of settings do I need for that ? And how I can monitor QoS for calls in asterisk? I am concerning with asterisk 13 , 14 .Does asterisk 13 , 14 have different settings for QoS value ?
Regards .

You have to set the folowing value for your endpoint:


and the following for transport:


You will then see your TOS and COS value in the console when dialing:

[Mar 3 06:55:31] == Using SIP RTP Audio TOS bits 184
[Mar 3 06:55:31] == Using SIP RTP Audio CoS mark 6

Example of my with pjsip.conf:

type = transport
protocol = udp
bind =
tos = 0x68
cos = 3

type = endpoint
context = default
dtmf_mode = info
disallow = all
allow = ulaw
ice_support = no
direct_media = no
tos_audio = 0xB8
cos_audio = 6

Thank you @phonefxg for your reply.I am not using pjsip.conf.Can you say any alternative solution or this solution can also applicable for sip.conf. Also will you explain the parameters you have used over here ? Regards.

You will not get the COS on incoming packets, as that can be different on every packet (even though that won’t happen in practice). The information already supplied is about outgoing packets, but you should know what you have set that to.

The other problem with CoS on incoming is that you would have to do raw reads of the socket, or use some strange IOCTL to get the information. The RTP handling code will use normal, UDP, reads of the socket.

Thank you @david551 for providing useful information. Why we assigned values to tos , cos, tos_audio and cos_audio ? Regards.