<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/5878">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res/pjsip Add test for 'auto_info'<br><br>test to validate new dtmf mode 'auto_info'<br><br>ASTERISK-27066 #close<br><br>Change-Id: I674d3a6dc678f275bb39738505ee032dd86dbb37<br>---<br>A tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf<br>A tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/dtmf_info_fallback/run-test<br>A tests/channels/pjsip/dtmf_info_fallback/sipp/A_PARTY.xml<br>A tests/channels/pjsip/dtmf_info_fallback/sipp/B_PARTY.xml<br>A tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap<br>A tests/channels/pjsip/dtmf_info_fallback/test-config.yaml<br>M tests/channels/pjsip/tests.yaml<br>8 files changed, 407 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/78/5878/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf<br>new file mode 100644<br>index 0000000..35c0a08<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf<br>@@ -0,0 +1,12 @@<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 => s,n,Dial(pjsip/sbc,180)<br>+<br>diff --git a/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf<br>new file mode 100644<br>index 0000000..025b2a9<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf<br>@@ -0,0 +1,80 @@<br>+;--<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+Non mapped elements start<br>+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>+<br>+[general]<br>+sipdebug = yes<br>+<br>+[PEER_A]<br>+port = 6060<br>+<br>+[sbc]<br>+port = 5700<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>+dtmf_mode = auto_info<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>+t38_udptl = yes<br>+t38_udptl_ec = redundancy<br>+<br>+[sbc]<br>+type = aor<br>+contact = sip:127.0.0.1:5700<br>+<br>+[sbc]<br>+type = endpoint<br>+context = callcontrol<br>+dtmf_mode = auto_info<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 = sbc<br>+t38_udptl = yes<br>+t38_udptl_ec = redundancy<br>+<br>diff --git a/tests/channels/pjsip/dtmf_info_fallback/run-test b/tests/channels/pjsip/dtmf_info_fallback/run-test<br>new file mode 100755<br>index 0000000..241bd58<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/run-test<br>@@ -0,0 +1,70 @@<br>+#!/usr/bin/env python<br>+'''<br>+Copyright (C) 2010, Digium, Inc.<br>+Russell Bryant <russell@digium.com><br>+<br>+This program is free software, distributed under the terms of<br>+the GNU General Public License Version 2.<br>+'''<br>+<br>+import sys<br>+import os<br>+import signal<br>+import subprocess<br>+import time<br>+<br>+sys.path.append("lib/python")<br>+sys.path.append("utils")<br>+<br>+from twisted.internet import reactor<br>+from asterisk.sipp import SIPpTest<br>+<br>+WORKING_DIR = os.path.abspath(os.path.dirname(__file__))<br>+TEST_DIR = os.path.dirname(os.path.realpath(__file__))<br>+<br>+sippA_logfile = WORKING_DIR + "/A_PARTY.log"<br>+sippA_errfile = WORKING_DIR + "/A_PARTY_ERR.log"<br>+sippB_logfile = WORKING_DIR + "/B_PARTY.log"<br>+sippB_errfile = WORKING_DIR + "/B_PARTY_ERR.log"<br>+SIPP_SCENARIOS = [<br>+ {<br>+ 'scenario' : 'B_PARTY.xml',<br>+ '-i' : '127.0.0.1',<br>+ '-p' : '5700',<br>+ '-mp' : '6300',<br>+ '-message_file' : sippB_logfile,<br>+ '-error_file' : sippB_errfile,<br>+ '-trace_msg' : '-trace_err',<br>+ },<br>+ {<br>+ 'scenario' : 'A_PARTY.xml',<br>+ '-i' : '127.0.0.1',<br>+ '-p' : '6060',<br>+ '-s' : '3228080970',<br>+ '-d' : '35000',<br>+ '-message_file' : sippA_logfile,<br>+ '-error_file' : sippA_errfile,<br>+ '-trace_msg' : '-trace_err',<br>+ }<br>+]<br>+<br>+<br>+def main():<br>+ test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)<br>+ test.reactor_timeout = 70;<br>+<br>+ time.sleep(10) #Wait 5 seconds to ensure that all the sockets are open before running the test <br>+<br>+ reactor.run()<br>+<br>+ if not test.passed:<br>+ return 1<br>+<br>+ return 0<br>+<br>+<br>+if __name__ == "__main__":<br>+ sys.exit(main())<br>+<br>+<br>+# vim:sw=4:ts=4:expandtab:textwidth=79<br>diff --git a/tests/channels/pjsip/dtmf_info_fallback/sipp/A_PARTY.xml b/tests/channels/pjsip/dtmf_info_fallback/sipp/A_PARTY.xml<br>new file mode 100644<br>index 0000000..ada8590<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/A_PARTY.xml<br>@@ -0,0 +1,124 @@<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_FALLBACK"><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>+ <!-- Play a PCAP which sends the RTPEVENT packet containing DTMF 4 --><br>+ <nop><br>+ <action><br>+ <exec play_pcap_audio="./tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap"/><br>+ </action><br>+ </nop><br>+<br>+ <pause milliseconds="7000"/><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>+ <!-- Keep the call open for a while in case the 200 is lost to be --><br>+ <!-- able to retransmit it if we receive the BYE again. --><br>+ <pause milliseconds="3000"/><br>+<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/dtmf_info_fallback/sipp/B_PARTY.xml b/tests/channels/pjsip/dtmf_info_fallback/sipp/B_PARTY.xml<br>new file mode 100644<br>index 0000000..a8a3d92<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/B_PARTY.xml<br>@@ -0,0 +1,109 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="DTMF Handling"><br>+<br>+<recv request="INVITE" crlf="true"><br>+</recv><br>+<br>+<br>+<br>+<send><br>+<![CDATA[<br>+<br>+SIP/2.0 100 Trying<br>+[last_Via:]<br>+[last_Call-ID:]<br>+[last_From:]<br>+[last_To:]<br>+[last_CSeq:]<br>+Content-Length: 0<br>+<br>+]]><br>+</send><br>+<br>+<br>+<send retrans="500"><br>+<![CDATA[<br>+<br>+SIP/2.0 200 OK<br>+[last_Via:]<br>+[last_Call-ID:]<br>+[last_From:]<br>+[last_To:];tag=[call_number]<br>+[last_CSeq:]<br>+Contact: <sip:736596371553211257@[local_ip]:[local_port];user=phone><br>+Content-Type: application/sdp<br>+Content-Length: [len]<br>+<br>+v=0<br>+o=HuaweiSoftX3000 6644052 6644052 IN IP[local_ip_type] [local_ip]<br>+s=Sip Call<br>+c=IN IP[local_ip_type] [local_ip]<br>+t=0 0<br>+m=audio 8000 RTP/AVP 0<br>+a=rtpmap:0 PCMU/8000<br>+<br>+]]><br>+</send><br>+<br>+<br>+<recv request="ACK"<br>+ rtd="true"<br>+ crlf="true"><br>+<br>+</recv><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>+<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>+<recv request="BYE"> <br>+</recv> <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>+<br>+<!-- Keep the call open for a while in case the 200 is lost to be --><br>+<!-- able to retransmit it if we receive the BYE again. --><br>+<pause milliseconds="3000"/><br>+<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>+<br>diff --git a/tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap b/tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap<br>new file mode 100644<br>index 0000000..b3bd1ef<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap<br>Binary files differ<br>diff --git a/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml b/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml<br>new file mode 100644<br>index 0000000..e0c5c52<br>--- /dev/null<br>+++ b/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml<br>@@ -0,0 +1,11 @@<br>+testinfo:<br>+ summary: 'This test case verifies the DTMF INFO FALLBACK i.e fallback tO INFO instead of INBAND'<br>+ description: |<br>+ 'This test case verifies the DTMF INFO FALLBACK i.e fallback tO INFO instead of INBAND'<br>+<br>+properties:<br>+ minversion: '13'<br>+ dependencies:<br>+ - app : 'sipp'<br>+ tags:<br>+ - SIP<br>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml<br>index 59f5f1c..54ff285 100644<br>--- a/tests/channels/pjsip/tests.yaml<br>+++ b/tests/channels/pjsip/tests.yaml<br>@@ -53,3 +53,4 @@<br> - test: 'user_eq_phone'<br> - test: 'cseq_method'<br> - test: 'multipart_empty_part'<br>+ - test: 'dtmf_info_fallback'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5878">change 5878</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/5878"/><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: I674d3a6dc678f275bb39738505ee032dd86dbb37 </div>
<div style="display:none"> Gerrit-Change-Number: 5878 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>