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

Jenkins2 asteriskteam at digium.com
Wed Mar 14 05:13:22 CDT 2018


Jenkins2 has submitted this change and it was merged. ( 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, 184 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



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..30a39f2
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf
@@ -0,0 +1,12 @@
+[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)})
+same => n,SoftHangup(PJSIP/ua1,a)
+same => n,Return()
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..881077f
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS for forked early media testing">
+  <recv request="INVITE"
+        rtd="true"
+        crlf="true">
+  </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>
+
+  <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:]
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      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/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..6b61c8c
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml
@@ -0,0 +1,59 @@
+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: '15.4.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+        - asterisk : 'app_dial'
+        - asterisk : 'app_softhangup'
+        - asterisk : 'app_stack'
+        - asterisk : 'app_userevent'
+        - asterisk : 'func_channel'
+    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: merged
Gerrit-Change-Id: I62accd4f993a6f42c77661e4943c1e9df5fbe04c
Gerrit-Change-Number: 8303
Gerrit-PatchSet: 4
Gerrit-Owner: lvl <digium at lvlconsultancy.nl>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180314/0e9f8015/attachment-0001.html>


More information about the asterisk-code-review mailing list