[asterisk-commits] mjordan: testsuite/asterisk/trunk r5102 - in /asterisk/trunk/tests/channels/p...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jun 8 13:09:20 CDT 2014


Author: mjordan
Date: Sun Jun  8 13:09:09 2014
New Revision: 5102

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5102
Log:
channels/pjsip/transfers/blind_transfer: Update direct media tests

This patch updates the direct media tests for the expected re-INVITEs that will
occur during proper handling of a SIP blind transfer that involve two direct
media bridges. This includes:
 - For the party in the bridge with the transfer destination, a re-INVITE that
   redirects media back to Asterisk will occur nearly at the same time as a BYE
   request (the order from Asterisk will always be re-INVITE, then BYE). This
   handles this situation by caching the necessary values from the re-INVITE,
   handling the BYE, then sending the response to the re-INVITE.
 - A previously commented out direct media re-INVITE was restored. It should
   never have been commented out.

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

Modified:
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/alice.xml
    asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/bob.xml

Modified: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml?view=diff&rev=5102&r1=5101&r2=5102
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml (original)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml Sun Jun  8 13:09:09 2014
@@ -2,7 +2,7 @@
 
 <scenario name="Send Call">
 
-  <send retrans="500">
+  <send retrans="500" start_txn="initial_invite">
     <![CDATA[
 
       INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
@@ -27,13 +27,13 @@
     ]]>
   </send>
 
-  <recv response="100" optional="true" />
-  <recv response="180" optional="true" />
-  <recv response="183" optional="true" />
-
-  <recv response="200" rtd="true" />
-
-  <send>
+  <recv response="100" optional="true" response_txn="initial_invite"/>
+  <recv response="180" optional="true" response_txn="initial_invite"/>
+  <recv response="183" optional="true" response_txn="initial_invite"/>
+
+  <recv response="200" rtd="true" response_txn="initial_invite"/>
+
+  <send ack_txn="initial_invite">
     <![CDATA[
 
       ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
@@ -155,19 +155,68 @@
         crlf="true">
   </recv>
 
-  <!-- Wait for re-invite to setup RTP directly between bob and Asterisk
-       after charlie hangs up -->
-  <recv request="INVITE" crlf="true"/>
-
-  <send retrans="500">
-    <![CDATA[
-
-      SIP/2.0 200 OK
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
+  <!--
+  A re-INVITE will come from Asterisk to redirect media back to it
+  as Alice leaves the bridge. At the same time, Alice will get hung up.
+  Cache the needed values from the INVITE so we can handle both requets.
+  -->
+  <recv request="INVITE" crlf="true">
+    <action>
+      <ereg regexp="(.*)"
+          header="Via:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_via"/>
+      <ereg regexp="(.*)"
+          header="From:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_from"/>
+      <ereg regexp="(.*)"
+          header="To:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_to"/>
+      <ereg regexp="(.*)"
+          header="Call-ID:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_call_id"/>
+      <ereg regexp="(.*)"
+          header="CSeq:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_cseq"/>
+    </action>
+  </recv>
+
+  <recv request="BYE" />
+
+  <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-Type: application/sdp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      Via: [$reinvite_via]
+      From: [$reinvite_from]
+      To: [$reinvite_to]
+      Call-ID: [$reinvite_call_id]
+      CSeq: [$reinvite_cseq]
       Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
       Content-Type: application/sdp
       Content-Length: [len]
@@ -188,23 +237,6 @@
         crlf="true">
   </recv>
 
-
-  <recv request="BYE" />
-
-  <send>
-    <![CDATA[
-
-      SIP/2.0 200 OK
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
-      Content-Length: 0
-
-    ]]>
-  </send>
-
   <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
 
   <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

Modified: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml?view=diff&rev=5102&r1=5101&r2=5102
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml (original)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml Sun Jun  8 13:09:09 2014
@@ -146,7 +146,7 @@
        Wait for re-invite for tearing down direct media between alice and bob
        due to transfering alice to charlie.
   -->
-  <!-- <recv request="INVITE" crlf="true"/>
+  <recv request="INVITE" crlf="true"/>
 
   <send retrans="500" next="11">
     <![CDATA[
@@ -179,7 +179,7 @@
     crlf="true"
     next="12" >
   </recv>
--->
+
   <label id="12" />
 
   <!-- We should receive a NOTIFY from Asterisk with a '200 OK' sipfrag -->

Modified: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/alice.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/alice.xml?view=diff&rev=5102&r1=5101&r2=5102
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/alice.xml (original)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/alice.xml Sun Jun  8 13:09:09 2014
@@ -2,7 +2,7 @@
 
 <scenario name="Send Call">
 
-  <send retrans="500">
+  <send retrans="500" start_txn="initial_invite">
     <![CDATA[
 
       INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
@@ -27,11 +27,11 @@
     ]]>
   </send>
 
-  <recv response="100" optional="true" />
-  <recv response="180" optional="true" />
-  <recv response="183" optional="true" />
-
-  <recv response="200" rtd="true">
+  <recv response="100" optional="true" response_txn="initial_invite"/>
+  <recv response="180" optional="true" response_txn="initial_invite"/>
+  <recv response="183" optional="true" response_txn="initial_invite"/>
+
+  <recv response="200" rtd="true" response_txn="initial_invite">
     <!-- Save the To tag. We'll need it when we send REFER -->
     <action>
       <ereg regexp="(;tag=.*)"
@@ -42,7 +42,7 @@
     </action>
   </recv>
 
-  <send>
+  <send ack_txn="initial_invite">
     <![CDATA[
 
       ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
@@ -146,7 +146,7 @@
        Wait for re-invite for tearing down direct media between alice and bob
        due to transfering bob to charlie.
   -->
-<!--  <recv request="INVITE" crlf="true"/>
+  <recv request="INVITE" crlf="true"/>
 
   <send retrans="500">
     <![CDATA[
@@ -176,7 +176,7 @@
     rtd="true"
     crlf="true">
   </recv>
--->
+
   <!-- We should receive a NOTIFY from Asterisk with a '200 OK' sipfrag -->
   <recv request="NOTIFY" crlf="true">
     <!-- Check if 'SIP/2.0 200 OK' is in the body -->

Modified: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/bob.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/bob.xml?view=diff&rev=5102&r1=5101&r2=5102
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/bob.xml (original)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/sipp/bob.xml Sun Jun  8 13:09:09 2014
@@ -155,19 +155,68 @@
         crlf="true">
   </recv>
 
-  <!-- Wait for re-invite to setup RTP directly between bob and Asterisk
-       after charlie hangs up -->
-  <recv request="INVITE" crlf="true"/>
-
-  <send retrans="500">
-    <![CDATA[
-
-      SIP/2.0 200 OK
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
+  <!--
+  A re-INVITE will come from Asterisk to redirect media back to it
+  as Bob leaves the bridge. At the same time, Bob will get hung up.
+  Cache the needed values from the INVITE so we can handle both requets.
+  -->
+  <recv request="INVITE" crlf="true">
+    <action>
+      <ereg regexp="(.*)"
+          header="Via:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_via"/>
+      <ereg regexp="(.*)"
+          header="From:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_from"/>
+      <ereg regexp="(.*)"
+          header="To:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_to"/>
+      <ereg regexp="(.*)"
+          header="Call-ID:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_call_id"/>
+      <ereg regexp="(.*)"
+          header="CSeq:"
+          search_in="hdr"
+          check_it="true"
+          assign_to="reinvite_cseq"/>
+    </action>
+  </recv>
+
+  <recv request="BYE" />
+
+  <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-Type: application/sdp
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      Via: [$reinvite_via]
+      From: [$reinvite_from]
+      To: [$reinvite_to]
+      Call-ID: [$reinvite_call_id]
+      CSeq: [$reinvite_cseq]
       Contact: <sip:bob@[local_ip]:[local_port];transport=[transport]>
       Content-Type: application/sdp
       Content-Length: [len]
@@ -188,22 +237,6 @@
         crlf="true">
   </recv>
 
-  <recv request="BYE" />
-
-  <send>
-    <![CDATA[
-
-      SIP/2.0 200 OK
-      [last_Via:]
-      [last_From:]
-      [last_To:]
-      [last_Call-ID:]
-      [last_CSeq:]
-      Content-Length: 0
-
-    ]]>
-  </send>
-
   <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
 
   <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>




More information about the asterisk-commits mailing list