[Asterisk-code-review] chan_pjsip: (testsuite[master])

Henning Westerholt asteriskteam at digium.com
Mon Mar 20 12:32:58 CDT 2023


Henning Westerholt has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/19978 )


Change subject: chan_pjsip:
......................................................................

chan_pjsip:

Extend test suite to also test for a scenario with an late offer.
Existing test was moved to 'early-offer' directory, add a second
directory for the new tests. Change test include in tests.yaml.

The late-offer test will fail until the bugfix is also merged.

ASTERISK-30473

Change-Id: I58f207172562e318d6ab9f352e3a695835b06bef
---
R tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/extensions.conf
R tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/pjsip.conf
R tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/sipp/empty-reinvite-all-codecs.xml
C tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/test-config.yaml
C tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/extensions.conf
C tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/pjsip.conf
A tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/sipp/empty-reinvite-all-codecs.xml
R tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/test-config.yaml
A tests/channels/pjsip/all_codecs_on_empty_reinvite/tests.yaml
M tests/channels/pjsip/tests.yaml
10 files changed, 213 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/78/19978/1

diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/extensions.conf b/tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/extensions.conf
similarity index 100%
rename from tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/extensions.conf
rename to tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/extensions.conf
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/pjsip.conf b/tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/pjsip.conf
similarity index 100%
rename from tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/pjsip.conf
rename to tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/configs/ast1/pjsip.conf
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/sipp/empty-reinvite-all-codecs.xml b/tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/sipp/empty-reinvite-all-codecs.xml
similarity index 100%
rename from tests/channels/pjsip/all_codecs_on_empty_reinvite/sipp/empty-reinvite-all-codecs.xml
rename to tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/sipp/empty-reinvite-all-codecs.xml
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml b/tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/test-config.yaml
similarity index 90%
copy from tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml
copy to tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/test-config.yaml
index 26bf933..5295c44 100644
--- a/tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml
+++ b/tests/channels/pjsip/all_codecs_on_empty_reinvite/early-offer/test-config.yaml
@@ -5,7 +5,8 @@
         send an re-INVITE without SDP. Asterisk should send an SDP offer in the 200 OK
         response containing all configured codecs on the endpoint if the parameter
         all_codecs_on_empty_reinvite is activated. An re-INVITE with SDP should be
-        answered normally.'
+        answered normally. In this scenario the usual early SDP offer in the INVITE is
+        used.'
 
 test-modules:
     test-object:
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/extensions.conf b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/extensions.conf
similarity index 100%
copy from tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/extensions.conf
copy to tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/extensions.conf
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/pjsip.conf b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/pjsip.conf
similarity index 100%
copy from tests/channels/pjsip/all_codecs_on_empty_reinvite/configs/ast1/pjsip.conf
copy to tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/configs/ast1/pjsip.conf
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/sipp/empty-reinvite-all-codecs.xml b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/sipp/empty-reinvite-all-codecs.xml
new file mode 100644
index 0000000..d11287b
--- /dev/null
+++ b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/sipp/empty-reinvite-all-codecs.xml
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="empty reinvite all codecs">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="100"
+        optional="true">
+  </recv>
+
+  <recv response="181"
+        optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+
+  <recv response="183" optional="true">
+  </recv>
+
+  <recv response="200" rtd="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 1 ACK
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      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 8
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+      a=ptime:20
+
+    ]]>
+  </send>
+
+  <pause milliseconds="500"/>
+
+<!-- For a re-INVITE with empty SDP Asterisk should return all codecs from the endpoint -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 2 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" rtd="true">
+    <action>
+      <ereg regexp="m=audio [0-9]{1,5} RTP/AVP 9 8 0 97 107 101+..*"
+            search_in="body" check_it="true" assign_to="1"/>
+      <test assign_to="1" variable="1" compare="equal" value=""/>
+    </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 2 ACK
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+<!-- Normal re-INIVTE, Asterisk should return negotiated codecs -->
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 3 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      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 8
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+      a=ptime:20
+
+    ]]>
+  </send>
+
+  <recv response="200" rtd="true">
+    <action>
+      <ereg regexp="m=audio [0-9]{1,5} RTP/AVP 8 0+..*"
+            search_in="body" check_it="true" assign_to="1"/>
+      <test assign_to="1" variable="1" compare="equal" value=""/>
+    </action>
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 3 ACK
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+
+    ]]>
+  </send>
+-->
+
+ <pause milliseconds="1000"/>
+
+  <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: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+      Call-ID: [call_id]
+      CSeq: 4 BYE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <recv response="200"/>
+
+</scenario>
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/test-config.yaml
similarity index 91%
rename from tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml
rename to tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/test-config.yaml
index 26bf933..e090da6 100644
--- a/tests/channels/pjsip/all_codecs_on_empty_reinvite/test-config.yaml
+++ b/tests/channels/pjsip/all_codecs_on_empty_reinvite/late-offer/test-config.yaml
@@ -5,7 +5,7 @@
         send an re-INVITE without SDP. Asterisk should send an SDP offer in the 200 OK
         response containing all configured codecs on the endpoint if the parameter
         all_codecs_on_empty_reinvite is activated. An re-INVITE with SDP should be
-        answered normally.'
+        answered normally. In this scenario a late SDP offer in the ACK is used.'
 
 test-modules:
     test-object:
diff --git a/tests/channels/pjsip/all_codecs_on_empty_reinvite/tests.yaml b/tests/channels/pjsip/all_codecs_on_empty_reinvite/tests.yaml
new file mode 100644
index 0000000..28afb2e
--- /dev/null
+++ b/tests/channels/pjsip/all_codecs_on_empty_reinvite/tests.yaml
@@ -0,0 +1,3 @@
+tests:
+    - test: 'early-offer'
+    - test: 'late-offer'
diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml
index 3ae1bb2..34d7633 100644
--- a/tests/channels/pjsip/tests.yaml
+++ b/tests/channels/pjsip/tests.yaml
@@ -38,6 +38,7 @@
     - dir: 'connected_line'
     - dir: 'rtp_ptime'
     - dir: 'ignore_183_wo_sdp'
+    - dir: 'all_codecs_on_empty_reinvite'
     - test: 'accountcode'
     - test: 'acl_call'
     - test: 'allow_overlap'
@@ -70,4 +71,3 @@
     - test: 'non_negotiated_frame_SSRC_change'
     - test: 'content_disposition'
     - test: 'reinvite_after_bye'
-    - test: 'all_codecs_on_empty_reinvite'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I58f207172562e318d6ab9f352e3a695835b06bef
Gerrit-Change-Number: 19978
Gerrit-PatchSet: 1
Gerrit-Owner: Henning Westerholt <hw at gilawa.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230320/5f8da145/attachment-0001.html>


More information about the asterisk-code-review mailing list