[asterisk-commits] testsuite: Add a test for PJSIP DTMF MODE (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 1 14:51:31 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5910 )

Change subject: testsuite: Add a test for PJSIP_DTMF_MODE
......................................................................

testsuite: Add a test for PJSIP_DTMF_MODE

This adds a test for the new PJSIP_DTMF_MODE
dialplan function which allows querying and changing
the DTMF mode of a PJSIP channel in the dialplan.

ASTERISK-27085

Change-Id: I8ae7d73aedc42533512adf7b96ed0eab8e09ad8c
---
A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/extensions.conf
A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/configs/ast1/pjsip.conf
A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/sipp/A_PARTY.xml
A tests/channels/pjsip/dialplan_functions/pjsip_dtmfmode/test-config.yaml
M tests/channels/pjsip/dialplan_functions/tests.yaml
5 files changed, 232 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified
  Jenkins2: Approved for Submit



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

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ae7d73aedc42533512adf7b96ed0eab8e09ad8c
Gerrit-Change-Number: 5910
Gerrit-PatchSet: 9
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170801/88422ffe/attachment-0001.html>


More information about the asterisk-commits mailing list