summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2010-10-16 04:40:01 +0000
committerNanang Izzuddin <nanang@teluu.com>2010-10-16 04:40:01 +0000
commit090871816ecb857b83e8f4381c7840a3647adb55 (patch)
treebe09c15ff20ba7ec4980b85e357c46a4eb2712ca
parent2b502fb1a99fd8c73075594a2b40a05263f7b3ce (diff)
Fixed #1148:
- Added check in processing answer, if media offer port is zero, just skip negotiation process. - Added SIPp test scenario. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3347 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia/sdp_neg.c8
-rw-r--r--tests/pjsua/scripts-sipp/uac-ticket-1148.xml100
2 files changed, 107 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c
index 974809d9..1087efc1 100644
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -771,7 +771,6 @@ static pj_status_t process_m_answer( pj_pool_t *pool,
/* Check if remote has rejected our offer */
-
if (answer->desc.port == 0) {
/* Remote has rejected our offer.
@@ -783,6 +782,13 @@ static pj_status_t process_m_answer( pj_pool_t *pool,
return PJ_SUCCESS;
}
+ /* Ticket #1148: check if remote answer does not set port to zero when
+ * offered with port zero. Let's just tolerate it.
+ */
+ if (offer->desc.port == 0) {
+ /* Don't need to proceed */
+ return PJ_SUCCESS;
+ }
/* Process direction attributes */
update_media_direction(pool, answer, offer);
diff --git a/tests/pjsua/scripts-sipp/uac-ticket-1148.xml b/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
new file mode 100644
index 00000000..b617b37a
--- /dev/null
+++ b/tests/pjsua/scripts-sipp/uac-ticket-1148.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+
+<scenario name="Ticket #1148 (assertion when offering SDP media with port zero but answered with port non-zero)">
+ <send retrans="500">
+ <![CDATA[
+
+ INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 3 INVITE
+ Contact: sip:sipp@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio 4000 RTP/AVP 0
+ m=video 5000 RTP/AVP 100
+ a=rtpmap:100 H261/90000
+
+ ]]>
+ </send>
+
+ <recv response="100" optional="true">
+ </recv>
+ <recv response="180" optional="true">
+ </recv>
+ <recv response="200" rtd="true">
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+ To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 3 ACK
+ Contact: sip:sipp@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <!-- Waiting re-INVITE from pjsua -->
+
+ <recv request="INVITE" crlf="true">
+ </recv>
+
+ <send retrans="500">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: sip:sipp@[local_ip]:[local_port]
+ Content-Type: application/sdp
+
+ v=0
+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio 4000 RTP/AVP 0
+ m=video 5000 RTP/AVP 100
+ a=rtpmap:100 H261/90000
+
+ ]]>
+ </send>
+
+ <!-- Expecting assertion here -->
+
+ <recv request="ACK" crlf="true">
+ </recv>
+
+ <pause milliseconds="4000"/>
+
+ <!-- definition of the response time repartition table (unit is ms) -->
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <!-- definition of the call length repartition table (unit is ms) -->
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+