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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 12 03:25:03 CDT 2014


Author: wdoekes
Date: Sun Oct 12 03:24:59 2014
New Revision: 5715

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5715
Log:
chan_sip: Test unscheduling reINVITE after call hangup.

Belongs with chan_sip commit r425296 (1.8).  Tests that no reINVITE is
sent after dialog hangup.

Review: https://reviewboard.asterisk.org/r/4055/

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

Added: asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/extensions.conf?view=auto&rev=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/extensions.conf Sun Oct 12 03:24:59 2014
@@ -1,0 +1,2 @@
+[default]
+exten => bob,1,Dial(SIP/bob)

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

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

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

Added: asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/sip.conf?view=auto&rev=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/configs/ast1/sip.conf Sun Oct 12 03:24:59 2014
@@ -1,0 +1,21 @@
+[general]
+udpbindaddr=127.0.0.1:5060
+; debugging is nice
+sipdebug=yes
+; we require/expect directmedia reinvites for our test
+directmedia=yes
+; wait 3.2 seconds to timeout retransmitting 200 to re-invite
+; instead of 32 seconds
+timert1=50
+; allow fax
+t38pt_udptl=yes
+
+[alice]
+host=127.0.0.1
+port=5062
+type=friend
+
+[bob]
+host=127.0.0.1
+port=5063
+type=friend

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

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

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

Added: asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/alice.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/alice.xml?view=auto&rev=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/alice.xml (added)
+++ asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/alice.xml Sun Oct 12 03:24:59 2014
@@ -1,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<!-- Walter Doekes, 2014 for asterisk bug ASTERISK-22791 -->
+<scenario name="ASTERISK-22791-alice">
+
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: alice <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: [service] <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: <sip:alice@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 [pid][call_number][cseq] [pid][call_number][cseq] 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 8
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="100" optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+
+  <recv response="200" rrs="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      ACK [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      CSeq: 1 ACK
+      Contact: <sip:alice@[local_ip]:[local_port]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <!-- expect directmedia reinvite -->
+  <recv request="INVITE">
+  </recv>
+
+  <!-- reject it, because we were going to hang up -->
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 491 Request Pending
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:alice@[local_ip]:[local_port]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv request="ACK">
+  </recv>
+
+  <!-- done with the call -->
+  <send retrans="500">
+    <![CDATA[
+
+      BYE [next_url] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: alice <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+      [last_Call-ID:]
+      CSeq: 2 BYE
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200">
+  </recv>
+
+  <!-- at this point we *don't* want to see another reINVITE -->
+  <timewait milliseconds="3000"/>
+
+</scenario>

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

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

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

Added: asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/bob.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/bob.xml?view=auto&rev=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/bob.xml (added)
+++ asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/sipp/bob.xml Sun Oct 12 03:24:59 2014
@@ -1,0 +1,110 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<!-- Walter Doekes, 2014 for asterisk bug ASTERISK-22791 -->
+<scenario name="ASTERISK-22791-bob">
+
+  <!-- expect call from alice -->
+  <recv request="INVITE">
+  </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:bob@[local_ip]:[local_port]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 [pid][call_number][cseq] [pid][call_number][cseq] 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">
+  </recv>
+
+  <!-- expect directmedia reinvite -->
+  <recv request="INVITE">
+  </recv>
+
+  <label id="reinvite"/>
+
+  <!-- fine -->
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:bob@[local_ip]:[local_port]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 [pid][call_number][cseq] [pid][call_number][cseq] 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">
+  </recv>
+
+  <recv request="INVITE" optional="true" next="reinvite">
+  </recv>
+
+  <!-- the call gets hung up -->
+  <recv request="BYE">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <!-- wait a bit to be able to retransmit our 200 -->
+  <timewait milliseconds="3000"/>
+
+</scenario>

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

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

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

Added: asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/test-config.yaml?view=auto&rev=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/no_reinvite_after_491/test-config.yaml Sun Oct 12 03:24:59 2014
@@ -1,0 +1,36 @@
+testinfo:
+    summary: 'Test that we get no reINVITE after 491 after BYE'
+    description: |
+        'This tests a scenario where asterisk initiates a reINVITE --
+        which gets 491d -- and the call is hung up in the mean time.
+        If the bug is not fixed, we get another reINVITE (with
+        reversed From and To headers).  See bug: ASTERISK-22791'
+
+properties:
+    minversion: '1.8.32.0'
+    dependencies:
+        - python: 'starpy'
+        - sipp:
+            version: 'v3.1'
+        - asterisk : 'chan_sip'
+    tags:
+        - SIP
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    reactor-timeout: 20
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - {'key-args': {'scenario': 'bob.xml',
+                                '-p': '5063',
+                                '-default_behaviors': '-bye'}}
+                - {'key-args': {'scenario': 'alice.xml',
+                                '-p': '5062',
+                                '-s': 'bob',
+                                '-default_behaviors': '-bye,abortunexp'}}

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

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

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

Modified: asterisk/trunk/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/tests.yaml?view=diff&rev=5715&r1=5714&r2=5715
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Sun Oct 12 03:24:59 2014
@@ -71,3 +71,4 @@
     - dir: 'ami'
     - test: 'invite_retransmit'
     - test: 'no_ack_dialog_cleanup'
+    - test: 'no_reinvite_after_491'




More information about the asterisk-commits mailing list