[Asterisk-code-review] res/pjsip Add test for 'auto info' (testsuite[master])

Jenkins2 asteriskteam at digium.com
Wed Jul 19 09:50:19 CDT 2017


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

Change subject: res/pjsip  Add test for 'auto_info'
......................................................................

res/pjsip  Add test for 'auto_info'

test to validate new dtmf mode 'auto_info'

ASTERISK-27066 #close

Change-Id: I674d3a6dc678f275bb39738505ee032dd86dbb37
---
A tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf
A tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf
A tests/channels/pjsip/dtmf_info_fallback/sipp/alice.xml
A tests/channels/pjsip/dtmf_info_fallback/sipp/bob.xml
A tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap
A tests/channels/pjsip/dtmf_info_fallback/test-config.yaml
M tests/channels/pjsip/tests.yaml
7 files changed, 263 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Verified
  Matthew Fredrickson: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf
new file mode 100644
index 0000000..fc7e597
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/extensions.conf
@@ -0,0 +1,12 @@
+[general]
+static=yes
+writeprotect=yes
+autofallthrough=yes
+clearglobalvars=no
+priorityjumping=yes
+
+[globals]
+
+[default]
+exten => bob,1,Dial(pjsip/bob,180)
+
diff --git a/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..74719a5
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/configs/ast1/pjsip.conf
@@ -0,0 +1,47 @@
+[global]
+type = global
+debug = yes
+
+[transport-udp]
+type = transport
+protocol = udp
+bind = 0.0.0.0:5060
+
+[alice]
+type = endpoint
+context = default
+dtmf_mode = auto_info
+disallow = all
+allow = alaw
+allow = ulaw
+allow = g729
+allow = h263p
+allow = h264
+direct_media = no
+send_rpid = yes
+sdp_session = session
+t38_udptl = yes
+t38_udptl_ec = redundancy
+
+[bob]
+type = aor
+max_contacts=1
+contact = sip:127.0.0.1:5062
+
+[bob]
+type = endpoint
+context = default
+dtmf_mode = auto_info
+disallow = all
+allow = alaw
+allow = ulaw
+allow = g729
+allow = h263p
+allow = h264
+direct_media = no
+send_rpid = yes
+sdp_session = session
+aors = bob
+t38_udptl = yes
+t38_udptl_ec = redundancy
+
diff --git a/tests/channels/pjsip/dtmf_info_fallback/sipp/alice.xml b/tests/channels/pjsip/dtmf_info_fallback/sipp/alice.xml
new file mode 100644
index 0000000..bf3801f
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/alice.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<scenario name="DTMF_INFO_FALLBACK">
+
+<send retrans="500">
+	<![CDATA[
+
+	INVITE sip:bob@[remote_ip] SIP/2.0
+	Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+	From: sipp <sip:[service]@[local_ip]>;tag=[call_number]
+	To: bob <sip:bob@[remote_ip]:[remote_port]>
+	Call-ID: [call_id]
+	CSeq: 1 INVITE
+	Contact: sip:[service]@[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 response="180" optional="true"/>
+
+<recv response="200" crlf="true"/>
+
+<send>
+	<![CDATA[
+
+	ACK sip:[service]@[remote_ip] SIP/2.0
+	Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+	From: sipp <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]
+	To: bob <sip:bob@[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-Length: 0
+
+	]]>
+</send>
+
+<!-- Play a PCAP which sends the RTPEVENT packet containing DTMF 4 -->
+<nop>
+	<action>
+		<exec play_pcap_audio="./tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap"/>
+	</action>
+</nop>
+
+<pause milliseconds="5000"/>
+
+<send retrans="500">
+	<![CDATA[
+
+	BYE sip:[service]@[remote_ip] 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]@[remote_ip]>[peer_tag_param]
+	Call-ID: [call_id]
+	CSeq: 2 BYE
+	Contact: sip:[service]@[local_ip]:[local_port]
+	Max-Forwards: 70
+	Subject: Performance Test
+	Content-Length: 0
+
+	]]>
+</send>
+
+<recv response="200" crlf="true"/>
+
+</scenario>
diff --git a/tests/channels/pjsip/dtmf_info_fallback/sipp/bob.xml b/tests/channels/pjsip/dtmf_info_fallback/sipp/bob.xml
new file mode 100644
index 0000000..9de8006
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/bob.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="DTMF Handling">
+
+<recv request="INVITE" crlf="true"/>
+
+<send>
+	<![CDATA[
+
+	SIP/2.0 100 Trying
+	[last_Via:]
+	[last_Call-ID:]
+	[last_From:]
+	[last_To:]
+	[last_CSeq:]
+	Content-Length: 0
+
+	]]>
+</send>
+
+<send retrans="500">
+	<![CDATA[
+
+	SIP/2.0 200 OK
+	[last_Via:]
+	[last_Call-ID:]
+	[last_From:]
+	[last_To:];tag=[call_number]
+	[last_CSeq:]
+	Contact: <sip:[service]@[local_ip]:[local_port];user=phone>
+	Content-Type: application/sdp
+	Content-Length: [len]
+
+	v=0
+	o=HuaweiSoftX3000 6644052 6644052 IN IP[local_ip_type] [local_ip]
+	s=Sip Call
+	c=IN IP[local_ip_type] [local_ip]
+	t=0 0
+	m=audio 8000 RTP/AVP 0
+	a=rtpmap:0 PCMU/8000
+
+	]]>
+</send>
+
+<recv request="ACK" rtd="true" crlf="true"/>
+
+<!-- Receive the DIGIT 4-->
+<recv request="INFO"> 
+	<action>
+		<ereg regexp="(Signal=4)" search_in="body" check_it="true" assign_to = "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> 
+
+<recv request="BYE"/> 
+ 
+<send> 
+	<![CDATA[ 
+
+	SIP/2.0 200 OK 
+	[last_Via:] 
+	[last_From:] 
+	[last_To:] 
+	[last_Call-ID:] 
+	[last_CSeq:] 
+	Content-Length: 0 
+
+	]]> 
+</send> 
+
+<!-- Keep the call open for a while in case the 200 is lost to be     -->
+<!-- able to retransmit it if we receive the BYE again.               -->
+<pause milliseconds="3000"/>
+
+<Reference variables="1"/>
+
+</scenario>
+
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
new file mode 100644
index 0000000..b3bd1ef
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/sipp/dtmf_2833_4.pcap
Binary files differ
diff --git a/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml b/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml
new file mode 100644
index 0000000..138eec3
--- /dev/null
+++ b/tests/channels/pjsip/dtmf_info_fallback/test-config.yaml
@@ -0,0 +1,29 @@
+testinfo:
+    summary: 'This test case verifies the DTMF INFO FALLBACK i.e fallback tO INFO instead of INBAND'
+    description: |
+        'This test case verifies the DTMF INFO FALLBACK i.e fallback tO INFO instead of INBAND'
+
+properties:
+    minversion: [ '13.17.0', '14.6.0' ]
+    dependencies:
+        - app : 'sipp'
+        - asterisk : 'res_pjsip'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        typename: sipp.SIPpTestCase
+        config-section: sipp-config
+
+sipp-config:
+    connect-ami: True
+    reactor-timeout: 15
+    fail-on-any: True
+    stop-after-scenarios: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'bob.xml', '-p': '5062', '-s': 'bob'} }
+                - { 'key-args': {'scenario': 'alice.xml', '-p': '5061', '-s': 'alice'} }
+
diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml
index 59f5f1c..54ff285 100644
--- a/tests/channels/pjsip/tests.yaml
+++ b/tests/channels/pjsip/tests.yaml
@@ -53,3 +53,4 @@
     - test: 'user_eq_phone'
     - test: 'cseq_method'
     - test: 'multipart_empty_part'
+    - test: 'dtmf_info_fallback'

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I674d3a6dc678f275bb39738505ee032dd86dbb37
Gerrit-Change-Number: 5878
Gerrit-PatchSet: 4
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170719/3fa9836a/attachment-0001.html>


More information about the asterisk-code-review mailing list