<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/5910">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, approved; Verified
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Add a test for PJSIP_DTMF_MODE<br><br>This adds a test for the new PJSIP_DTMF_MODE<br>dialplan function which allows querying and changing<br>the DTMF mode of a PJSIP channel in the dialplan.<br><br>ASTERISK-27085<br><br>Change-Id: I8ae7d73aedc42533512adf7b96ed0eab8e09ad8c<br>---<br>A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/extensions.conf<br>A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/sipp/A_PARTY.xml<br>A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/test-config.yaml<br>M tests/channels/pjsip/dialplan_functions/tests.yaml<br>5 files changed, 232 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/extensions.conf b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..24097ee<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/extensions.conf<br>@@ -0,0 +1,14 @@<br>+[general]<br>+static=yes<br>+writeprotect=yes<br>+autofallthrough=yes<br>+clearglobalvars=no<br>+priorityjumping=yes<br>+<br>+[globals]<br>+<br>+[default]<br>+exten => _X.,1,Set(PJSIP_DTMF_MODE()=info)<br>+exten => _X.,n,Answer()<br>+exten => _X.,n,SendDTMF(4)<br>+exten => _X.,n,Wait(360)<br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/pjsip.conf b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..995fccb<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/pjsip.conf<br>@@ -0,0 +1,55 @@<br>+;--<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+Non mapped elements start<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[general]<br>+sipdebug = yes<br>+<br>+[PEER_A]<br>+port = 6060<br>+<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+Non mapped elements end<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+--;<br>+<br>+<br>+[global]<br>+type = global<br>+debug = yes<br>+<br>+[transport-udp6]<br>+type = transport<br>+protocol = udp<br>+bind = [::]:5060<br>+<br>+[transport-udp]<br>+type = transport<br>+protocol = udp<br>+bind = 0.0.0.0:5060<br>+<br>+[PEER_A]<br>+type = aor<br>+contact = sip:127.0.0.1:6060<br>+<br>+[PEER_A]<br>+type = identify<br>+endpoint = PEER_A<br>+match = 127.0.0.1<br>+<br>+[PEER_A]<br>+type = endpoint<br>+context = default<br>+disallow = all<br>+allow = alaw<br>+allow = ulaw<br>+allow = g729<br>+allow = h263p<br>+allow = h264<br>+direct_media = no<br>+send_rpid = yes<br>+sdp_session = session<br>+aors = PEER_A<br>+t38_udptl = yes<br>+t38_udptl_ec = redundancy<br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/sipp/A_PARTY.xml b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/sipp/A_PARTY.xml<br>new file mode 100644<br>index 0000000..c8c445d<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/sipp/A_PARTY.xml<br>@@ -0,0 +1,133 @@<br>+<?xml version="1.0" encoding="ISO-8859-1"?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<!-- This program is free software; you can redistribute it and/or      --><br>+<!-- modify it under the terms of the GNU General Public License as     --><br>+<!-- published by the Free Software Foundation; either version 2 of the --><br>+<!-- License, or (at your option) any later version.                    --><br>+<!--                                                                    --><br>+<!-- This program is distributed in the hope that it will be useful,    --><br>+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     --><br>+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      --><br>+<!-- GNU General Public License for more details.                       --><br>+<!--                                                                    --><br>+<!-- You should have received a copy of the GNU General Public License  --><br>+<!-- along with this program; if not, write to the                      --><br>+<!-- Free Software Foundation, Inc.,                                    --><br>+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             --><br>+<!--                                                                    --><br>+<!--                 Sipp 'uac' scenario with pcap (rtp) play           --><br>+<!--                                                                    --><br>+<scenario name="DTMF_INFO_FORCE"><br>+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         --><br>+  <!-- generated by sipp. To do so, use [call_id] keyword.                --><br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      INVITE sip:[service]@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: sipp <sip:test@voxbone.com>;tag=[call_number]<br>+      To: sut <sip:[service]@voxbone.com:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 INVITE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Type: application/sdp<br>+      Content-Length: [len]<br>+<br>+      v=0<br>+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br>+      s=-<br>+      c=IN IP[local_ip_type] [local_ip]<br>+      t=0 0<br>+      m=audio 9000 RTP/AVP 0 101<br>+      a=rtpmap:0 PCMU/8000<br>+      a=rtpmap:101 telephone-event/8000<br>+      a=fmtp:101 0-15<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="100" optional="true"><br>+  </recv><br>+<br>+  <recv response="180" optional="true"><br>+  </recv><br>+<br>+  <!-- By adding rrs="true" (Record Route Sets), the route sets         --><br>+  <!-- are saved and used for following messages sent. Useful to test   --><br>+  <!-- against stateful SIP proxies/B2BUAs.                             --><br>+  <recv response="200" rtd="true" crlf="true"><br>+  </recv><br>+<br>+<br>+  <!-- Packet lost can be simulated in any send/recv message by         --><br>+  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       --><br>+  <send><br>+    <![CDATA[<br>+<br>+      ACK sip:[service]@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: sipp <sip:test@[local_ip]:[local_port]>;tag=[call_number]<br>+      To: sut <sip:[service]@voxbone.com>[peer_tag_param]<br>+      Call-ID: [call_id]<br>+      CSeq: 1 ACK<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Length: 0<br>+<br>+    ]]><br>+  </send><br>+<br>+<!-- Receive the DIGIT 4--><br>+<recv request="INFO"> <br>+  <action><br>+        <ereg regexp="(Signal=4)" search_in="body" check_it="true" assign_to = "1" /><br>+          <log message="---DTMF--- [$1]"/><br>+  </action><br>+</recv> <br>+ <br>+<br>+<send> <br>+<![CDATA[ <br>+  <br>+SIP/2.0 200 OK <br>+[last_Via:] <br>+[last_From:] <br>+[last_To:] <br>+[last_Call-ID:] <br>+[last_CSeq:] <br>+Content-Length: 0 <br>+ <br>+]]> <br>+</send> <br>+<br>+  <!-- The 'crlf' option inserts a blank line in the statistics report. --><br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      BYE sip:[service]@voxbone.com SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: sipp <sip:test@[local_ip]:[local_port]>;tag=[call_number]<br>+      To: sut <sip:[service]@voxbone.com>[peer_tag_param]<br>+      Call-ID: [call_id]<br>+      CSeq: 2 BYE<br>+      Contact: sip:sipp@[local_ip]:[local_port]<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Content-Length: 0<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="200" crlf="true"><br>+  </recv><br>+<br>+  <!-- definition of the response time repartition table (unit is ms)   --><br>+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/><br>+<br>+  <!-- definition of the call length repartition table (unit is ms)     --><br>+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/><br>+<br>+</scenario><br>diff --git a/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/test-config.yaml b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/test-config.yaml<br>new file mode 100644<br>index 0000000..f6b969f<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/test-config.yaml<br>@@ -0,0 +1,29 @@<br>+testinfo:<br>+    summary:     'Receive a SIP call and confirm that changing the DTMF mode works'<br>+    description: |<br>+        'Using SIPp place a call into Asterisk that negotiates DTMF using RFC2833. In the dialplan change<br>+         the DTMF mode using the PJSIP_DTMF_MODE dialplan function. Once changed send a DTMF using SendDTMF<br>+         and confirm that INFO DTMF was sent instead of the negotiated RFC2833.'<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: test-object-config<br>+        typename: 'sipp.SIPpTestCase'<br>+<br>+test-object-config:<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - { 'key-args': {'scenario': 'A_PARTY.xml', '-i': '127.0.0.1', '-p': '5061', '-s': '1000'} }<br>+<br>+properties:<br>+    minversion: '13.18.0'<br>+    dependencies:<br>+        - python: 'twisted'<br>+        - python: 'starpy'<br>+        - sipp:<br>+            version: 'v3.3'<br>+        - asterisk: 'res_pjsip'<br>+    tags:<br>+        - pjsip<br>+<br>diff --git a/tests/channels/pjsip/dialplan_functions/tests.yaml b/tests/channels/pjsip/dialplan_functions/tests.yaml<br>index 1aed251..f653aa8 100644<br>--- a/tests/channels/pjsip/dialplan_functions/tests.yaml<br>+++ b/tests/channels/pjsip/dialplan_functions/tests.yaml<br>@@ -7,3 +7,4 @@<br>     - test: 'pjsip_session_refresh'<br>     - test: 'chan_is_avail'<br>     - test: 'pjsip_header'<br>+    - test: 'pjsip_dtmfmode'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5910">change 5910</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/5910"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I8ae7d73aedc42533512adf7b96ed0eab8e09ad8c </div>
<div style="display:none"> Gerrit-Change-Number: 5910 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>