Revision: 4e3fb2181830
Author:   Jean Deruelle <[email protected]>
Date:     Fri Apr 25 13:46:46 2014 UTC
Log:      Update Issue 22

Fix + non regression test

(cherry picked from commit 29850d055ed0bb7605da4d2da82db66d08a51755)

http://code.google.com/p/sipservlets/source/detail?r=4e3fb2181830

Modified:
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ApplicationRoutingHeaderComposer.java /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/TestSipListener.java /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/proxy/ProxyRecordRoutingTest.java

=======================================
--- /sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ApplicationRoutingHeaderComposer.java Tue Mar 11 21:54:59 2014 UTC +++ /sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ApplicationRoutingHeaderComposer.java Fri Apr 25 13:46:46 2014 UTC
@@ -62,7 +62,7 @@

                        // If there is no AR in the string, generate a 
uniqueValue for the tag
                        // and it will be stored for later.
-                       if(tokens.length > 1) {
+                       if(tokens.length > 2) {
// Otherwise extract the uniqueValue from the tag string, it's the first token.
                                final String hashedAppName = tokens[2];
if(sipApplicationDispatcher.getApplicationServerIdHash().equalsIgnoreCase(tokens[1])) {
=======================================
--- /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/TestSipListener.java Fri Apr 18 21:29:45 2014 UTC +++ /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/TestSipListener.java Fri Apr 25 13:46:46 2014 UTC
@@ -3451,4 +3451,12 @@
        public void sendProvisionalResponseBeforeChallenge(boolean b) {
                sendProvisionalResponseBeforeChallenge  = b;
        }
+
+    public String getToTag() {
+        return toTag;
+    }
+
+    public void setToTag(String toTag) {
+        this.toTag = toTag;
+    }
 }
=======================================
--- /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/proxy/ProxyRecordRoutingTest.java Fri Apr 25 11:01:48 2014 UTC +++ /sip-servlets-test-suite/testsuite/src/test/java/org/mobicents/servlet/sip/testsuite/proxy/ProxyRecordRoutingTest.java Fri Apr 25 13:46:46 2014 UTC
@@ -21,10 +21,14 @@

 import java.util.ArrayList;
 import java.util.List;
+import java.util.ListIterator;
+import java.util.Random;

 import javax.sip.ListeningPoint;
 import javax.sip.SipProvider;
 import javax.sip.address.SipURI;
+import javax.sip.header.Header;
+import javax.sip.header.RecordRouteHeader;

 import org.apache.log4j.Logger;
 import org.mobicents.servlet.sip.SipServletTestCase;
@@ -214,6 +218,28 @@
                assertEquals(480,sender.getFinalResponseStatus());
                assertTrue(neutral.isCancelReceived());
        }
+
+       /*
+     * https://code.google.com/p/sipservlets/issues/detail?id=22
+     */
+ public void testUnderscoreToTagFinalResponseProxying() throws Exception {
+        deployApplication();
+        String fromName = "underscore-to-tag-unique-location";
+        String fromSipAddress = "sip-servlets.com";
+ SipURI fromAddress = senderProtocolObjects.addressFactory.createSipURI(
+                fromName, fromSipAddress);
+
+        String toSipAddress = "sip-servlets.com";
+        String toUser = "proxy-receiver";
+ SipURI toAddress = senderProtocolObjects.addressFactory.createSipURI(
+                toUser, toSipAddress);
+
+        receiver.setFinalResponseToSend(404);
+ receiver.setToTag(Integer.toString(new Random().nextInt(10000000)) + "_Random_Random"); + sender.sendSipRequest("INVITE", fromAddress, toAddress, null, null, false);
+        Thread.sleep(TIMEOUT);
+        assertEquals(404,sender.getFinalResponseStatus());
+    }

        @Override
        public void tearDown() throws Exception {

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to