[Asterisk-code-review] tests/fax/t38 1xx response: Test receiving 1xx responses bef... (testsuite[13])

Jenkins2 asteriskteam at digium.com
Thu Jul 5 13:26:17 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/9326 )

Change subject: tests/fax/t38_1xx_response: Test receiving 1xx responses before 200.
......................................................................

tests/fax/t38_1xx_response: Test receiving 1xx responses before 200.

Test reciving 1xx responses other than 100 Trying before receiving the
200 OK to our T.38 reINVITE.

ASTERISK-27944

Change-Id: I358b8d9168d031df2cdb94d30f4b55a280030e23
---
A tests/fax/pjsip/t38_1xx_response/configs/ast1/extensions.conf
A tests/fax/pjsip/t38_1xx_response/configs/ast1/pjsip.conf
A tests/fax/pjsip/t38_1xx_response/sipp/send_1xx.xml
A tests/fax/pjsip/t38_1xx_response/test-config.yaml
M tests/fax/pjsip/tests.yaml
5 files changed, 263 insertions(+), 3 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/fax/pjsip/t38_1xx_response/configs/ast1/extensions.conf b/tests/fax/pjsip/t38_1xx_response/configs/ast1/extensions.conf
new file mode 100644
index 0000000..b4fc474
--- /dev/null
+++ b/tests/fax/pjsip/t38_1xx_response/configs/ast1/extensions.conf
@@ -0,0 +1,10 @@
+[receivefax]
+exten = 1234,1,NoOp()
+same = n,Answer()
+; Wait for the incoming T.38 reINVITE to be auto-responded with 488 rejection.
+same = n,Wait(6)
+; Initiate a receive FAX where we initiate a T.38 reINVITE that gets
+; other 1xx responses before acceptance.
+same = n,ReceiveFax(${ASTDATADIR}/rx.tiff)
+same = n,Hangup()
+
diff --git a/tests/fax/pjsip/t38_1xx_response/configs/ast1/pjsip.conf b/tests/fax/pjsip/t38_1xx_response/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..fb352e3
--- /dev/null
+++ b/tests/fax/pjsip/t38_1xx_response/configs/ast1/pjsip.conf
@@ -0,0 +1,17 @@
+[global]
+type=global
+debug=yes
+
+[local-transport]
+type=transport
+protocol=udp
+bind=127.0.0.1
+
+[endpoint-template](!)
+type=endpoint
+allow=!all,ulaw,alaw
+t38_udptl=yes
+context=receivefax
+media_address=127.0.0.1
+
+[sipp](endpoint-template)
diff --git a/tests/fax/pjsip/t38_1xx_response/sipp/send_1xx.xml b/tests/fax/pjsip/t38_1xx_response/sipp/send_1xx.xml
new file mode 100644
index 0000000..0ea57d4
--- /dev/null
+++ b/tests/fax/pjsip/t38_1xx_response/sipp/send_1xx.xml
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="T38 REINVTE">
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: <sip:[service]@[remote_ip]:[remote_port]>
+			Call-ID: [call_id]
+			Supported: rel1xx,timer,replaces
+			Min-SE:  181
+			User-Agent: Cisco-SIPGateway/IOS-12.x
+			Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER
+			CSeq: 101 INVITE
+			Max-Forwards: 69
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Expires: 180
+			Allow-Events: telephone-event
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CiscoSystemsSIP-GW-UserAgent 9624 5279 IN IP[local_ip_type] [local_ip]
+			s=SIP Call
+			c=IN IP[local_ip_type] [local_ip]
+			t=0 0
+			m=audio 9000 RTP/AVP 0 101
+			c=IN IP[local_ip_type] [local_ip]
+			a=rtpmap:101 telephone-event/101
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<recv response="180" optional="true">
+	</recv>
+
+	<recv response="183" optional="true">
+	</recv>
+
+	<recv response="200" rrs="true">
+		<action>
+			<ereg regexp="[[:punct:]](.*)[[:punct:]]" search_in="hdr" header="Contact:" check_it="true" assign_to="6,1" />
+			<ereg regexp=".*" search_in="hdr" header="From:" check_it="true" assign_to="2" />
+			<ereg regexp=".*" search_in="hdr" header="To:" check_it="true" assign_to="3" />
+			<log message="Log to avoid the problem of not using $6 [$6]"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK [next_url] SIP/2.0
+			[routes]
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: [$2]
+			To: [$3]
+			Call-ID: [call_id]
+			Max-Forwards: 69
+			CSeq: 101 ACK
+			Content-Length: [len]
+		]]>
+	</send>
+
+	<!-- Send the T38 REINVITE -->
+	<send retrans="500" start_rtd="reinvite">
+		<![CDATA[
+			INVITE [$1] SIP/2.0
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: [$2]
+			To: [$3]
+			Call-ID: [call_id]
+			User-Agent: Cisco-SIPGateway/IOS-12.x
+			CSeq: 102 INVITE
+			Max-Forwards: 69
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Allow-Events: telephone-event
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CiscoSystemsSIP-GW-UserAgent 9624 5280 IN IP[local_ip_type] [local_ip]
+			s=SIPp scenario
+			c=IN IP[local_ip_type] [local_ip]
+			t=0 0
+			m=image 4389 udptl t38
+			a=T38FaxVersion:0
+			a=T38MaxBitRate:14400
+			a=T38FaxRateManagement:transferredTCF
+			a=T38FaxMaxDatagram:1400
+			a=T38FaxUdpEC:t38UDPRedundancy
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<!-- Get 488 because of 6 second wait being longer than the auto reject timer -->
+	<recv response="488" rtd="reinvite" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK [$1] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			[last_Call-ID:]
+			From: [$2]
+			To: [$3]
+			CSeq: 102 ACK
+			Max-Forwards: 69
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Wait for another T38 REINVITE from Asterisk -->
+	<recv request="INVITE" crlf="true" rrs="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_Call-ID:]
+			[last_From:]
+			[last_To:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 180 Ringing
+			[last_Via:]
+			[last_Call-ID:]
+			[last_From:]
+			[last_To:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<pause milliseconds="1000" />
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_Call-ID:]
+			[last_From:]
+			[last_To:]
+			[last_CSeq:]
+			[last_Record-Route]
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CiscoSystemsSIP-GW-UserAgent 9624 5280 IN IP[local_ip_type] [local_ip]
+			s=SIPp scenario
+			c=IN IP[local_ip_type] [local_ip]
+			t=0 0
+			m=image 4389 udptl t38
+			a=T38FaxVersion:0
+			a=T38MaxBitRate:14400
+			a=T38FaxRateManagement:transferredTCF
+			a=T38FaxMaxDatagram:1400
+			a=T38FaxUdpEC:t38UDPRedundancy
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<pause milliseconds="1000" />
+
+	<send retrans="500">
+		<![CDATA[
+			BYE [$1] SIP/2.0
+			Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
+			From: [$2]
+			To: [$3]
+			Call-ID: [call_id]
+			User-Agent: Cisco-SIPGateway/IOS-12.x
+			Max-Forwards: 69
+			CSeq: 104 BYE
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="200">
+	</recv>
+
+</scenario>
+
diff --git a/tests/fax/pjsip/t38_1xx_response/test-config.yaml b/tests/fax/pjsip/t38_1xx_response/test-config.yaml
new file mode 100644
index 0000000..1f8417a
--- /dev/null
+++ b/tests/fax/pjsip/t38_1xx_response/test-config.yaml
@@ -0,0 +1,35 @@
+testinfo:
+    summary: 'Test receiving 1xx responses other than 100 before 200 to our T.38 reINVITE'
+    description: |
+        'Tests being able to receive 1xx responses other than 100 before
+        receiving a 200 to our T.38 reINVITE.  In addition we exercise the
+        T.38 auto-reject functionality when the asterisk side does not
+        respond within 5 seconds to the peer T.38 reINVITE.
+        The test passes if we do not crash and the SIPp scenario is successful.
+        See ASTERISK-27944'
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+
+test-object-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'send_1xx.xml', '-i': '127.0.0.2', '-p': '5060', '-s': '1234'} }
+
+properties:
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - sipp:
+            version: 'v3.0'
+        - asterisk: 'chan_pjsip'
+        - asterisk: 'res_fax'
+        - asterisk: 'res_pjsip_t38'
+    tags:
+        - pjsip
+        - fax
diff --git a/tests/fax/pjsip/tests.yaml b/tests/fax/pjsip/tests.yaml
index 3edf0c2..66822c2 100644
--- a/tests/fax/pjsip/tests.yaml
+++ b/tests/fax/pjsip/tests.yaml
@@ -1,9 +1,10 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
     - test: 'ast-2016-003'
-    - test: 't38'
-    - test: 't38_with_auth'
     - test: 'directmedia_reinvite_t38'
-    - test: 'gateway_t38_g711'
     - test: 'gateway_native_t38'
+    - test: 'gateway_t38_g711'
+    - test: 't38'
+    - test: 't38_1xx_response'
     - test: 't38_fast_reject'
+    - test: 't38_with_auth'

-- 
To view, visit https://gerrit.asterisk.org/9326
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I358b8d9168d031df2cdb94d30f4b55a280030e23
Gerrit-Change-Number: 9326
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180705/8cf9375f/attachment-0001.html>


More information about the asterisk-code-review mailing list