199 | | Win32 may not be implemented due to the API mess above. |
| 199 | Win32 currently is not be implemented. |
| 200 | |
| 201 | [[BR]] |
| 202 | |
| 203 | == Using QoS in PJSIP Applications == |
| 204 | |
| 205 | === PJSUA-LIB === |
| 206 | |
| 207 | On PJSUA-LIB, QoS parameters have been added to {{{pjsua_transport_config}}}. Please see [http://www.pjsip.org/pjsip/docs/html/structpjsua__transport__config.htm pjsua_transport_config reference] for more info. |
| 208 | |
| 209 | ==== Examples ==== |
| 210 | |
| 211 | To set QoS of RTP/RTCP traffic to '''Voice''' type (this will activate the appropriate DSCP, WMM, and SO_PRIORITY settings, if the OS supports it): |
| 212 | |
| 213 | {{{ |
| 214 | pjsua_transport_config rtp_tcfg; |
| 215 | |
| 216 | pjsua_transport_config_default(&rtp_tcfg); |
| 217 | // Set listening start port etc according to app settings |
| 218 | ... |
| 219 | // Set traffic type to Voice |
| 220 | rtp_tcfg.qos_type = PJ_QOS_TYPE_VOICE; |
| 221 | |
| 222 | // Create RTP transports with this config |
| 223 | pjsua_media_transports_create(&rtp_tcfg); |
| 224 | }}} |
| 225 | |
| 226 | To tag SIP transport traffic with a specific DSCP value (in this case, DSCP CS3 or value 24). Note that not all platforms allow this, see the table above: |
| 227 | {{{ |
| 228 | pjsua_transport_config sip_tcfg; |
| 229 | |
| 230 | pjsua_transport_config_default(&sip_tcfg); |
| 231 | // Set listening port etc according to app settings |
| 232 | ... |
| 233 | // Set QoS to DSCP CS3 (DSCP value 24) |
| 234 | sip_tcfg.qos_params.flags = PJ_QOS_PARAM_HAS_DSCP; |
| 235 | sip_tcfg.qos_params.dscp_val = 24; |
| 236 | |
| 237 | // Create SIP transport with this config |
| 238 | pjsua_transport_create(..., &sip_tcfg, ...); |
| 239 | }}} |
| 240 | |
| 241 | |