[Asterisk-code-review] confbridge talking: Add test that checks talking status with... (testsuite[15])

Kevin Harwell asteriskteam at digium.com
Tue Mar 20 15:35:36 CDT 2018


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/8619


Change subject: confbridge_talking: Add test that checks talking status with hold
......................................................................

confbridge_talking: Add test that checks talking status with hold

If a channel in a softmix bridge is put on hold then it's talking status is
cleared and an AMI event is raised. This test checks for that event and whether
or not the talking status has been set to "on" or "off" when the channel is
put on hold.

ASTERISK-27755

Change-Id: I99e343439c5a43f178fc466aa2978f6dfd1ab73a
---
A tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf
A tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf
A tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf
A tests/apps/confbridge/confbridge_talking/sipp/invite.xml
A tests/apps/confbridge/confbridge_talking/test-config.yaml
M tests/apps/confbridge/tests.yaml
6 files changed, 261 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/19/8619/1

diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf
new file mode 100644
index 0000000..df304ab
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf
@@ -0,0 +1,13 @@
+[general]
+
+[default_bridge]
+type=bridge
+
+[default_user]
+type=user
+
+[alice]
+type=user
+quiet=yes
+announce_only_user=no
+talk_detection_events=yes
diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf
new file mode 100644
index 0000000..9112e08
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf
@@ -0,0 +1,5 @@
+[default]
+
+exten => conference,1,Answer()
+      same => n,ConfBridge(confbridge,,${CALLERID(num)})
+      same => n,Hangup()
diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..27796f1
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf
@@ -0,0 +1,9 @@
+[transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=!all,ulaw
+media_address=127.0.0.1
diff --git a/tests/apps/confbridge/confbridge_talking/sipp/invite.xml b/tests/apps/confbridge/confbridge_talking/sipp/invite.xml
new file mode 100644
index 0000000..14adeea
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_talking/sipp/invite.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Invite and hold">
+	<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: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]
+			To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+			Call-ID: [call_id]
+			CSeq: [cseq] INVITE
+			Contact: sip:alice@[local_ip]:[local_port]
+			Max-Forwards: 70
+			Supported: replaces, 100rel, timer, norefersub
+			Session-Expires: 1800
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]
+			s=-
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio 12345 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+	<recv response="180" optional="true" />
+	<recv response="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: <sip:alice@[local_ip]>;tag=[call_number]
+			To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [call_id]
+			Max-Forwards: 70
+			Content-Length: 0
+
+		]]>
+	</send>
+
+	<pause milliseconds="3000"/>
+
+	<!-- Start playing audio to be "detected" -->
+	<nop>
+		<action>
+			<exec rtp_stream="lib/python/asterisk/audio.ulaw,3,0"/>
+		</action>
+	</nop>
+
+	<pause milliseconds="3000"/>
+
+	<!-- Now send a hold reinvite -->
+	<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: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]
+			To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+			[last_Call-ID:]
+			CSeq: [cseq] INVITE
+			Contact: sip:alice@[local_ip]:[local_port]
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]
+			s=-
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio 12345 RTP/AVP 0 101
+			a=sendonly
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+	<recv response="180" optional="true" />
+	<recv response="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: <sip:alice@[local_ip]>;tag=[call_number]
+			To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [call_id]
+			Max-Forwards: 70
+			Content-Length: 0
+
+		]]>
+	</send>
+
+	<pause milliseconds="3000"/>
+
+	<!-- Then take off hold -->
+	<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: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]
+			To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+			[last_Call-ID:]
+			CSeq: [cseq] INVITE
+			Contact: sip:alice@[local_ip]:[local_port]
+			Max-Forwards: 70
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]
+			s=-
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio 12345 RTP/AVP 0 101
+			a=sendrecv
+			a=rtpmap:0 PCMU/8000
+			a=rtpmap:101 telephone-event/8000
+
+		]]>
+	</send>
+
+	<recv response="100" optional="true" />
+	<recv response="180" optional="true" />
+	<recv response="200" />
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: <sip:alice@[local_ip]>;tag=[call_number]
+			To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+			CSeq: [cseq] ACK
+			Call-ID: [call_id]
+			Max-Forwards: 70
+			Content-Length: 0
+
+		]]>
+	</send>
+
+	<pause milliseconds="1000"/>
+
+	<send>
+		<![CDATA[
+			BYE sip:[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: <sip:alice@[local_ip]:[local_port]>;tag=[call_number]
+			To: <sip:[service]@[remote_ip]>[peer_tag_param]
+			CSeq: [cseq] BYE
+			Call-ID: [call_id]
+			Contact: <sip:[service]@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Content-Length: 0
+		]]>
+	</send>
+
+</scenario>
diff --git a/tests/apps/confbridge/confbridge_talking/test-config.yaml b/tests/apps/confbridge/confbridge_talking/test-config.yaml
new file mode 100644
index 0000000..3bd5612
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_talking/test-config.yaml
@@ -0,0 +1,63 @@
+testinfo:
+    summary: 'Test talk detection in a confbridge'
+    description: |
+        This test makes sure that the appropriate 'ConfbridgeTalking' events are
+        received when talking is detected and when the phone is put on hold.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: 'ami-config'
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'invite.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'conference'} }
+
+ami-config:
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ConfbridgeTalking'
+                    Channel: 'PJSIP/alice-*'
+                    TalkingStatus: 'on'
+            count: 2
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Hold'
+                    Channel: 'PJSIP/alice-*'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'ConfbridgeTalking'
+                    Channel: 'PJSIP/alice-*'
+                    TalkingStatus: 'off'
+            count: 1
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: 'Unhold'
+                    Channel: 'PJSIP/alice-*'
+            count: 1
+
+properties:
+    tags:
+        - confbridge
+        - apps
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'app_confbridge'
+        - asterisk : 'chan_pjsip'
+
diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml
index 48e7fca..3008383 100644
--- a/tests/apps/confbridge/tests.yaml
+++ b/tests/apps/confbridge/tests.yaml
@@ -8,6 +8,7 @@
     - test: 'confbridge_recording'
     - test: 'confbridge_result'
     - test: 'confbridge_start_muted'
+    - test: 'confbridge_talking'
     - test: 'confbridge_timeout'
     - test: 'confbridge_triple_lindy'
     - test: 'confbridge_waitmarked_kick'

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

Gerrit-Project: testsuite
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99e343439c5a43f178fc466aa2978f6dfd1ab73a
Gerrit-Change-Number: 8619
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180320/12e44e6e/attachment-0001.html>


More information about the asterisk-code-review mailing list