[asterisk-commits] Testsuite: channels/pjsip/basic calls/outgoing/off-nominal/c... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 1 10:37:53 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: Testsuite: channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled
......................................................................


Testsuite: channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled

Test scenerios created as a response to ASTERISK-25772

Change-Id: Ifa21978d292cef621bd7690ca891f4a869c506cd
---
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/extensions.conf
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/pjsip.conf
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_invalid_sdp.xml
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_missing_sdp.xml
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_valid_sdp.xml
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_invalid_sdp.xml
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_missing_sdp.xml
A tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/test-config.yaml
M tests/channels/pjsip/basic_calls/outgoing/off-nominal/tests.yaml
9 files changed, 836 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/extensions.conf b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/extensions.conf
new file mode 100644
index 0000000..a19a2ac
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/extensions.conf
@@ -0,0 +1,34 @@
+[general]
+
+[default]
+
+exten = start,1,NoOp()
+same = n,Dial(PJSIP/buba,2)
+same = n,UserEvent(DialResult,status:buba-${DIALSTATUS})
+
+; Try to give time separation in the Asterisk logs between tests to avoid overlap.
+same = n,Wait(1)
+same = n,Dial(PJSIP/carl,2)
+same = n,UserEvent(DialResult,status:carl-${DIALSTATUS})
+
+; Try to give time separation in the Asterisk logs between tests to avoid overlap.
+same = n,Wait(1)
+same = n,Dial(PJSIP/dave,2,g)
+same = n,UserEvent(DialResult,status:dave-${DIALSTATUS})
+
+; Try to give time separation in the Asterisk logs between tests to avoid overlap.
+same = n,Wait(1)
+same = n,Dial(PJSIP/evan,10,g)
+same = n,UserEvent(DialResult,status:evan-${DIALSTATUS})
+
+; Try to give time separation in the Asterisk logs between tests to avoid overlap.
+same = n,Wait(1)
+same = n,Dial(PJSIP/fred,10,g)
+same = n,UserEvent(DialResult,status:fred-${DIALSTATUS})
+
+same = n,Hangup()
+
+exten = target,1,NoOp()
+same = n,Answer()
+same = n,Echo()
+same = n,Hangup()
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/pjsip.conf b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..4ec7cfb
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/configs/ast1/pjsip.conf
@@ -0,0 +1,55 @@
+[transport]
+type=transport
+bind=127.0.0.1:5060
+protocol=udp
+
+[endpoint-template](!)
+type=endpoint
+context=default
+allow=!all,alaw,vp8
+direct_media=no
+identify_by=username
+
+[aor-template](!)
+type=aor
+
+
+[buba](endpoint-template)
+from_user=buba
+aors=buba
+
+[buba](aor-template)
+contact=sip:buba at 127.0.0.1:5071\;transport=udp
+
+
+[carl](endpoint-template)
+from_user=carl
+aors=carl
+
+[carl](aor-template)
+contact=sip:carl at 127.0.0.1:5072\;transport=udp
+
+
+[dave](endpoint-template)
+from_user=dave
+aors=dave
+
+[dave](aor-template)
+contact=sip:dave at 127.0.0.1:5073\;transport=udp
+
+
+[evan](endpoint-template)
+from_user=evan
+aors=evan
+
+[evan](aor-template)
+contact=sip:evan at 127.0.0.1:5074\;transport=udp
+
+
+[fred](endpoint-template)
+from_user=fred
+aors=fred
+
+[fred](aor-template)
+contact=sip:fred at 127.0.0.1:5075\;transport=udp
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_invalid_sdp.xml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_invalid_sdp.xml
new file mode 100644
index 0000000..d0d2bcd
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_invalid_sdp.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS for canceled call with invalid SDP answer test">
+	<Global variables="invite_from" />
+	<Global variables="invite_to" />
+	<Global variables="invite_callid" />
+	<Global variables="invite_cseq" />
+	<recv request="INVITE" crlf="true">
+		<action>
+			<!-- Save the from value. -->
+			<ereg regexp=".*(;tag=.*)"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_from"/>
+			<!-- Save the to value. -->
+			<ereg regexp=".*"
+				header="To:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_to"/>
+			<!-- Save the callid value. -->
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_callid"/>
+			<!-- Save the cseq value. -->
+			<ereg regexp=".*"
+				header="CSeq:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_cseq"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="CANCEL" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			From:[$invite_from]
+			To:[$invite_to];tag=[pid]SIPpTag01[call_number]
+			Call-ID:[$invite_callid]
+			CSeq:[$invite_cseq]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_missing_sdp.xml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_missing_sdp.xml
new file mode 100644
index 0000000..5498343
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_missing_sdp.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS for canceled call with missing SDP answer test">
+	<Global variables="invite_from" />
+	<Global variables="invite_to" />
+	<Global variables="invite_callid" />
+	<Global variables="invite_cseq" />
+	<recv request="INVITE" crlf="true">
+		<action>
+			<!-- Save the from value. -->
+			<ereg regexp=".*(;tag=.*)"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_from"/>
+			<!-- Save the to value. -->
+			<ereg regexp=".*"
+				header="To:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_to"/>
+			<!-- Save the callid value. -->
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_callid"/>
+			<!-- Save the cseq value. -->
+			<ereg regexp=".*"
+				header="CSeq:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_cseq"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="CANCEL" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			From:[$invite_from]
+			To:[$invite_to];tag=[pid]SIPpTag01[call_number]
+			Call-ID:[$invite_callid]
+			CSeq:[$invite_cseq]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_valid_sdp.xml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_valid_sdp.xml
new file mode 100644
index 0000000..6a4cbaf
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_cancel_valid_sdp.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS for canceled call with valid SDP answer test">
+	<Global variables="invite_from" />
+	<Global variables="invite_to" />
+	<Global variables="invite_callid" />
+	<Global variables="invite_cseq" />
+	<recv request="INVITE" crlf="true">
+		<action>
+			<!-- Save the from value. -->
+			<ereg regexp=".*(;tag=.*)"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_from"/>
+			<!-- Save the to value. -->
+			<ereg regexp=".*"
+				header="To:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_to"/>
+			<!-- Save the callid value. -->
+			<ereg regexp=".*"
+				header="Call-ID:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_callid"/>
+			<!-- Save the cseq value. -->
+			<ereg regexp=".*"
+				header="CSeq:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="invite_cseq"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="CANCEL" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			From:[$invite_from]
+			To:[$invite_to];tag=[pid]SIPpTag01[call_number]
+			Call-ID:[$invite_callid]
+			CSeq:[$invite_cseq]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video 0 RTP/AVP 100
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_invalid_sdp.xml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_invalid_sdp.xml
new file mode 100644
index 0000000..bdb8f58
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_invalid_sdp.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS with invalid SDP answer test">
+	<Global variables="remote_tag" />
+	<recv request="INVITE" crlf="true">
+		<action>
+			<!-- Save the from tag. We'll need it when we send our BYE -->
+			<ereg regexp=".*(;tag=.*)"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="remote_tag"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 183 Call progress
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[pid]SIPpTag01[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Supported: 100rel,timer,replaces,histinfo,precondition
+			Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			c=IN IP[media_ip_type] [media_ip]
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			c=IN IP[media_ip_type] [media_ip]
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<pause/>
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[pid]SIPpTag01[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			c=IN IP[media_ip_type] [media_ip]
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			c=IN IP[media_ip_type] [media_ip]
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_missing_sdp.xml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_missing_sdp.xml
new file mode 100644
index 0000000..74e65fd
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/sipp/call_missing_sdp.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS with missing SDP answer test">
+	<Global variables="remote_tag" />
+	<recv request="INVITE" crlf="true">
+		<action>
+			<!-- Save the from tag. We'll need it when we send our BYE -->
+			<ereg regexp=".*(;tag=.*)"
+				header="From:"
+				search_in="hdr"
+				check_it="true"
+				assign_to="remote_tag"/>
+		</action>
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 100 Trying
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<pause/>
+
+	<send retrans="500">
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:];tag=[pid]SIPpTag01[call_number]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="ACK" rtd="true" crlf="true">
+	</recv>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+
+	<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+	<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/test-config.yaml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/test-config.yaml
new file mode 100644
index 0000000..a2edcd9
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/call_canceled/test-config.yaml
@@ -0,0 +1,208 @@
+testinfo:
+    summary: 'Test outgoing calls that are canceled'
+    description: |
+        'There are five scenarios being tested.
+        1) Call Buba and cancel the call before Buba answers.  Buba "answers"
+           right as we cancel the call with a valid SDP response.  This is the
+           CANCEL race condition described in RFC5407 section 3.1.2.  In this
+           case PJPROJECT does not send the BYE for us so Asterisk must detect
+           this case and send the needed BYE.
+        2) Call Carl and cancel the call before Carl answers.  Carl "answers"
+           right as we cancel the call with an invalid SDP response.  This is
+           the CANCEL race condition described in RFC5407 section 3.1.2.  In
+           this case PJPROJECT does send the BYE for us because of the invalid
+           SDP response so Asterisk must detect this case and not send a BYE.
+        3) Call Dave and cancel the call before Dave answers.  Dave "answers"
+           right as we cancel the call with a missing SDP response.  This is
+           the CANCEL race condition described in RFC5407 section 3.1.2.  In
+           this case PJPROJECT does send the BYE for us because of the missing
+           SDP response so Asterisk must detect this case and not send a BYE.
+        4) Call Evan and wait for Evan to answer.  When Evan answers he sends
+           an invalid SDP response.  In this case PJPROJECT cancels the call
+           because of the invalid SDP response and sends the BYE.  Asterisk
+           must detect this case and not send a BYE.'
+        5) Call Fred and wait for Fred to answer.  When Fred answers he sends
+           a missing SDP response.  In this case PJPROJECT cancels the call
+           because of the missing SDP response and sends the BYE.  Asterisk
+           must detect this case and not send a BYE.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        - config-section: ami-config
+          typename: 'ami.AMIEventModule'
+        - config-section: start-call
+          typename: 'pluggable_modules.Originator'
+
+test-object-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5071', '-s': 'buba', '-d': '500', 'scenario': 'call_cancel_valid_sdp.xml'} }
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5072', '-s': 'carl', '-d': '500', 'scenario': 'call_cancel_invalid_sdp.xml'} }
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5073', '-s': 'dave', '-d': '500', 'scenario': 'call_cancel_missing_sdp.xml'} }
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5074', '-s': 'evan', '-d': '500', 'scenario': 'call_invalid_sdp.xml'} }
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5075', '-s': 'fred', '-d': '500', 'scenario': 'call_missing_sdp.xml'} }
+
+start-call:
+    trigger: 'scenario_start'
+    scenario-trigger-after: '3'
+    channel: 'Local/start at default'
+    context: 'default'
+    exten: 'target'
+    priority: 1
+    async: True
+
+ami-config:
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+        count: '5'
+    # Buba events
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+                status: 'buba-.*'
+        requirements:
+            match:
+                status: 'buba-NOANSWER'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PJSIP_SESSION_CANCELED'
+                Endpoint: 'buba'
+        requirements:
+            match:
+                SDP: 'complete'
+        count: '1'
+    # Carl events
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+                status: 'carl-.*'
+        requirements:
+            match:
+                status: 'carl-NOANSWER'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PJSIP_SESSION_CANCELED'
+                Endpoint: 'carl'
+        requirements:
+            match:
+                SDP: 'incomplete'
+        count: '1'
+    # Dave events
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+                status: 'dave-.*'
+        requirements:
+            match:
+                status: 'dave-NOANSWER'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PJSIP_SESSION_CANCELED'
+                Endpoint: 'dave'
+        requirements:
+            match:
+                SDP: 'incomplete'
+        count: '1'
+    # Evan events
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+                status: 'evan-.*'
+        requirements:
+            match:
+                status: 'evan-ANSWER'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PJSIP_SESSION_CANCELED'
+                Endpoint: 'evan'
+        requirements:
+            match:
+                SDP: 'incomplete'
+        count: '1'
+    # Fred events
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialResult'
+                status: 'fred-.*'
+        requirements:
+            match:
+                status: 'fred-ANSWER'
+        count: '1'
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'TestEvent'
+                State: 'PJSIP_SESSION_CANCELED'
+                Endpoint: 'fred'
+        requirements:
+            match:
+                SDP: 'incomplete'
+        count: '1'
+
+properties:
+    minversion: '13.11.0'
+    dependencies:
+        - sipp:
+            version: 'v3.0'
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'app_dial'
+        - asterisk: 'app_echo'
+        - asterisk: 'app_userevent'
+        - asterisk: 'chan_pjsip'
+        - asterisk: 'res_pjsip'
+    tags:
+        - pjsip
+
diff --git a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/tests.yaml b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/tests.yaml
index 0d72645..45fcb12 100644
--- a/tests/channels/pjsip/basic_calls/outgoing/off-nominal/tests.yaml
+++ b/tests/channels/pjsip/basic_calls/outgoing/off-nominal/tests.yaml
@@ -3,3 +3,4 @@
     - test: 'bob_does_not_answer'
     - test: 'bob_is_busy'
     - test: 'bob_incompatible_codecs'
+    - test: 'call_canceled'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa21978d292cef621bd7690ca891f4a869c506cd
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list