[Asterisk-code-review] tests/fax/pjsip/directmedia reinvite t38: Fix SIPp scenarios (testsuite[master])

Matt Jordan asteriskteam at digium.com
Fri Nov 20 21:41:30 CST 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/1669

Change subject: tests/fax/pjsip/directmedia_reinvite_t38: Fix SIPp scenarios
......................................................................

tests/fax/pjsip/directmedia_reinvite_t38: Fix SIPp scenarios

This patch fixes the SIPp scenarios for the directmedia_reinvite_t38 test.
This includes the following:
(1) Several re-INVITEs were not formed in such a fashion that the PJSIP stack
    would recognize them as either a re-INVITE nor a valid SIP request. This
    patch corrects those errors.
(2) Due to how the PJSIP stack assigns its media address in the SDP's 'c'
    line, it is impossible to predict what the media address of Asterisk will
    be. As such, regex comparisons attempting to validate that the SDP contains
    '127.0.0.1' will most likely fail. Likewise, due to how Asterisk determines
    the session media address, it is likely that the remote party's IP
    address - which was previously used for a direct media bridge - will still
    be present. Note that this is semantically valid, as the media address
    overrides this value. Either way, this makes a mockery of the regexs
    that were in the test. This patch opts just to remove these, and verify
    instead that we get all the INVITEs and re-INVITEs that we expect.

ASTERISK-25582 #close

Change-Id: I3da7124a66180e3f8dc73fcc64a8ae9b8965ede3
---
M tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_A.xml
M tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_B.xml
2 files changed, 17 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/69/1669/1

diff --git a/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_A.xml b/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_A.xml
index 47db1f8..2d378b4 100644
--- a/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_A.xml
+++ b/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_A.xml
@@ -108,20 +108,7 @@
 	<recv request="ACK"/>
 
 	<!-- Reinvite received for T38 - media flows between Enpoint A and Asterisk -->
-	<recv request="INVITE">
-		<action>
-			<ereg regexp="c=IN IP4 127.0.0.1" search_in="body" check_it="true" assign_to="1" />
-			<log message="Side A - Contact SDP for T38 reinvite matches expectations: [$1]." />
-			<strcmp assign_to="result" variable="1" value="c=IN IP4 127.0.0.1" />
-			<test assign_to="emptyinv2" variable="result" compare="not_equal" value="" />
-		</action>
-	</recv>
-
-	<nop condexec="emptyinv2">
-		<action>
-			<error message="Side A - Contact SDP for T38 reinvite did not match - expected 'c=IN IP4 127.0.0.1' but got [$1]" />
-		</action>
-	</nop>
+	<recv request="INVITE" />
 
 	<send retrans="500">
 		<![CDATA[
@@ -179,15 +166,15 @@
 			Content-Length: [len]
 
 			v=0
-			o=- 1324901698 1324901700 IN IP4 [local_ip]
+			o=- 1324901698 1324901698 IN IP4 [local_ip]
 			s=Polycom IP Phone
 			c=IN IP4 [local_ip]
 			t=0 0
-			m=image 10972 udptl t38
 			a=sendrecv
-			a=T38FaxVersion:0
-			a=T38MaxBitRate:9600
-			a=T38FaxUdpEC:t38UDPRedundancy
+			m=audio 2226 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
 		]]>
 	</send>
 
diff --git a/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_B.xml b/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_B.xml
index 4ef7a27..e34edb0 100644
--- a/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_B.xml
+++ b/tests/fax/pjsip/directmedia_reinvite_t38/sipp/endpoint_B.xml
@@ -52,7 +52,7 @@
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
@@ -100,7 +100,7 @@
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
@@ -133,10 +133,10 @@
 	<!-- Reinvite to set up T38 Fax session -->
 	<send retrans="500">
 		<![CDATA[
-			INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
+			INVITE sip:endpoint_B@[remote_ip]:[remote_port] SIP/2.0
 			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
-			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
-			To: [field0] <sip:[field1]@[remote_ip]>
+			From: <sip:127.0.0.3>
+			To: [$remote_tag]
 			CSeq: [cseq] INVITE
 			[last_Call-ID:]
 			Contact: <sip:[field1]@[local_ip]:[local_port]>
@@ -167,28 +167,14 @@
 
 	<recv response="100" optional="true" />
 
-	<recv response="200">
-		<action>
-			<ereg regexp="c=IN IP4 127.0.0.1" search_in="body" check_it="true" assign_to="1" />
-			<log message="Side B - Contact SDP for T38 reinvite 200 OK matches expectations: [$1]." />
-			<strcmp assign_to="result" variable="1" value="c=IN IP4 127.0.0.1" />
-			<test assign_to="empty200" variable="result" compare="not_equal" value="" />
-		</action>
-	</recv>
-
-	<nop condexec="empty200">
-		<action>
-			<error message="Side B - Contact SDP for T38 reinvite 200 OK did not match - expected 'c=IN IP4 127.0.0.1' but got [$1]" />
-		</action>
-	</nop>
-
+	<recv response="200" />
 
 	<send>
 		<![CDATA[
 			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
 			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
-			From: [field1] <sip:[field1]@[local_ip]>;tag=[call_number]
-			To: <sip:[field0]@[remote_ip];user=[field0]>[peer_tag_param]
+			From: <sip:127.0.0.3>
+			To: [$remote_tag]
 			CSeq: [cseq] ACK
 			[last_Call-ID:]
 			Contact: <sip:[field1]@[local_ip]:[local_port]>
@@ -207,8 +193,8 @@
 		<![CDATA[
 			BYE sip:[field1]@1[remote_ip]:[remote_port] SIP/2.0
 			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
-			From: [field1] <sip:[field1]@[local_ip]:[local_port]>;tag=[call_number]
-			To: [field0] <sip:[field1]@[remote_ip]>[$remote_tag]
+			From: <sip:127.0.0.3>
+			To: [$remote_tag]
 			CSeq: [cseq] BYE
 			[last_Call-ID:]
 			Contact: <sip:[field1]@[local_ip]:[local_port]>
@@ -219,6 +205,7 @@
 		]]>
 	</send>
 
+	<recv response="200" />
 
 </scenario>
 

-- 
To view, visit https://gerrit.asterisk.org/1669
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3da7124a66180e3f8dc73fcc64a8ae9b8965ede3
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list