]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11452: [sofia-sip] handle 200/183 w/ sdp receivied out of order quickly
authorMike Jerris <mike@signalwire.com>
Mon, 18 Feb 2019 22:06:53 +0000 (17:06 -0500)
committerMike Jerris <mike@signalwire.com>
Mon, 18 Feb 2019 22:06:53 +0000 (17:06 -0500)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c

index e94c5432f45834b1ec4cff150c7086dfb4982aa3..ec04f46051efe326b4be6a33096bcf2ea2ab4c32 100644 (file)
@@ -1 +1 @@
-Wed Feb 21 15:29:04 CST 2018
+Mon Feb 18 16:55:02 EST 2019
index d9261324d588ac5c05a3293b5d9fff8146236a33..21c3d65af11d703a7442d3b22c94b622b131141c 100644 (file)
@@ -940,12 +940,12 @@ static int nua_session_client_response(nua_client_request_t *cr,
   char const *received = NULL;
 
 #define LOG3(m) \
-  SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s\n", \
+  SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s (%u)\n", \
              (void *)nh, cr->cr_method_name, (m), \
-             received ? received : "SDP", status, phrase))
+                         received ? received : "SDP", status, phrase, cr->cr_answer_recv))
 #define LOG5(m) \
-  SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \
-             (void *)nh, cr->cr_method_name, (m), received, status, phrase))
+  SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s (%u)\n", \
+                         (void *)nh, cr->cr_method_name, (m), received, status, phrase, cr->cr_answer_recv))
 
  retry:
 
@@ -954,12 +954,16 @@ static int nua_session_client_response(nua_client_request_t *cr,
   else if (!session_get_description(sip, &sdp, &len))
     /* No SDP */;
   else if (cr->cr_answer_recv) {
-    /* Ignore spurious answers after completing O/A */
-         //LOG3("ignoring duplicate");
-         //sdp = NULL;
-         // we need to make sure its *actually* a dup, so we can't assume for now.
-         cr->cr_answer_recv = 0;
-         goto retry;
+    if (cr->cr_answer_recv > status) {
+      LOG3("status is older than previous answer, ignoring");
+      sdp = NULL;
+      return 0;
+    } else {
+      // we need to make sure its *actually* a dup, so we can't assume for now.
+      LOG3("multiple answers received, processing");
+      cr->cr_answer_recv = 0;
+      goto retry;
+    }
   }
   else if (cr->cr_offer_sent) {
     /* case 1: answer to our offer */