Does the 2-bit shift for the DSCP value directly in the code, so users have only to set DSCP value in the properties rather than multiply it by 4.

cusax-fix
Sebastien Vincent 14 years ago
parent 35f06fedc5
commit 5bef452c85

@ -2416,10 +2416,10 @@ private void setTrafficClass()
{
try
{
int trafficClass = Integer.parseInt(dscp);
int dscpInt = Integer.parseInt(dscp) << 2;
if(trafficClass > 0)
s.setTrafficClass(trafficClass);
if(dscpInt > 0)
s.setTrafficClass(dscpInt);
}
catch (Exception e)
{

@ -358,7 +358,7 @@ else if (port != 0)
*/
private void setTrafficClass(Socket s)
{
int tc = getTrafficClass();
int tc = getDSCP();
try
{
@ -377,7 +377,7 @@ private void setTrafficClass(Socket s)
*/
private void setTrafficClass(DatagramSocket s)
{
int tc = getTrafficClass();
int tc = getDSCP();
try
{
@ -394,17 +394,17 @@ private void setTrafficClass(DatagramSocket s)
*
* @return SIP traffic class or 0 if not configured
*/
private int getTrafficClass()
private int getDSCP()
{
ConfigurationService configService =
SipActivator.getConfigurationService();
String trafficClass =
String dscp =
(String)configService.getProperty(SIP_DSCP_PROPERTY);
if(trafficClass != null)
if(dscp != null)
{
return Integer.parseInt(trafficClass);
return Integer.parseInt(dscp) << 2;
}
return 0;

@ -407,7 +407,7 @@ protected void setTrafficClass(MediaStreamTarget target, MediaType type)
int trafficClass = 0;
// get traffic class value for RTP audio/video
trafficClass = getTrafficClass(type);
trafficClass = getDSCP(type);
if(trafficClass <= 0)
return;
@ -452,27 +452,27 @@ protected void setTrafficClass(MediaStreamTarget target, MediaType type)
*
* @return SIP traffic class or 0 if not configured
*/
private int getTrafficClass(MediaType type)
private int getDSCP(MediaType type)
{
ConfigurationService configService =
ProtocolMediaActivator.getConfigurationService();
String trafficClass = null;
String dscp = null;
if(type == MediaType.AUDIO)
trafficClass =
dscp =
(String)configService.getProperty(
RTP_AUDIO_DSCP_PROPERTY);
else if(type == MediaType.VIDEO)
trafficClass =
dscp =
(String)configService.getProperty(
RTP_VIDEO_DSCP_PROPERTY);
else
return 0;
if(trafficClass != null)
if(dscp != null)
{
return Integer.parseInt(trafficClass);
return Integer.parseInt(dscp) << 2;
}
return 0;

Loading…
Cancel
Save