From f762fd7b4817c6668da0859b188d9d21a21e38bf Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Wed, 16 Jun 2010 15:26:18 +0000 Subject: Fix #1045: - Fixed invite module to reset SDP negotiator state after incomplete SDP offer-answer in re-INVITE/UPDATE. - Added some SIPp test scenarios. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3208 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_inv.c | 24 +++++ .../scripts-sipp/uac-inv-and-ack-without-sdp.xml | 91 ++++++++++++++++ .../uas-answer-200-inv-without-sdp.xml | 80 ++++++++++++++ .../uas-answer-200-reinvite-without-sdp.xml | 90 ++++++++++++++++ .../uas-answer-200-update-without-sdp.xml | 87 +++++++++++++++ .../uas-reinv-and-ack(same-branch)-without-sdp.xml | 118 +++++++++++++++++++++ .../scripts-sipp/uas-reinv-and-ack-without-sdp.xml | 118 +++++++++++++++++++++ 7 files changed, 608 insertions(+) create mode 100644 tests/pjsua/scripts-sipp/uac-inv-and-ack-without-sdp.xml create mode 100644 tests/pjsua/scripts-sipp/uas-answer-200-inv-without-sdp.xml create mode 100644 tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml create mode 100644 tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml create mode 100644 tests/pjsua/scripts-sipp/uas-reinv-and-ack(same-branch)-without-sdp.xml create mode 100644 tests/pjsua/scripts-sipp/uas-reinv-and-ack-without-sdp.xml diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 94ec987e..ecfebec3 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -458,6 +458,16 @@ static pj_bool_t mod_inv_on_rx_request(pjsip_rx_data *rdata) */ if (inv->state < PJSIP_INV_STATE_DISCONNECTED) { inv_check_sdp_in_incoming_msg(inv, inv->invite_tsx, rdata); + + /* Check if local offer got no SDP answer and INVITE session + * is in CONFIRMED state. + */ + if (pjmedia_sdp_neg_get_state(inv->neg)== + PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER && + inv->state==PJSIP_INV_STATE_CONFIRMED) + { + pjmedia_sdp_neg_cancel_offer(inv->neg); + } } /* Now we can terminate the INVITE transaction */ @@ -3975,6 +3985,13 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) { inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); + + /* Check if local offer got no SDP answer */ + if (pjmedia_sdp_neg_get_state(inv->neg)== + PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) + { + pjmedia_sdp_neg_cancel_offer(inv->neg); + } } } @@ -4013,6 +4030,13 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); + /* Check if local offer got no SDP answer */ + if (pjmedia_sdp_neg_get_state(inv->neg)== + PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) + { + pjmedia_sdp_neg_cancel_offer(inv->neg); + } + /* Send ACK */ inv_send_ack(inv, e); diff --git a/tests/pjsua/scripts-sipp/uac-inv-and-ack-without-sdp.xml b/tests/pjsua/scripts-sipp/uac-inv-and-ack-without-sdp.xml new file mode 100644 index 00000000..a61aba77 --- /dev/null +++ b/tests/pjsua/scripts-sipp/uac-inv-and-ack-without-sdp.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To: sut + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To: sut [peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + + diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-inv-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-answer-200-inv-without-sdp.xml new file mode 100644 index 00000000..70a3b5f0 --- /dev/null +++ b/tests/pjsua/scripts-sipp/uas-answer-200-inv-without-sdp.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml new file mode 100644 index 00000000..7634545f --- /dev/null +++ b/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml new file mode 100644 index 00000000..646e1f4f --- /dev/null +++ b/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/pjsua/scripts-sipp/uas-reinv-and-ack(same-branch)-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-reinv-and-ack(same-branch)-without-sdp.xml new file mode 100644 index 00000000..cab4e535 --- /dev/null +++ b/tests/pjsua/scripts-sipp/uas-reinv-and-ack(same-branch)-without-sdp.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + diff --git a/tests/pjsua/scripts-sipp/uas-reinv-and-ack-without-sdp.xml b/tests/pjsua/scripts-sipp/uas-reinv-and-ack-without-sdp.xml new file mode 100644 index 00000000..90e1cec6 --- /dev/null +++ b/tests/pjsua/scripts-sipp/uas-reinv-and-ack-without-sdp.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + + + ;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Content-Length: 0 + + ]]> + + + + + + + + + + + + + + + + -- cgit v1.2.3