[svn-commits] wdoekes: testsuite/asterisk/trunk r5067 - in /asterisk/trunk/tests/channels/S...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 27 23:44:05 CDT 2014


Author: wdoekes
Date: Tue May 27 23:44:00 2014
New Revision: 5067

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5067
Log:
SIP/session_timers/uac_refresher_at_200: Regression test for ASTERISK-22551.

Tests that when asterisk takes a call and the caller uses refresher=uac:
- asterisk does *not* tear down the call too early, and that
- asterisk does tear the down the call when it *is* time
  (in this scenario, 60s after the last session refreshing reINVITE/200)

The chan_sip code expects that the refreshing party sends the reINVITE
between half the expiry time and two thirds (or at most total time minus
32 seconds). For 90 seconds, that is between 45s and 60s. After that, the
other end (asterisk) should tear down the session.

Added:
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml   (with props)
    asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml

Modified: asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml?view=diff&rev=5067&r1=5066&r2=5067
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/session_timers/tests.yaml Tue May 27 23:44:00 2014
@@ -5,6 +5,7 @@
     - test: 'basic_uas_refresh'
     - test: 'basic_uas_teardown'
     - test: 'uas_minimum_se'
+    - test: 'uac_refresher_at_200'
     - test: 'uac_se_below_minse'
     - test: 'uac_multiple_422_accept'
     - test: 'uac_multiple_422_originate'

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf?view=auto&rev=5067
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf Tue May 27 23:44:00 2014
@@ -1,0 +1,16 @@
+[default]
+exten => wait_a_while,1,Ringing()
+ ;; time is now 00:00
+ same => n,Wait(30)
+ ;; time is now 00:30
+ same => n,Answer()
+ ;; if time is 00:30 + 90/2, it's refresh time: 01:15
+ ;; however, asterisk thinks it's disconnect time
+ ;; at: 00:00 + 90 - min(90/3, 32) = 00:58
+ ;;
+ ;; wait a long while.. let the sipp script do its testing.
+ ;; within these 300 seconds we should send the BYE, but at
+ ;; the right time.
+ same => n,Wait(300)
+ ;; if we get here, things are broken.
+ same => n,Hangup()

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf?view=auto&rev=5067
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf Tue May 27 23:44:00 2014
@@ -1,0 +1,11 @@
+[general]
+canreinvite=no
+
+[endpoint]
+context=default
+type=friend
+host=127.0.0.1
+port=5066
+insecure=invite
+disallow=all
+allow=ulaw

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml?view=auto&rev=5067
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml Tue May 27 23:44:00 2014
@@ -1,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="INVITE-test-session-refresher-uac">
+
+  <!--
+
+    Test UAS when we (UAC) do the refreshing for bug ASTERISK-22551,
+    Walter Doekes, May 2014
+
+    Asterisk dialplan:
+
+      exten => wait_a_while,1,Ringing()
+       ;; time is now 00:00
+       same => n,Wait(30)
+       ;; time is now 00:30
+       same => n,Answer()
+       ;; if time is 00:30 + 90/2, it's refresh time: 01:15
+       ;; however, asterisk thinks it's disconnect time
+       ;; at: 00:00 + 90 - min(90/3, 32) = 00:58
+       ;;
+       ;; wait a long while.. let the sipp script do its testing.
+       ;; within these 300 seconds we should send the BYE, but at
+       ;; the right time.
+       same => n,Wait(300)
+       ;; if we get here, things are broken.
+       same => n,Hangup()
+
+  -->
+
+  <send retrans="500" start_txn="invite">
+    <![CDATA[
+
+      INVITE sip:wait_a_while@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sip:endpoint@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sip:wait_a_while@[remote_ip]:[remote_port]
+      Contact: sip:endpoint@[local_ip]:[local_port]
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Max-Forwards: 70
+      Content-Type: application/sdp
+      Content-Length: [len]
+      Require: timer
+      Session-Expires: 90;refresher=uac
+      Supported: timer
+
+      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 8 0
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" response_txn="invite"/>
+
+  <recv response="180" optional="true" response_txn="invite"/>
+
+  <recv response="183" optional="true" response_txn="invite"/>
+
+  <!--
+
+    We expect the UAS to wait for 30 seconds in ringing state here.
+    This triggers the bug as explained below.
+
+  -->
+
+  <recv response="200" rrs="true" response_txn="invite"/>
+
+  <send ack_txn="invite">
+    <![CDATA[
+
+      ACK [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [routes]
+      From: sip:endpoint@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sip:wait_a_while@[remote_ip]:[remote_port][peer_tag_param]
+      Contact: sip:endpoint@[local_ip]:[local_port]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Max-Forwards: 70
+      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 8 0
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <pause milliseconds="45000"/>
+
+  <!--
+
+    If we're still alive, we're at t75 (30 ringing + 45 pause).
+
+    If bug ASTERISK-22551 is still in effect, Asterisk will have
+    counted from the start of the INVITE t0 to t58 and decided
+    that is was kill time.
+
+    If it is fixed, we have time until t88 to send the refresh reINVITE.
+    Let's do that.
+
+  -->
+
+  <send retrans="500" start_txn="invite">
+    <![CDATA[
+
+      INVITE [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [routes]
+      From: sip:endpoint@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sip:wait_a_while@[remote_ip]:[remote_port][peer_tag_param]
+      Contact: sip:endpoint@[local_ip]:[local_port]
+      Call-ID: [call_id]
+      CSeq: [cseq] INVITE
+      Max-Forwards: 70
+      Content-Type: application/sdp
+      Content-Length: [len]
+      Require: timer
+      Session-Expires: 90;refresher=uac
+      Supported: timer
+      X-Reason: SIP re-invite (Session-Timers)
+
+      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 8 0
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="200" response_txn="invite"/>
+
+  <send ack_txn="invite">
+    <![CDATA[
+
+      ACK [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [routes]
+      From: sip:endpoint@[local_ip]:[local_port];tag=[pid]SIPpTag00[call_number]
+      To: sip:wait_a_while@[remote_ip]:[remote_port][peer_tag_param]
+      Contact: sip:endpoint@[local_ip]:[local_port]
+      Call-ID: [call_id]
+      CSeq: [cseq] ACK
+      Max-Forwards: 70
+      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 8 0
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+    ]]>
+  </send>
+
+  <!--
+
+    For extra testing, wait another 50 seconds. We don't need to send
+    another refresh for 58 seconds.
+
+  -->
+
+  <pause milliseconds="50000"/>
+
+  <!--
+
+    In 8 seconds we should be receiving a BYE.
+
+    Give asterisk 15 seconds before aborting this scenario with failure.
+
+  -->
+
+  <recv request="BYE" timeout="15000"/>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_Record-Route:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+
+    ]]>
+  </send>
+
+</scenario>

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/sipp/uac_refresher_at_200.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml?view=auto&rev=5067
==============================================================================
--- asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml Tue May 27 23:44:00 2014
@@ -1,0 +1,29 @@
+testinfo:
+    summary:     'SIP timers start at 200 test (incoming UAC refresh)'
+    description: |
+        "This test verifies that the timer starts at 200 and not at INVITE."
+
+properties:
+    minversion: '1.8.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - asterisk : 'chan_sip'
+    tags:
+        - SIP
+        - SIP_session_timers
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    reactor-timeout: 150
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uac_refresher_at_200.xml', '-p': '5066', '-send_timeout': '70000', '-recv_timeout': '70000', '-timeout': '80000'},
+                    'ordered-args': ['-timeout_error'] }

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/SIP/session_timers/uac_refresher_at_200/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list