[Asterisk-code-review] Testsuite: Fix tests/channels/pjsip/info dtmf (testsuite[master])

Richard Mudgett asteriskteam at digium.com
Thu Jun 30 12:01:58 CDT 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/3119

Change subject: Testsuite: Fix tests/channels/pjsip/info_dtmf
......................................................................

Testsuite: Fix tests/channels/pjsip/info_dtmf

The test was actually not negotiating SDP because it had the
Content-Type header on the wrong messages.  The initial INVITE
was missing it and the ACK message had it but with no body.

* Fixed the sipp scenario SDP negotiation.

* Updated the test module dependency list.

Change-Id: Ic6b5abc2fdbb9facc7f1179c5480336417aacc78
---
M tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf
M tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml
M tests/channels/pjsip/info_dtmf/sipp/dtmf.xml
M tests/channels/pjsip/info_dtmf/test-config.yaml
4 files changed, 10 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/19/3119/1

diff --git a/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf b/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf
index 8e6bdbb..ccf05d1 100644
--- a/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf
+++ b/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf
@@ -2,4 +2,7 @@
 
 exten => dtmf,1,NoOp()
     same => n,Answer()
+    ; We must use MusicOnHold instead of Echo because we are sending DTMF
+    ; and echo will send the digits back as well as exit on DTMF '#'.
     same => n,MusicOnHold()
+    same => n,Hangup()
diff --git a/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml b/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml
index b6311ef..ec64c0d 100644
--- a/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml
+++ b/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml
@@ -4,7 +4,6 @@
 <scenario name="INFO Test with duration">
   <send retrans="500">
     <![CDATA[
-
       INVITE sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test2 <sip:test2@[local_ip]:[local_port]>;tag=[call_number]
@@ -14,6 +13,7 @@
       Contact: sip:test2@[local_ip]:[local_port]
       Max-Forwards: 70
       Subject: INFO Test
+      Content-Type: application/sdp
       Content-Length: [len]
 
       v=0
@@ -21,9 +21,8 @@
       s=-
       c=IN IP[media_ip_type] [media_ip]
       t=0 0
-      m=audio 6000 RTP/AVP 0
+      m=audio [media_port] RTP/AVP 0
       a=rtpmap:0 PCMU/8000
-
     ]]>
   </send>
 
@@ -35,7 +34,6 @@
 
   <send>
     <![CDATA[
-
       ACK sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test2 <sip:test2@[local_ip]:[local_port]>;tag=[call_number]
@@ -45,15 +43,12 @@
       Contact: sip:test2@[local_ip]:[local_port]
       Max-Forwards: 70
       Subject: INFO Test
-      Content-Type: application/sdp
       Content-Length: 0
-
     ]]>
   </send>
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -67,7 +62,6 @@
 
       Signal=0
       Duration=150
-
     ]]>
   </send>
 
@@ -76,7 +70,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -90,7 +83,6 @@
 
       Signal=1
       Duration=150
-
     ]]>
   </send>
 
@@ -99,7 +91,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -113,7 +104,6 @@
 
       Signal=2
       Duration=150
-
     ]]>
   </send>
 
@@ -122,7 +112,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -136,7 +125,6 @@
 
       Signal=3
       Duration=150
-
     ]]>
   </send>
 
@@ -145,7 +133,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -159,7 +146,6 @@
 
       Signal=4
       Duration=150
-
     ]]>
   </send>
 
@@ -168,7 +154,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -182,7 +167,6 @@
 
       Signal=5
       Duration=150
-
     ]]>
   </send>
 
@@ -191,7 +175,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -205,7 +188,6 @@
 
       Signal=6
       Duration=150
-
     ]]>
   </send>
 
@@ -214,7 +196,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -228,7 +209,6 @@
 
       Signal=7
       Duration=150
-
     ]]>
   </send>
 
@@ -237,7 +217,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -251,7 +230,6 @@
 
       Signal=8
       Duration=150
-
     ]]>
   </send>
 
@@ -260,7 +238,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -274,7 +251,6 @@
 
       Signal=9
       Duration=150
-
     ]]>
   </send>
 
@@ -283,7 +259,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -297,7 +272,6 @@
 
       Signal=10
       Duration=150
-
     ]]>
   </send>
 
@@ -306,7 +280,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -320,7 +293,6 @@
 
       Signal=11
       Duration=150
-
     ]]>
   </send>
 
@@ -329,7 +301,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -343,7 +314,6 @@
 
       Signal=12
       Duration=150
-
     ]]>
   </send>
 
@@ -352,7 +322,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -366,7 +335,6 @@
 
       Signal=13
       Duration=150
-
     ]]>
   </send>
 
@@ -375,7 +343,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -389,7 +356,6 @@
 
       Signal=14
       Duration=150
-
     ]]>
   </send>
 
@@ -398,7 +364,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -412,7 +377,6 @@
 
       Signal=15
       Duration=150
-
     ]]>
   </send>
 
@@ -423,7 +387,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       BYE sip:test2@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test2 <sip:test2@[local_ip]:[local_port]>;tag=[call_number]
@@ -434,7 +397,6 @@
       Max-Forwards: 70
       Subject: INFO Test
       Content-Length: 0
-
     ]]>
   </send>
 
diff --git a/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml b/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml
index 356ca94..59a6e85 100644
--- a/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml
+++ b/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml
@@ -4,7 +4,6 @@
 <scenario name="INFO Test no duration">
   <send retrans="500">
     <![CDATA[
-
       INVITE sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
@@ -14,6 +13,7 @@
       Contact: sip:test@[local_ip]:[local_port]
       Max-Forwards: 70
       Subject: INFO Test
+      Content-Type: application/sdp
       Content-Length: [len]
 
       v=0
@@ -21,9 +21,8 @@
       s=-
       c=IN IP[media_ip_type] [media_ip]
       t=0 0
-      m=audio 6000 RTP/AVP 0
+      m=audio [media_port] RTP/AVP 0
       a=rtpmap:0 PCMU/8000
-
     ]]>
   </send>
 
@@ -35,7 +34,6 @@
 
   <send>
     <![CDATA[
-
       ACK sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
@@ -45,15 +43,12 @@
       Contact: sip:test@[local_ip]:[local_port]
       Max-Forwards: 70
       Subject: INFO Test
-      Content-Type: application/sdp
       Content-Length: 0
-
     ]]>
   </send>
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -66,7 +61,6 @@
       Content-Length: [len]
 
       0
-
     ]]>
   </send>
 
@@ -75,7 +69,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -88,7 +81,6 @@
       Content-Length: [len]
 
       1
-
     ]]>
   </send>
 
@@ -97,7 +89,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -110,7 +101,6 @@
       Content-Length: [len]
 
       2
-
     ]]>
   </send>
 
@@ -119,7 +109,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -132,7 +121,6 @@
       Content-Length: [len]
 
       3
-
     ]]>
   </send>
 
@@ -141,7 +129,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -154,7 +141,6 @@
       Content-Length: [len]
 
       4
-
     ]]>
   </send>
 
@@ -163,7 +149,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -176,7 +161,6 @@
       Content-Length: [len]
 
       5
-
     ]]>
   </send>
 
@@ -185,7 +169,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -198,7 +181,6 @@
       Content-Length: [len]
 
       6
-
     ]]>
   </send>
 
@@ -207,7 +189,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -220,7 +201,6 @@
       Content-Length: [len]
 
       7
-
     ]]>
   </send>
 
@@ -229,7 +209,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -242,7 +221,6 @@
       Content-Length: [len]
 
       8
-
     ]]>
   </send>
 
@@ -251,7 +229,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -264,7 +241,6 @@
       Content-Length: [len]
 
       9
-
     ]]>
   </send>
 
@@ -273,7 +249,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -286,7 +261,6 @@
       Content-Length: [len]
 
       10
-
     ]]>
   </send>
 
@@ -295,7 +269,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -308,7 +281,6 @@
       Content-Length: [len]
 
       11
-
     ]]>
   </send>
 
@@ -317,7 +289,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -330,7 +301,6 @@
       Content-Length: [len]
 
       12
-
     ]]>
   </send>
 
@@ -339,7 +309,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -352,7 +321,6 @@
       Content-Length: [len]
 
       13
-
     ]]>
   </send>
 
@@ -361,7 +329,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -374,7 +341,6 @@
       Content-Length: [len]
 
       14
-
     ]]>
   </send>
 
@@ -383,7 +349,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       INFO sip:test@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: dtmf <sip:dtmf@[local_ip]:[local_port]>;tag=[call_number]
@@ -396,7 +361,6 @@
       Content-Length: [len]
 
       15
-
     ]]>
   </send>
 
@@ -407,7 +371,6 @@
 
   <send retrans="500">
     <![CDATA[
-
       BYE sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
       From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
@@ -418,7 +381,6 @@
       Max-Forwards: 70
       Subject: INFO Test
       Content-Length: 0
-
     ]]>
   </send>
 
diff --git a/tests/channels/pjsip/info_dtmf/test-config.yaml b/tests/channels/pjsip/info_dtmf/test-config.yaml
index c1492fc..4c3f293 100644
--- a/tests/channels/pjsip/info_dtmf/test-config.yaml
+++ b/tests/channels/pjsip/info_dtmf/test-config.yaml
@@ -1,8 +1,8 @@
 testinfo:
     summary: 'Test that asterisk correctly handles DTMF in SIP packets when using PJSIP.'
     description:
-        Tests all DMTF characters (0-9 A-D # * !) with and without duration.
-        #Due to a bug (ASTERISK-23537), ignoring "!" and blank DTMF characters.
+        'Tests all DMTF characters (0-9 A-D # * !) with and without duration.
+        #Due to a bug (ASTERISK-23537), ignoring "!" and blank DTMF characters.'
 
 test-modules:
     test-object:
@@ -42,6 +42,7 @@
     minversion: '12.0.0'
     dependencies:
         - app : 'sipp'
+        - asterisk : 'res_musiconhold'
         - asterisk : 'res_pjsip'
     tags:
         - pjsip

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6b5abc2fdbb9facc7f1179c5480336417aacc78
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list