From 86a463fd9b1f10d4510f8c1fa6c1721d61f6b2ea Mon Sep 17 00:00:00 2001 From: Zeki Yugnak Date: Thu, 27 Dec 2018 20:14:55 +0300 Subject: [PATCH] Address with Text attribute fix. According to the SIP rfc4244 document. --- src/gov/nist/javax/sip/parser/URLParser.java | 1 + src/test/unit/gov/nist/javax/sip/parser/AddressParserTest.java | 2 ++ src/test/unit/gov/nist/javax/sip/parser/URLParserTest.java | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/gov/nist/javax/sip/parser/URLParser.java b/src/gov/nist/javax/sip/parser/URLParser.java index 402c00130..afa7e46b8 100755 --- a/src/gov/nist/javax/sip/parser/URLParser.java +++ b/src/gov/nist/javax/sip/parser/URLParser.java @@ -137,6 +137,7 @@ protected String paramNameOrValue() throws ParseException { case '&': case '+': case '$': + case '\"': isValidChar = true; } if (isValidChar || isUnreserved(next)) { diff --git a/src/test/unit/gov/nist/javax/sip/parser/AddressParserTest.java b/src/test/unit/gov/nist/javax/sip/parser/AddressParserTest.java index ecc76155f..8be9c29de 100755 --- a/src/test/unit/gov/nist/javax/sip/parser/AddressParserTest.java +++ b/src/test/unit/gov/nist/javax/sip/parser/AddressParserTest.java @@ -47,6 +47,8 @@ public void testParser() { "", "\"M. Ranganathan\" ", "", + ";index=1", + ";index=1", "M. Ranganathan " }; try { for (int i = 0; i < addresses.length; i++) { diff --git a/src/test/unit/gov/nist/javax/sip/parser/URLParserTest.java b/src/test/unit/gov/nist/javax/sip/parser/URLParserTest.java index f7a5c1db6..25c0a9d0a 100755 --- a/src/test/unit/gov/nist/javax/sip/parser/URLParserTest.java +++ b/src/test/unit/gov/nist/javax/sip/parser/URLParserTest.java @@ -66,6 +66,8 @@ public void testURLParser() { "sip:alice", "sip:alice@registrar.com;method=REGISTER", "sip:annc@10.10.30.186:6666;early=no;play=http://10.10.30.186:8080/examples/pin.vxml", + "sip:+1-650-444-2222@ss1.wcom.com;user=phone;Reason=SIP;cause=408;text=\"Request+Timeout\"", + "sip:+1-650-444-2222@ss1.wcom.com;user=phone;Reason=SIP;cause=408", "tel:+463-1701-4291" , "tel:46317014291" , "http://10.10.30.186:8080/examples/pin.vxml"