Cherry-pick the change from master for the setRPort in Via header.
Change-Id: Ib13825c94af0e4cfffbbb6ebc4ed264596b80c26
diff --git a/java/gov/nist/javax/sip/header/Via.java b/java/gov/nist/javax/sip/header/Via.java
index 2253394..be40962 100644
--- a/java/gov/nist/javax/sip/header/Via.java
+++ b/java/gov/nist/javax/sip/header/Via.java
@@ -96,6 +96,8 @@
*/
protected String comment;
+ private boolean rPortFlag = false;
+
/** Default constructor
*/
public Via() {
@@ -265,6 +267,7 @@
if (comment != null) {
buffer.append(SP).append(LPAREN).append(comment).append(RPAREN);
}
+ if (rPortFlag) buffer.append(";rport");
return buffer;
}
@@ -324,11 +327,7 @@
* Set the RPort flag parameter
*/
public void setRPort(){
- try {
- this.setParameter(Via.RPORT,"");
- } catch (ParseException e) {
- e.printStackTrace(); // should not occur
- }
+ rPortFlag = true;
}
/**