<p>lvl has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8303">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels/pjsip/basic_calls/outgoing/nominal/early_media: test forked early media<br><br>This testcase demonstrates the issue raised in ASTERISK-27441,<br>which is a regression between Asterisk 14 and Asterisk 15.<br><br>The issue results in one-way audio after early media was sent<br>using serial forking; as used by trunk providers to play<br>tariff announcements.<br><br>Change-Id: I62accd4f993a6f42c77661e4943c1e9df5fbe04c<br>---<br>A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf<br>A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml<br>A tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml<br>M tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml<br>5 files changed, 185 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/03/8303/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">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<br>new file mode 100644<br>index 0000000..be7bc2a<br>--- /dev/null<br>+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/extensions.conf<br>@@ -0,0 +1,10 @@<br>+[default]<br>+<br>+exten => s,1,NoOp()<br>+same => n,Answer()<br>+same => n,Dial(PJSIP/ua1,,U(on-answer))<br>+same => n,Hangup()<br>+<br>+[on-answer]<br>+<br>+exten => s,1,UserEvent(rtpinfo,dest: ${CHANNEL(rtp,dest)})<br>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<br>new file mode 100644<br>index 0000000..b09dd8a<br>--- /dev/null<br>+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/configs/ast1/pjsip.conf<br>@@ -0,0 +1,23 @@<br>+[system]<br>+type=system<br>+timer_t1=100<br>+timer_b=6400<br>+<br>+[local-transport-udp]<br>+type=transport<br>+bind=127.0.0.1<br>+protocol=udp<br>+<br>+[ua1]<br>+type=endpoint<br>+aors=ua1<br>+context=default<br>+allow=!all,ulaw<br>+rewrite_contact=yes<br>+<br>+[ua1]<br>+type=aor<br>+max_contacts=1<br>+minimum_expiration=5<br>+default_expiration=30<br>+contact=sip:ua1@127.0.0.1:5062<br>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<br>new file mode 100644<br>index 0000000..60d1d4e<br>--- /dev/null<br>+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/sipp/ua1_invite_recv.xml<br>@@ -0,0 +1,97 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="UAS for forked early media testing"><br>+ <Global variables="remote_tag" /><br>+ <recv request="INVITE" crlf="true"><br>+ <action><br>+ <!-- Save the from tag. We'll need it when we send our BYE --><br>+ <ereg regexp=".*(;tag=.*)"<br>+ header="From:"<br>+ search_in="hdr"<br>+ check_it="true"<br>+ assign_to="remote_tag"/><br>+ </action><br>+ </recv><br>+ <br>+ <send><br>+ <![CDATA[<br>+<br>+ SIP/2.0 183 Call progress<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpTag01[call_number]<br>+ [last_Call-ID:]<br>+ [last_CSeq:]<br>+ Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+ Content-Type: application/sdp<br>+ Content-Length: [len]<br>+<br>+ v=0<br>+ o=user1 100 100 IN IP[local_ip_type] 127.0.0.2<br>+ s=-<br>+ c=IN IP[media_ip_type] 127.0.0.2<br>+ t=0 0<br>+ m=audio [media_port] RTP/AVP 0<br>+ a=rtpmap:0 PCMU/8000<br>+<br>+ ]]><br>+ </send><br>+ <br>+ <pause/><br>+<br>+ <send retrans="500"><br>+ <![CDATA[<br>+<br>+ SIP/2.0 200 OK<br>+ [last_Via:]<br>+ [last_From:]<br>+ [last_To:];tag=[pid]SIPpForkTag01[call_number]<br>+ [last_Call-ID:]<br>+ [last_CSeq:]<br>+ Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+ Content-Type: application/sdp<br>+ Content-Length: [len]<br>+<br>+ v=0<br>+ o=user1 5 5 IN IP[local_ip_type] 127.0.0.3<br>+ s=-<br>+ c=IN IP[media_ip_type] 127.0.0.3<br>+ t=0 0<br>+ m=audio [media_port] RTP/AVP 0<br>+ a=rtpmap:0 PCMU/8000<br>+<br>+ ]]><br>+ </send><br>+<br>+ <recv request="ACK"<br>+ rtd="true"<br>+ crlf="true"><br>+ </recv><br>+<br>+ <send retrans="500"><br>+ <![CDATA[<br>+<br>+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+ From: ua1 <sip:ua1@[local_ip]:[local_port]>;tag=[pid]SIPpForkTag01[call_number]<br>+ To: [$remote_tag]<br>+ [last_Call-ID:]<br>+ CSeq: [cseq] BYE<br>+ Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]><br>+ Max-Forwards: 70<br>+ Subject: Path Test<br>+ Content-Length: 0<br>+<br>+ ]]><br>+ </send><br>+<br>+ <recv response="200"><br>+ </recv><br>+<br>+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>+<br>+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>+<br>+</scenario><br>+<br>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<br>new file mode 100644<br>index 0000000..fb38067<br>--- /dev/null<br>+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/early_media/test-config.yaml<br>@@ -0,0 +1,54 @@<br>+testinfo:<br>+ summary: 'Tests a call to a UA which forks the call in order to send early media'<br>+ description: |<br>+ 'The UA in this test first replies to the INVITE with a SIP 183 and the IP<br>+ address 127.0.0.2 as RTP source. Then, in the SIP 200 the call is forked by<br>+ changing the to tag and the RTP source IP is changed to 127.0.0.3.<br>+ We check if Asterisk properly handles the changed SDP in the 200 OK by<br>+ updating the RTP IP to 127.0.0.3.<br>+ This scenario is supported by PJsip in https://trac.pjsip.org/repos/ticket/657'<br>+<br>+properties:<br>+ minversion: '14.0'<br>+ dependencies:<br>+ - python : 'twisted'<br>+ - python : 'starpy'<br>+ - app : 'sipp'<br>+ - asterisk : 'res_pjsip'<br>+ tags:<br>+ - pjsip<br>+<br>+test-modules:<br>+ test-object:<br>+ config-section: sipp-config<br>+ typename: 'sipp.SIPpTestCase'<br>+ modules:<br>+ -<br>+ config-section: originator-ua1_invite_recv<br>+ typename: 'pluggable_modules.Originator'<br>+ -<br>+ config-section: 'ami-config'<br>+ typename: 'ami.AMIEventModule'<br>+<br>+originator-ua1_invite_recv:<br>+ trigger: 'ami_connect'<br>+<br>+sipp-config:<br>+ memcheck-delay-stop: 7<br>+ fail-on-any: True<br>+ test-iterations:<br>+ -<br>+ scenarios:<br>+ - { 'key-args': {'scenario': 'ua1_invite_recv.xml', '-p': '5062', '-send_timeout': '20000', '-recv_timeout': '20000', '-timeout': '25000'},}<br>+<br>+ami-config:<br>+ -<br>+ type: 'headermatch'<br>+ conditions:<br>+ match:<br>+ Event: 'UserEvent'<br>+ UserEvent: 'rtpinfo'<br>+ requirements:<br>+ match:<br>+ dest: '127.0.0.3: *'<br>+ count: '1'<br>diff --git a/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml b/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml<br>index 7e9339f..543a17a 100644<br>--- a/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml<br>+++ b/tests/channels/pjsip/basic_calls/outgoing/nominal/tests.yaml<br>@@ -4,3 +4,4 @@<br> - test: 'auth'<br> - test: 'nat'<br> - test: 'peer_in_dialog_auths'<br>+ - test: 'early_media'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8303">change 8303</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/8303"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I62accd4f993a6f42c77661e4943c1e9df5fbe04c </div>
<div style="display:none"> Gerrit-Change-Number: 8303 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lvl <digium@lvlconsultancy.nl> </div>