<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8619">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">confbridge_talking: Add test that checks talking status with hold<br><br>If a channel in a softmix bridge is put on hold then it's talking status is<br>cleared and an AMI event is raised. This test checks for that event and whether<br>or not the talking status has been set to "on" or "off" when the channel is<br>put on hold.<br><br>ASTERISK-27755<br><br>Change-Id: I99e343439c5a43f178fc466aa2978f6dfd1ab73a<br>---<br>A tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf<br>A tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf<br>A tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf<br>A tests/apps/confbridge/confbridge_talking/sipp/invite.xml<br>A tests/apps/confbridge/confbridge_talking/test-config.yaml<br>M tests/apps/confbridge/tests.yaml<br>6 files changed, 261 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/19/8619/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf<br>new file mode 100644<br>index 0000000..df304ab<br>--- /dev/null<br>+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/confbridge.conf<br>@@ -0,0 +1,13 @@<br>+[general]<br>+<br>+[default_bridge]<br>+type=bridge<br>+<br>+[default_user]<br>+type=user<br>+<br>+[alice]<br>+type=user<br>+quiet=yes<br>+announce_only_user=no<br>+talk_detection_events=yes<br>diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..9112e08<br>--- /dev/null<br>+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/extensions.conf<br>@@ -0,0 +1,5 @@<br>+[default]<br>+<br>+exten => conference,1,Answer()<br>+      same => n,ConfBridge(confbridge,,${CALLERID(num)})<br>+      same => n,Hangup()<br>diff --git a/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf b/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..27796f1<br>--- /dev/null<br>+++ b/tests/apps/confbridge/confbridge_talking/configs/ast1/pjsip.conf<br>@@ -0,0 +1,9 @@<br>+[transport]<br>+type=transport<br>+bind=127.0.0.1<br>+protocol=udp<br>+<br>+[alice]<br>+type=endpoint<br>+allow=!all,ulaw<br>+media_address=127.0.0.1<br>diff --git a/tests/apps/confbridge/confbridge_talking/sipp/invite.xml b/tests/apps/confbridge/confbridge_talking/sipp/invite.xml<br>new file mode 100644<br>index 0000000..14adeea<br>--- /dev/null<br>+++ b/tests/apps/confbridge/confbridge_talking/sipp/invite.xml<br>@@ -0,0 +1,170 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="Invite and hold"><br>+        <send retrans="500"><br>+         <![CDATA[<br>+                 INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]<br>+                  To: "[service]" <sip:[service]@[remote_ip]:[remote_port]><br>+                    Call-ID: [call_id]<br>+                   CSeq: [cseq] INVITE<br>+                  Contact: sip:alice@[local_ip]:[local_port]<br>+                   Max-Forwards: 70<br>+                     Supported: replaces, 100rel, timer, norefersub<br>+                       Session-Expires: 1800<br>+                        Content-Type: application/sdp<br>+                        Content-Length: [len]<br>+<br>+                     v=0<br>+                  o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]<br>+                    s=-<br>+                  c=IN IP[media_ip_type] [media_ip]<br>+                    t=0 0<br>+                        m=audio 12345 RTP/AVP 0 101<br>+                  a=sendrecv<br>+                   a=rtpmap:0 PCMU/8000<br>+                 a=rtpmap:101 telephone-event/8000<br>+<br>+         ]]><br>+       </send><br>+<br>+     <recv response="100" optional="true" /><br>+    <recv response="180" optional="true" /><br>+    <recv response="200" /><br>+<br>+   <send><br>+         <![CDATA[<br>+                 ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: <sip:alice@[local_ip]>;tag=[call_number]<br>+                 To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                  CSeq: [cseq] ACK<br>+                     Call-ID: [call_id]<br>+                   Max-Forwards: 70<br>+                     Content-Length: 0<br>+<br>+         ]]><br>+       </send><br>+<br>+     <pause milliseconds="3000"/><br>+<br>+      <!-- Start playing audio to be "detected" --><br>+        <nop><br>+          <action><br>+                       <exec rtp_stream="lib/python/asterisk/audio.ulaw,3,0"/><br>+              </action><br>+      </nop><br>+<br>+      <pause milliseconds="3000"/><br>+<br>+      <!-- Now send a hold reinvite --><br>+      <send retrans="500"><br>+         <![CDATA[<br>+                 INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]<br>+                  To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                    [last_Call-ID:]<br>+                      CSeq: [cseq] INVITE<br>+                  Contact: sip:alice@[local_ip]:[local_port]<br>+                   Max-Forwards: 70<br>+                     Content-Type: application/sdp<br>+                        Content-Length: [len]<br>+<br>+                     v=0<br>+                  o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]<br>+                    s=-<br>+                  c=IN IP[media_ip_type] [media_ip]<br>+                    t=0 0<br>+                        m=audio 12345 RTP/AVP 0 101<br>+                  a=sendonly<br>+                   a=rtpmap:0 PCMU/8000<br>+                 a=rtpmap:101 telephone-event/8000<br>+<br>+         ]]><br>+       </send><br>+<br>+     <recv response="100" optional="true" /><br>+    <recv response="180" optional="true" /><br>+    <recv response="200" /><br>+<br>+   <send><br>+         <![CDATA[<br>+                 ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: <sip:alice@[local_ip]>;tag=[call_number]<br>+                 To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                  CSeq: [cseq] ACK<br>+                     Call-ID: [call_id]<br>+                   Max-Forwards: 70<br>+                     Content-Length: 0<br>+<br>+         ]]><br>+       </send><br>+<br>+     <pause milliseconds="3000"/><br>+<br>+      <!-- Then take off hold --><br>+    <send retrans="500"><br>+         <![CDATA[<br>+                 INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[call_number]<br>+                  To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                    [last_Call-ID:]<br>+                      CSeq: [cseq] INVITE<br>+                  Contact: sip:alice@[local_ip]:[local_port]<br>+                   Max-Forwards: 70<br>+                     Content-Type: application/sdp<br>+                        Content-Length: [len]<br>+<br>+                     v=0<br>+                  o=- 1324901698 1324901698 IN IP[local_ip_type] [local_ip]<br>+                    s=-<br>+                  c=IN IP[media_ip_type] [media_ip]<br>+                    t=0 0<br>+                        m=audio 12345 RTP/AVP 0 101<br>+                  a=sendrecv<br>+                   a=rtpmap:0 PCMU/8000<br>+                 a=rtpmap:101 telephone-event/8000<br>+<br>+         ]]><br>+       </send><br>+<br>+     <recv response="100" optional="true" /><br>+    <recv response="180" optional="true" /><br>+    <recv response="200" /><br>+<br>+   <send><br>+         <![CDATA[<br>+                 ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+                  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: <sip:alice@[local_ip]>;tag=[call_number]<br>+                 To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br>+                  CSeq: [cseq] ACK<br>+                     Call-ID: [call_id]<br>+                   Max-Forwards: 70<br>+                     Content-Length: 0<br>+<br>+         ]]><br>+       </send><br>+<br>+     <pause milliseconds="1000"/><br>+<br>+      <send><br>+         <![CDATA[<br>+                 BYE sip:[remote_ip]:[remote_port] SIP/2.0<br>+                    Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+                     From: <sip:alice@[local_ip]:[local_port]>;tag=[call_number]<br>+                    To: <sip:[service]@[remote_ip]>[peer_tag_param]<br>+                        CSeq: [cseq] BYE<br>+                     Call-ID: [call_id]<br>+                   Contact: <sip:[service]@[local_ip]:[local_port]><br>+                       Max-Forwards: 70<br>+                     Content-Length: 0<br>+            ]]><br>+       </send><br>+<br>+</scenario><br>diff --git a/tests/apps/confbridge/confbridge_talking/test-config.yaml b/tests/apps/confbridge/confbridge_talking/test-config.yaml<br>new file mode 100644<br>index 0000000..3bd5612<br>--- /dev/null<br>+++ b/tests/apps/confbridge/confbridge_talking/test-config.yaml<br>@@ -0,0 +1,63 @@<br>+testinfo:<br>+    summary: 'Test talk detection in a confbridge'<br>+    description: |<br>+        This test makes sure that the appropriate 'ConfbridgeTalking' events are<br>+        received when talking is detected and when the phone is put on hold.<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: test-object-config<br>+        typename: 'sipp.SIPpTestCase'<br>+    modules:<br>+        -<br>+            config-section: 'ami-config'<br>+            typename: 'pluggable_modules.EventActionModule'<br>+<br>+test-object-config:<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': {'scenario': 'invite.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'conference'} }<br>+<br>+ami-config:<br>+    -<br>+        ami-events:<br>+            conditions:<br>+                match:<br>+                    Event: 'ConfbridgeTalking'<br>+                    Channel: 'PJSIP/alice-*'<br>+                    TalkingStatus: 'on'<br>+            count: 2<br>+    -<br>+        ami-events:<br>+            conditions:<br>+                match:<br>+                    Event: 'Hold'<br>+                    Channel: 'PJSIP/alice-*'<br>+            count: 1<br>+    -<br>+        ami-events:<br>+            conditions:<br>+                match:<br>+                    Event: 'ConfbridgeTalking'<br>+                    Channel: 'PJSIP/alice-*'<br>+                    TalkingStatus: 'off'<br>+            count: 1<br>+    -<br>+        ami-events:<br>+            conditions:<br>+                match:<br>+                    Event: 'Unhold'<br>+                    Channel: 'PJSIP/alice-*'<br>+            count: 1<br>+<br>+properties:<br>+    tags:<br>+        - confbridge<br>+        - apps<br>+    dependencies:<br>+        - python : 'twisted'<br>+        - python : 'starpy'<br>+        - asterisk : 'app_confbridge'<br>+        - asterisk : 'chan_pjsip'<br>+<br>diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml<br>index 48e7fca..3008383 100644<br>--- a/tests/apps/confbridge/tests.yaml<br>+++ b/tests/apps/confbridge/tests.yaml<br>@@ -8,6 +8,7 @@<br>     - test: 'confbridge_recording'<br>     - test: 'confbridge_result'<br>     - test: 'confbridge_start_muted'<br>+    - test: 'confbridge_talking'<br>     - test: 'confbridge_timeout'<br>     - test: 'confbridge_triple_lindy'<br>     - test: 'confbridge_waitmarked_kick'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8619">change 8619</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8619"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I99e343439c5a43f178fc466aa2978f6dfd1ab73a </div>
<div style="display:none"> Gerrit-Change-Number: 8619 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>