[Asterisk-code-review] channels/pjsip/basic calls/outgoing/nominal/early media: tes... (testsuite[master])

lvl asteriskteam at digium.com
Tue Feb 20 11:37:41 CST 2018


lvl has uploaded this change for review. ( https://gerrit.asterisk.org/8303


Change subject: channels/pjsip/basic_calls/outgoing/nominal/early_media: test forked early media
......................................................................

channels/pjsip/basic_calls/outgoing/nominal/early_media: test forked early media

This testcase demonstrates the issue raised in ASTERISK-27441,
which is a regression between Asterisk 14 and Asterisk 15.

The issue results in one-way audio after early media was sent
using serial forking; as used by trunk providers to play
tariff announcements.

Change-Id: I62accd4f993a6f42c77661e4943c1e9df5fbe04c
---
A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf
A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf
A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml
A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml
M tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml
5 files changed, 185 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/03/8303/1

diff --git a/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf
new file mode 100644
index 0000000..be7bc2a
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf
@@ -0,0 +1,10 @@
+[default]
+
+exten => s,1,NoOp()
+same => n,Answer()
+same => n,Dial(PJSIP/ua1,,U(on-answer))
+same => n,Hangup()
+
+[on-answer]
+
+exten => s,1,UserEvent(rtpinfo,dest: ${CHANNEL(rtp,dest)})
diff --git a/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..b09dd8a
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf
@@ -0,0 +1,23 @@
+[system]
+type=system
+timer_t1=100
+timer_b=6400
+
+[local-transport-udp]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[ua1]
+type=endpoint
+aors=ua1
+context=default
+allow=!all,ulaw
+rewrite_contact=yes
+
+[ua1]
+type=aor
+max_contacts=1
+minimum_expiration=5
+default_expiration=30
+contact=sip:ua1 at 127.0.0.1:5062
diff --git a/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml
new file mode 100644
index 0000000..60d1d4e
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS for forked early media testing">
+  <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 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]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 100 100 IN IP[local_ip_type] 127.0.0.2
+      s=-
+      c=IN IP[media_ip_type] 127.0.0.2
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+  
+  <pause/>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpForkTag01[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=user1 5 5 IN IP[local_ip_type] 127.0.0.3
+      s=-
+      c=IN IP[media_ip_type] 127.0.0.3
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: ua1 <sip:ua1@[local_ip]:[local_port]>;tag=[pid]SIPpForkTag01[call_number]
+      To: [$remote_tag]
+      [last_Call-ID:]
+      CSeq: [cseq] BYE
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      Max-Forwards: 70
+      Subject: Path Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200">
+  </recv>
+
+  <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/nominal/early_media/test-config.yaml b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml
new file mode 100644
index 0000000..fb38067
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml
@@ -0,0 +1,54 @@
+testinfo:
+    summary:     'Tests a call to a UA which forks the call in order to send early media'
+    description: |
+        'The UA in this test first replies to the INVITE with a SIP 183 and the IP
+        address 127.0.0.2 as RTP source. Then, in the SIP 200 the call is forked by
+        changing the to tag and the RTP source IP is changed to 127.0.0.3.
+        We check if Asterisk properly handles the changed SDP in the 200 OK by
+        updating the RTP IP to 127.0.0.3.
+        This scenario is supported by PJsip in https://trac.pjsip.org/repos/ticket/657'
+
+properties:
+    minversion: '14.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: originator-ua1_invite_recv
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+originator-ua1_invite_recv:
+    trigger: 'ami_connect'
+
+sipp-config:
+    memcheck-delay-stop: 7
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'ua1_invite_recv.xml', '-p': '5062', '-send_timeout': '20000', '-recv_timeout': '20000', '-timeout': '25000'},}
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'rtpinfo'
+        requirements:
+            match:
+                dest: '127.0.0.3: *'
+        count: '1'
diff --git a/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml b/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml
index 7e9339f..543a17a 100644
--- a/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml
@@ -4,3 +4,4 @@
     - test: 'auth'
     - test: 'nat'
     - test: 'peer_in_dialog_auths'
+    - test: 'early_media'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I62accd4f993a6f42c77661e4943c1e9df5fbe04c
Gerrit-Change-Number: 8303
Gerrit-PatchSet: 1
Gerrit-Owner: lvl <digium at lvlconsultancy.nl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180220/23e15aa1/attachment-0001.html>


More information about the asterisk-code-review mailing list