[asterisk-commits] pjsip/immediate ok notify: Add test for 'refer blind progres... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 2 16:32:17 CDT 2017


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

Change subject: pjsip/immediate_ok_notify: Add test for 'refer_blind_progress' option.
......................................................................


pjsip/immediate_ok_notify: Add test for 'refer_blind_progress' option.

The 'refer_blind_progress' option for PJSIP controls the resulting NOTIFY
messages that occur as a result of a blind transfer. When the option is
enabled NOTIFY messages are sent which provide information on the progress
of the blind transfer. When the option is disabled a NOTIFY is immediately
sent indicating the transfer was a success.

This test ensures that when the option is disabled that we send only two
NOTIFY messages: a 100 Trying followed by a 200 OK.

ASTERISK-26333

Change-Id: I41639d35edcc78cd75dde8bbb0c8967942a8e60a
---
A tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/extensions.conf
A tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/pjsip.conf
A tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/sipp/transferer.xml
A tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/test-config.yaml
M tests/channels/pjsip/transfers/blind_transfer/tests.yaml
5 files changed, 195 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/extensions.conf b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/extensions.conf
new file mode 100644
index 0000000..92e6724
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/extensions.conf
@@ -0,0 +1,14 @@
+[default]
+
+exten => echo,1,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+exten => call-sipp,1,Dial(PJSIP/sipp)
+same => n,Hangup()
+
+; This extension normally results in a blind transfer NOTIFY flow of 100 Trying, 180 Ringing, 200 OK.
+exten => test,1,Ringing()
+same => n,Wait(1)
+same => n,Answer()
+same => n,Hangup()
diff --git a/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/pjsip.conf b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..a40b4f3
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/configs/ast1/pjsip.conf
@@ -0,0 +1,15 @@
+[main-transport]
+type = transport
+protocol = udp
+bind = 127.0.0.1
+
+[sipp]
+type = endpoint
+context = default
+allow = ulaw
+aors = sipp
+refer_blind_progress = no
+
+[sipp]
+type = aor
+contact = sip:sipp at 127.0.0.1:5061
diff --git a/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/sipp/transferer.xml b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/sipp/transferer.xml
new file mode 100644
index 0000000..31ec70c
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/sipp/transferer.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="transferer">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <!-- Save the from tag. We'll need it when we send our REFER -->
+      <action>
+          <ereg regexp="(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote_tag"/>
+	  </action>
+  </recv>
+
+  <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 retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag00[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=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        rtd="true"
+        crlf="true">
+  </recv>
+
+  <pause milliseconds="2000" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      REFER sip:sipp@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
+      Call-ID: [call_id]
+      CSeq: [cseq] REFER
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Subject: Performance Test
+      Refer-To: sip:test@[remote_ip]:[remote_port];user=phone
+      Referred-By: sip:sipp@[local_ip]:[local_port]
+      Content-Length: 0
+
+    ]]>
+
+  </send>
+
+  <recv response="202" rtd="true">
+  </recv>
+
+  <!-- The first NOTIFY we receive should be a 100 Trying -->
+  <recv request="NOTIFY" crlf="true">
+    <action>
+       <ereg regexp="(SIP/2.0 100 Trying)"
+          search_in="msg"
+          check_it="true"
+          assign_to="dummy,sip_frag"/>
+    </action>
+  </recv>
+
+  <!-- Followed by a 200 OK since the option is set to no -->
+  <recv request="NOTIFY" crlf="true">
+    <action>
+       <ereg regexp="(SIP/2.0 200 OK)"
+          search_in="msg"
+          check_it="true"
+          assign_to="dummy,sip_frag"/>
+    </action>
+  </rcv>
+
+  <Reference variables="sip_frag" />
+  <Reference variables="dummy" />
+
+</scenario>
+
diff --git a/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/test-config.yaml b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/test-config.yaml
new file mode 100644
index 0000000..297cf60
--- /dev/null
+++ b/tests/channels/pjsip/transfers/blind_transfer/immediate_ok_notify/test-config.yaml
@@ -0,0 +1,56 @@
+testinfo:
+    summary: "Ensure that when the refer_blind_progress option is set to no we get an immediate 200 OK NOTIFY"
+    description: |
+        'Asterisk originates a call to a Local channel that runs Echo. The other half of
+        the local channel is placed into the dialplan and calls a SIPp scenario. The SIPp
+        scenario answers the call and then performs a blind transfer. The target of the blind
+        transfer performs ringing for a period of time and then answers. The endpoint
+        that the SIPp scenario uses is configured with the refer_blind_progress option set to no.
+        The SIPp scenario tests that it receives only two NOTIF messages: a 100 Trying and a
+        200 OK.
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: sipp.SIPpTestCase
+    modules:
+        -
+            config-section: originator-config
+            typename: pluggable_modules.Originator
+        -
+            config-section: 'hangup-monitor'
+            typename: 'pluggable_modules.HangupMonitor'
+
+sipp-config:
+    stop-after-scenarios: false
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'transferer.xml', '-i': '127.0.0.1', '-p': '5061' }}
+
+originator-config:
+    channel: 'Local/echo at default'
+    context: 'default'
+    exten: 'call-sipp'
+    priority: '1'
+    trigger: 'scenario_start'
+    scenario-name: 'transferer.xml'
+
+hangup-monitor:
+    ids: '0'
+
+properties:
+    minversion: '13.17.0'
+    dependencies:
+        - sipp:
+            version: 'v3.0'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_session'
+        - asterisk: 'res_pjsip_refer'
+        - asterisk: 'chan_pjsip'
+        - asterisk: 'app_dial'
+    tags:
+        - pjsip
+    testconditions:
+        -
+            name: 'channels'
diff --git a/tests/channels/pjsip/transfers/blind_transfer/tests.yaml b/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
index 6688906..c7cbd32 100644
--- a/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
+++ b/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
@@ -10,3 +10,4 @@
     - test: 'caller_with_hold_drop_options'
     - test: 'goto_on_blindxfr'
     - test: 'no_target_in_refer'
+    - test: 'immediate_ok_notify'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41639d35edcc78cd75dde8bbb0c8967942a8e60a
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2



More information about the asterisk-commits mailing list