Skip to content

Commit 0ebb555

Browse files
author
Mike Jerris
committed
FS-11452: [sofia-sip] handle 200/183 w/ sdp receivied out of order quickly
1 parent 19a4fb6 commit 0ebb555

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.update

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Wed Feb 21 15:29:04 CST 2018
1+
Mon Feb 18 16:55:02 EST 2019

libsofia-sip-ua/nua/nua_session.c

+14-10
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,12 @@ static int nua_session_client_response(nua_client_request_t *cr,
940940
char const *received = NULL;
941941

942942
#define LOG3(m) \
943-
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s\n", \
943+
SU_DEBUG_3(("nua(%p): %s: %s %s in %u %s (%u)\n", \
944944
(void *)nh, cr->cr_method_name, (m), \
945-
received ? received : "SDP", status, phrase))
945+
received ? received : "SDP", status, phrase, cr->cr_answer_recv))
946946
#define LOG5(m) \
947-
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \
948-
(void *)nh, cr->cr_method_name, (m), received, status, phrase))
947+
SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s (%u)\n", \
948+
(void *)nh, cr->cr_method_name, (m), received, status, phrase, cr->cr_answer_recv))
949949

950950
retry:
951951

@@ -954,12 +954,16 @@ static int nua_session_client_response(nua_client_request_t *cr,
954954
else if (!session_get_description(sip, &sdp, &len))
955955
/* No SDP */;
956956
else if (cr->cr_answer_recv) {
957-
/* Ignore spurious answers after completing O/A */
958-
//LOG3("ignoring duplicate");
959-
//sdp = NULL;
960-
// we need to make sure its *actually* a dup, so we can't assume for now.
961-
cr->cr_answer_recv = 0;
962-
goto retry;
957+
if (cr->cr_answer_recv > status) {
958+
LOG3("status is older than previous answer, ignoring");
959+
sdp = NULL;
960+
return 0;
961+
} else {
962+
// we need to make sure its *actually* a dup, so we can't assume for now.
963+
LOG3("multiple answers received, processing");
964+
cr->cr_answer_recv = 0;
965+
goto retry;
966+
}
963967
}
964968
else if (cr->cr_offer_sent) {
965969
/* case 1: answer to our offer */

0 commit comments

Comments
 (0)