[Asterisk-code-review] testsuite: Cleanup tests/fax/sip/directmedia reinvite t38 (testsuite[master])

Richard Mudgett asteriskteam at digium.com
Tue Feb 23 18:46:11 CST 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2292

Change subject: testsuite: Cleanup tests/fax/sip/directmedia_reinvite_t38
......................................................................

testsuite: Cleanup tests/fax/sip/directmedia_reinvite_t38

Basically this is taking the latest files from
tests/fax/pjsip/directmedia_reinvite_t38 and adapting them back to this
test.

* Fix duplicate To tags on party A and B responses.

* Make A and B party contacts specify the transport.

* Add message tracking headers to quickly locate the messages in the debug
log.

* Removed unnecessary dialplan extensions.

Change-Id: If8daa4e8cba2f7fc8f2b1b3ef33840d2815b5f27
---
M tests/fax/sip/directmedia_reinvite_t38/configs/ast1/extensions.conf
M tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_A.xml
M tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_B.xml
M tests/fax/sip/directmedia_reinvite_t38/test-config.yaml
4 files changed, 48 insertions(+), 78 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/92/2292/1

diff --git a/tests/fax/sip/directmedia_reinvite_t38/configs/ast1/extensions.conf b/tests/fax/sip/directmedia_reinvite_t38/configs/ast1/extensions.conf
index 5405e4b..208ec18 100644
--- a/tests/fax/sip/directmedia_reinvite_t38/configs/ast1/extensions.conf
+++ b/tests/fax/sip/directmedia_reinvite_t38/configs/ast1/extensions.conf
@@ -1,13 +1,4 @@
-[general]
-PHONE_TO_DIAL=SIP/endpoint_B
-
 [default]
-exten => bypassbridge,1,NoOp()
-	same => n,Dial(SIP/endpoint_B,,g)
-	same => n,UserEvent(TestStatus, extension: bypassbridge)
-	same => n,Hangup()
-
-; Dial with no options; use bridge set up based on peer definitions
 exten => basicdial,1,NoOp()
 	same => n,Dial(SIP/endpoint_B,,g)
 	same => n,UserEvent(TestStatus, extension: basicdial)
diff --git a/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_A.xml b/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_A.xml
index 47db1f8..796e322 100644
--- a/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_A.xml
+++ b/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_A.xml
@@ -1,21 +1,22 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE scenario SYSTEM "sipp.dtd">
 
-<scenario name="Phone A Hold with IP and Media Restrictions">
+<scenario name="Phone A direct media receiving T.38 fax">
 
 	<!-- Initial invite - Call phone B -->
 	<send retrans="500">
 		<![CDATA[
 			INVITE sip:[field2]@[remote_ip]:[remote_port] SIP/2.0
 			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
-			From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
+			From: "[field0]" <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
 			To: <sip:[field2]@[remote_ip]:[remote_port];user=phone>
 			CSeq: 1 INVITE
 			Call-ID: [call_id]
-			Contact: <sip:[field0]@[local_ip]:[local_port]>
+			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
 			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-A: 1
 			Allow-Events: talk,hold,conference
 			Max-Forwards: 70
 			Content-Type: application/sdp
@@ -44,16 +45,17 @@
 
 	<send>
 		<![CDATA[
-			ACK sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
+			ACK sip:[field2]@[remote_ip]:[remote_port] SIP/2.0
 			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
-			From: [field0] <sip:[field0]@[remote_ip]>;tag=[call_number]
-			To: <sip:[field1]@[remote_ip];user=phone>[peer_tag_param]
+			From: "[field0]" <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
+			To: <sip:[field2]@[remote_ip]:[remote_port];user=phone>[peer_tag_param]
 			CSeq: 1 ACK
 			Call-ID: [call_id]
-			Contact: <sip:[field0]@[local_ip]:[local_port]>
+			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
 			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-A: 2
 			Max-Forwards: 70
 			Content-Length: 0
 		]]>
@@ -80,7 +82,7 @@
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
@@ -88,7 +90,7 @@
 			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-A: 1
+			X-Testsuite-Track-Phone-A: 3
 			Content-Type: application/sdp
 			Content-Length: [len]
 
@@ -108,27 +110,14 @@
 	<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[
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
@@ -136,7 +125,7 @@
 			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-A: 2
+			X-Testsuite-Track-Phone-A: 4
 			Content-Type: application/sdp
 			Content-Length: [len]
 
@@ -166,7 +155,7 @@
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
@@ -174,20 +163,20 @@
 			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-A: 3
+			X-Testsuite-Track-Phone-A: 5
 			Content-Type: application/sdp
 			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>
 
@@ -200,16 +189,14 @@
 			SIP/2.0 200 OK
 			[last_Via:]
 			[last_From:]
-			[last_To:];tag=[call_number]
+			[last_To:]
 			[last_Call-ID:]
 			[last_CSeq:]
 			Contact: <sip:[field0]@[local_ip]:[local_port];transport=[transport]>
 			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
-			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-A: 5
-			Content-Type: application/sdp
+			X-Testsuite-Track-Phone-A: 6
 			Content-Length: 0
 		]]>
 	</send>
diff --git a/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_B.xml b/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_B.xml
index 4ef7a27..4781ba0 100644
--- a/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_B.xml
+++ b/tests/fax/sip/directmedia_reinvite_t38/sipp/endpoint_B.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE scenario SYSTEM "sipp.dtd">
 
-<scenario name="Phone B Hold with Media Restrictions">
+<scenario name="Phone B direct media sending T.38 fax">
 	<Global variables="remote_tag"/>
 
 	<recv request="INVITE" crlf="true">
@@ -19,12 +19,13 @@
 			SIP/2.0 100 Trying
 			[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]>
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-B: 1
 			Content-Length: 0
 		]]>
 	</send>
@@ -41,6 +42,7 @@
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Allow-Events: talk,hold,conference
 			Accept-Language: en
+			X-Testsuite-Track-Phone-B: 2
 			Content-Length: 0
 		]]>
 	</send>
@@ -60,7 +62,7 @@
 			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-B-Media-Restrict: 1
+			X-Testsuite-Track-Phone-B: 3
 			Content-Type: application/sdp
 			Content-Length: [len]
 
@@ -108,7 +110,7 @@
 			Supported: 100rel,replaces
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
-			Testsuite-Track-Phone-B-Media-Restrict: 2
+			X-Testsuite-Track-Phone-B: 4
 			Content-Type: application/sdp
 			Content-Length: [len]
 
@@ -133,16 +135,17 @@
 	<!-- 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>;tag=[call_number]
+			To: [$remote_tag]
 			CSeq: [cseq] INVITE
 			[last_Call-ID:]
-			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
 			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-B: 5
 			Supported: 100rel,replaces
 			Allow-Events: talk,hold,conference
 			Max-Forwards: 70
@@ -167,34 +170,21 @@
 
 	<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>;tag=[call_number]
+			To: [$remote_tag]
 			CSeq: [cseq] ACK
 			[last_Call-ID:]
-			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
 			Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-B: 6
 			Max-Forwards: 70
 			Content-Length: 0
 		]]>
@@ -207,18 +197,20 @@
 		<![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>;tag=[call_number]
+			To: [$remote_tag]
 			CSeq: [cseq] BYE
 			[last_Call-ID:]
-			Contact: <sip:[field1]@[local_ip]:[local_port]>
+			Contact: <sip:[field1]@[local_ip]:[local_port];transport=[transport]>
 			User-Agent: PolycomSoundPointIP-SPIP_430-UA/3.2.3.1734
 			Accept-Language: en
+			X-Testsuite-Track-Phone-B: 7
 			Max-Forwards: 70
 			Content-Length: 0
 		]]>
 	</send>
 
+	<recv response="200" />
 
 </scenario>
 
diff --git a/tests/fax/sip/directmedia_reinvite_t38/test-config.yaml b/tests/fax/sip/directmedia_reinvite_t38/test-config.yaml
index cde33b5..09cb8cd 100644
--- a/tests/fax/sip/directmedia_reinvite_t38/test-config.yaml
+++ b/tests/fax/sip/directmedia_reinvite_t38/test-config.yaml
@@ -23,10 +23,10 @@
 properties:
     minversion: '1.8.0.0'
     dependencies:
-        - sipp :
-            version : 'v3.0'
-        - python : 'twisted'
-        - python : 'starpy'
+        - sipp:
+            version: 'v3.0'
+        - python: 'twisted'
+        - python: 'starpy'
         - asterisk: 'app_dial'
         - asterisk: 'app_userevent'
         - asterisk: 'chan_sip'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8daa4e8cba2f7fc8f2b1b3ef33840d2815b5f27
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list