[asterisk-commits] testsuite: Fix tests/channels/pjsip/refer send to vm for con... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 3 07:18:39 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: testsuite: Fix tests/channels/pjsip/refer_send_to_vm for consistency changes.
......................................................................


testsuite: Fix tests/channels/pjsip/refer_send_to_vm for consistency changes.

* Made dialplan validate both REDIRECTING(reason) and the special
SIP header values.

* Add unquoted send_to_vm test case.

Change-Id: I82c6919d2fe93d417cd7efbe7ab5ecfb1513a660
---
M tests/channels/pjsip/refer_send_to_vm/v12.2.0/test-config.yaml
M tests/channels/pjsip/refer_send_to_vm/v13.8.0/configs/ast1/extensions.conf
A tests/channels/pjsip/refer_send_to_vm/v13.8.0/sipp/refer_unquoted_send_to_vm.xml
M tests/channels/pjsip/refer_send_to_vm/v13.8.0/test-config.yaml
4 files changed, 126 insertions(+), 3 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/channels/pjsip/refer_send_to_vm/v12.2.0/test-config.yaml b/tests/channels/pjsip/refer_send_to_vm/v12.2.0/test-config.yaml
index 02e70bc..0344df6 100644
--- a/tests/channels/pjsip/refer_send_to_vm/v12.2.0/test-config.yaml
+++ b/tests/channels/pjsip/refer_send_to_vm/v12.2.0/test-config.yaml
@@ -9,6 +9,7 @@
 
 properties:
     minversion: '12.2.0'
+    maxversion: '13.8.0'
     dependencies:
          - python: 'twisted'
          - python: 'starpy'
diff --git a/tests/channels/pjsip/refer_send_to_vm/v13.8.0/configs/ast1/extensions.conf b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/configs/ast1/extensions.conf
index 1127d18..e5e6917 100644
--- a/tests/channels/pjsip/refer_send_to_vm/v13.8.0/configs/ast1/extensions.conf
+++ b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/configs/ast1/extensions.conf
@@ -8,7 +8,7 @@
 exten => carol,1,NoOp()
       same => n,NoOp(REDIRECTING(reason) is '${REDIRECTING(reason)}')
       same => n,NoOp(PJSIP_HEADER(read,X-Digium-Call-Feature) is '${PJSIP_HEADER(read,X-Digium-Call-Feature)}')
-      same => n,GotoIf($[${REDIRECTING(reason)} = "send_to_vm" | "${PJSIP_HEADER(read,X-Digium-Call-Feature)}" = "feature_send_to_vm"]?vm:notvm)
+      same => n,GotoIf($[${REDIRECTING(reason)} = send_to_vm & "${PJSIP_HEADER(read,X-Digium-Call-Feature)}" = "feature_send_to_vm"]?vm:notvm)
       same => n(vm),UserEvent(Result, Status: passed)
       same => n,Hangup()
       same => n(notvm),UserEvent(Result, Status: failed)
diff --git a/tests/channels/pjsip/refer_send_to_vm/v13.8.0/sipp/refer_unquoted_send_to_vm.xml b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/sipp/refer_unquoted_send_to_vm.xml
new file mode 100644
index 0000000..9ef59df
--- /dev/null
+++ b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/sipp/refer_unquoted_send_to_vm.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Refer with custom header">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <!-- Save the from tag. We'll need it when we send our BYE -->
+      <action>
+          <ereg regexp=".*(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="to_hdr,remote_tag"/>
+	  </action>
+  </recv>
+  <Reference variables="to_hdr" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=- 1324901698 1324901698 IN IP4 [local_ip]
+      s=-
+      c=IN IP4 [local_ip]
+      t=0 0
+      m=audio 2226 RTP/AVP 0 101
+      a=sendrecv
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:101 telephone-event/8000
+    ]]>
+  </send>
+
+  <recv request="ACK" rtd="true" crlf="true" />
+
+  <pause milliseconds="1000"/>
+
+  <send retrans="500">
+    <![CDATA[
+      REFER sip:alice@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+      From: <sip:bob@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]
+      To: <sip:alice@[remote_ip]:[remote_port]>[$remote_tag]
+      Call-ID: [call_id]
+      CSeq: [cseq] REFER
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Max-Forwards: 70
+      Event: refer
+      Expires: 600
+      Supported: replaces, 100rel, timer, norefersub
+      Accept: message/sipfrag;version=2.0
+      Allow-Events: presence, message-summary, refer
+      Refer-To: <sip:carol@[remote_ip]:[remote_port]>
+      Referred-By: <sip:bob@[local_ip]:[local_port]>
+      User-Agent: Digium D40
+      X-Digium-Call-Feature: feature_send_to_vm
+      Diversion: <sip:carol@[local_ip]:[local_port]>;reason=send_to_vm
+      Content-Length: [len]
+    ]]>
+  </send>
+
+  <recv response="202" />
+
+  <recv request="NOTIFY" crlf="true" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+  </send>
+
+  <recv request="NOTIFY" crlf="true" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+    ]]>
+  </send>
+</scenario>
diff --git a/tests/channels/pjsip/refer_send_to_vm/v13.8.0/test-config.yaml b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/test-config.yaml
index 02e70bc..b62090e 100644
--- a/tests/channels/pjsip/refer_send_to_vm/v13.8.0/test-config.yaml
+++ b/tests/channels/pjsip/refer_send_to_vm/v13.8.0/test-config.yaml
@@ -8,7 +8,7 @@
          a REFER.'
 
 properties:
-    minversion: '12.2.0'
+    minversion: '13.8.0'
     dependencies:
          - python: 'twisted'
          - python: 'starpy'
@@ -38,12 +38,16 @@
              scenarios:
                 - { 'key-args': { 'scenario':'refer.xml', '-p':'5062' } }
                 - { 'key-args': { 'scenario':'invite.xml', '-p':'5061' } }
+        -
+             scenarios:
+                - { 'key-args': { 'scenario':'refer_unquoted_send_to_vm.xml', '-p':'5062' } }
+                - { 'key-args': { 'scenario':'invite.xml', '-p':'5061' } }
 
 ami-config:
     -
         id: '0'
         type: 'headermatch'
-        count: '1'
+        count: '2'
         conditions:
             match:
                 Event: 'UserEvent'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I82c6919d2fe93d417cd7efbe7ab5ecfb1513a660
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list