[Asterisk-code-review] local: Add test for dialing with a removed/declined audio stream. (testsuite[master])

Friendly Automation asteriskteam at digium.com
Fri Apr 30 09:37:14 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/15837 )

Change subject: local: Add test for dialing with a removed/declined audio stream.
......................................................................

local: Add test for dialing with a removed/declined audio stream.

This change adds a test which dials from PJSIP, to a Local channel,
and then to another PJSIP channel. The incoming call leg offers a
normal audio stream as well as a declined audio stream. The test
confirms that the Local channel is successfully dialed and that the
called PJSIP party receives the call.

ASTERISK-29407

Change-Id: If55c6ef39c322cb45f59e93bd4ef545957cf5c26
---
A tests/channels/local/local_removed_audio_stream_request/configs/ast1/extensions.conf
A tests/channels/local/local_removed_audio_stream_request/configs/ast1/pjsip.conf
A tests/channels/local/local_removed_audio_stream_request/sipp/alice.xml
A tests/channels/local/local_removed_audio_stream_request/sipp/bob.xml
A tests/channels/local/local_removed_audio_stream_request/test-config.yaml
M tests/channels/local/tests.yaml
6 files changed, 230 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/tests/channels/local/local_removed_audio_stream_request/configs/ast1/extensions.conf b/tests/channels/local/local_removed_audio_stream_request/configs/ast1/extensions.conf
new file mode 100644
index 0000000..f5f4823
--- /dev/null
+++ b/tests/channels/local/local_removed_audio_stream_request/configs/ast1/extensions.conf
@@ -0,0 +1,12 @@
+[general]
+
+[globals]
+
+[calling]
+exten => bob,1,Dial(Local/bob at bob)
+
+[bob]
+exten => bob,1,NoOp()
+	same => n,Dial(PJSIP/bob)
+	same => n,Hangup()
+
diff --git a/tests/channels/local/local_removed_audio_stream_request/configs/ast1/pjsip.conf b/tests/channels/local/local_removed_audio_stream_request/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..c82ab09
--- /dev/null
+++ b/tests/channels/local/local_removed_audio_stream_request/configs/ast1/pjsip.conf
@@ -0,0 +1,34 @@
+[system]
+type=system
+timer_t1=100
+timer_b=6400
+
+[global]
+type=global
+debug=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=g722,ulaw,alaw,h264
+context=calling
+direct_media=no
+media_address=127.0.0.1
+aors=alice
+
+[bob]
+type=endpoint
+allow=g722,ulaw,alaw,h264
+context=calling
+direct_media=no
+media_address=127.0.0.1
+aors=bob
+
+[bob]
+type=aor
+max_contacts=1
+contact=sip:bob at 127.0.0.3:5060\;transport=udp
diff --git a/tests/channels/local/local_removed_audio_stream_request/sipp/alice.xml b/tests/channels/local/local_removed_audio_stream_request/sipp/alice.xml
new file mode 100644
index 0000000..e0c4cb0
--- /dev/null
+++ b/tests/channels/local/local_removed_audio_stream_request/sipp/alice.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Send Call">
+
+  <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: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
+      Max-Forwards: 70
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=- 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+      m=audio 0 RTP/AVP 0
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true" />
+  <recv response="180" optional="true" />
+  <recv response="183" optional="true" />
+
+  <recv response="200" rtd="true" />
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      [last_Via:]4
+      From: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: [cseq] BYE
+      Contact: sip:alice@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+</scenario>
diff --git a/tests/channels/local/local_removed_audio_stream_request/sipp/bob.xml b/tests/channels/local/local_removed_audio_stream_request/sipp/bob.xml
new file mode 100644
index 0000000..6a4c463
--- /dev/null
+++ b/tests/channels/local/local_removed_audio_stream_request/sipp/bob.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+
+  <recv request="INVITE" crlf="true" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+    rtd="true"
+    crlf="true">
+  </recv>
+
+  <recv request="BYE" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <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/local/local_removed_audio_stream_request/test-config.yaml b/tests/channels/local/local_removed_audio_stream_request/test-config.yaml
new file mode 100644
index 0000000..e99ea06
--- /dev/null
+++ b/tests/channels/local/local_removed_audio_stream_request/test-config.yaml
@@ -0,0 +1,37 @@
+testinfo:
+    summary:     'Test calling from PJSIP through a Local channel to PJSIP with a removed audio stream'
+    description: |
+        'A SIPp scenario calls into Asterisk and Asterisk then dials another through a Local
+        channel. The initial call leg contains both an accepted audio stream and a
+        removed/declined stream. The test confirms that the Local channel allows
+        dialing with the removed/declined stream and that the called party
+        receives the call.'
+
+properties:
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk : 'app_dial'
+        - asterisk : 'res_pjsip'
+        - sipp :
+            version : 'v3.4.1'
+    tags:
+        - pjsip
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: test-case-config
+        typename: 'sipp.SIPpTestCase'
+
+test-case-config:
+    memcheck-delay-stop: 7
+    connect-ami: 'True'
+    fail-on-any: False
+    test-iterations:
+        -
+            scenarios:
+                # Bob receives call from Alice
+                - { 'key-args': {'scenario': 'bob.xml', '-p': '5060', '-i': '127.0.0.3', '-s': 'alice', '-timeout': '20s', '-mi': '127.0.0.3'} }
+                # Alice calls Bob
+                - { 'key-args': {'scenario': 'alice.xml', '-p': '5060', '-i': '127.0.0.2', '-s': 'bob', '-timeout': '20s', '-mi': '127.0.0.2'} }
diff --git a/tests/channels/local/tests.yaml b/tests/channels/local/tests.yaml
index a009b04..2e1f942 100644
--- a/tests/channels/local/tests.yaml
+++ b/tests/channels/local/tests.yaml
@@ -5,3 +5,4 @@
     - test: 'local_holding_bridge'
     - test: 'local_optimize_away'
     - test: 'local_loop'
+    - test: 'local_removed_audio_stream_request'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: If55c6ef39c322cb45f59e93bd4ef545957cf5c26
Gerrit-Change-Number: 15837
Gerrit-PatchSet: 3
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210430/71d930fe/attachment-0001.html>


More information about the asterisk-code-review mailing list