[asterisk-commits] mjordan: testsuite/asterisk/trunk r5090 - in /asterisk/trunk/tests/channels/p...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jun 1 22:48:49 CDT 2014
Author: mjordan
Date: Sun Jun 1 22:48:41 2014
New Revision: 5090
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5090
Log:
pjsip/transfers/blind_transfer: Add callee tests; update caller tests
This patch does two things:
1. It adds blind transfer tests for callee initiated transfers. These tests
mirror the existing caller initiated tests.
2. It updates the existing caller tests to properly handle direct media, as
well as the expected headers that occur during a transfer.
Note that Scott Emidy wrote the tests for the callee initiated transfers.
Review: https://reviewboard.asterisk.org/r/3444/
ASTERISK-23447 #close
Reported by: Matt Jordan
patches:
callee_pjsip_blind_transfer_diff uploaded by jemidy (License 6581)
Added:
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/test-config.yaml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/transfer.py (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/configs/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/configs/ast1/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/sipp/
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/sipp/alice.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/sipp/bob.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/sipp/charlie.xml (with props)
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_with_hold/test-config.yaml (with props)
Modified:
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
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_direct_media/test-config.yaml
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/transfer.py
asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/tests.yaml
asterisk/trunk/tests/channels/pjsip/transfers/tests.yaml
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf Sun Jun 1 22:48:41 2014
@@ -1,0 +1,39 @@
+
+[transfertest]
+
+exten => bob,1,NoOp()
+ same => n,Dial(PJSIP/bob)
+ same => n,Hangup()
+
+exten => bob_two,1,NoOp()
+ same => n,Dial(PJSIP/bob,,b(alicecontext^alice_two^1))
+ same => n,Hangup()
+
+exten => charlie,1,NoOp()
+ ; The Wait here is annoying, but necessary. We need to
+ ; allow some time to pass before dialing Charlie, otherwise
+ ; Charlie's answering will cause a NOTIFY request to be sent
+ ; prior to the direct media INVITE requests being fully
+ ; processed
+ same => n,Wait(5)
+ same => n,Dial(PJSIP/charlie)
+ same => n,Hangup()
+
+[other]
+
+; Second test iteration should execute
+exten => charlie,1,NoOp()
+ ; The Wait here is annoying, but necessary. We need to
+ ; allow some time to pass before dialing Charlie, otherwise
+ ; Charlie's answering will cause a NOTIFY request to be sent
+ ; prior to the direct media INVITE requests being fully
+ ; processed
+ same => n,Wait(5)
+ same => n,Dial(PJSIP/charlie)
+ same => n,Hangup()
+
+[alicecontext]
+
+exten => alice_two,1,NoOp()
+ same => n,Set(TRANSFER_CONTEXT=other)
+ same => n,Return()
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf Sun Jun 1 22:48:41 2014
@@ -1,0 +1,47 @@
+[global]
+type=global
+debug=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=ulaw
+context=transfertest
+direct_media=yes
+media_address=127.0.0.1
+aors=alice
+
+[alice]
+type=aor
+max_contacts=1
+contact=sip:alice at 127.0.0.2:5060\;transport=udp
+
+[bob]
+type=endpoint
+allow=ulaw
+context=transfertest
+direct_media=yes
+media_address=127.0.0.1
+aors=bob
+
+[bob]
+type=aor
+max_contacts=1
+contact=sip:bob at 127.0.0.3:5060\;transport=udp
+
+[charlie]
+type=endpoint
+allow=ulaw
+context=transfertest
+direct_media=yes
+media_address=127.0.0.1
+aors=charlie
+
+[charlie]
+type=aor
+max_contacts=1
+contact=sip:charlie at 127.0.0.4:5060\;transport=udp
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: 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=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml Sun Jun 1 22:48:41 2014
@@ -1,0 +1,212 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<scenario name="Send Call">
+
+ <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: <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] INVITE
+ Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
+ Max-Forwards: 70
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=- 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv response="100" optional="true" />
+ <recv response="180" optional="true" />
+ <recv response="183" optional="true" />
+
+ <recv response="200" rtd="true" />
+
+ <send>
+ <![CDATA[
+
+ ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ Call-ID: [call_id]
+ CSeq: [cseq] ACK
+ Contact: <sip:alice@[local_ip]:[local_port];transport=[transport]>
+ Max-Forwards: 70
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <!-- Send audio -->
+ <nop>
+ <action>
+ <exec rtp_stream="lib/python/asterisk/audio.ulaw,3,0"/>
+ </action>
+ </nop>
+
+ <!-- Wait for re-invite to setup RTP directly between alice and bob -->
+ <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:]
+ Contact: <sip:alice@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <!--
+ Wait for re-invite for tearing down direct media between alice and bob
+ due to transfering alice to charlie.
+ -->
+ <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:]
+ Contact: <sip:alice@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <!-- Wait for re-invite to setup RTP directly between alice and charlie -->
+ <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:]
+ Contact: <sip:alice@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ 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:]
+ Contact: <sip:bob@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ 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"/>
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/alice.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: 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=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml Sun Jun 1 22:48:41 2014
@@ -1,0 +1,236 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+
+ <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]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:bob@[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]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:bob@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <!-- Send audio -->
+ <nop>
+ <action>
+ <exec rtp_stream="lib/python/asterisk/audio.ulaw,3,0"/>
+ </action>
+ </nop>
+
+ <!-- Wait for re-invite to setup RTP directly between alice and bob -->
+ <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:]
+ Contact: <sip:bob@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <pause milliseconds="4000" />
+
+ <!-- Blind transfer alice to charlie -->
+ <send retrans="500">
+ <![CDATA[
+
+ REFER sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: <sip:bob@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
+ Call-ID: [call_id]
+ CSeq: 2 REFER
+ Contact: sip:bob@[local_ip]:[local_port];transport=[transport]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Refer-To: sip:charlie@[remote_ip]:[remote_port];user=phone
+ Referred-By: sip:bob@[local_ip]:[local_port]
+ Content-Length: 0
+
+ ]]>
+
+ </send>
+
+ <recv response="202" rtd="true">
+ </recv>
+
+ <!-- We should receive a NOTIFY from Asterisk with a 100 trying sipfrag -->
+ <recv request="NOTIFY" crlf="true">
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ [last_Event:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!--
+ Wait for re-invite for tearing down direct media between alice and bob
+ due to transfering alice to charlie.
+ -->
+ <!-- <recv request="INVITE" crlf="true"/>
+
+ <send retrans="500" next="11">
+ <![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: [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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <label id="11" />
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true"
+ next="12" >
+ </recv>
+-->
+ <label id="12" />
+
+ <!-- We should receive a NOTIFY from Asterisk with a '200 OK' sipfrag -->
+ <recv request="NOTIFY" crlf="true" next="13">
+ <!-- Check if 'SIP/2.0 200 OK' is in the body -->
+ <action>
+ <ereg regexp="(SIP/2.0 200 OK)"
+ search_in="msg"
+ check_it="true"
+ assign_to="sip_frag_ok"/>
+ </action>
+ </recv>
+
+ <label id="13" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ [last_Event:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+ ]]>
+ </send>
+
+ <!-- Transfer should have successfully occurred so now we need to hang up -->
+ <send retrans="500">
+ <![CDATA[
+
+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+ [last_Via:]
+ From: <sip:bob@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>[$remote_tag]
+ Call-ID: [call_id]
+ CSeq: [cseq] BYE
+ Contact: sip:bob@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true">
+ </recv>
+
+ <Reference variables="sip_frag_ok" />
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/bob.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml Sun Jun 1 22:48:41 2014
@@ -1,0 +1,127 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Basic UAS responder">
+
+ <recv request="INVITE" crlf="true">
+ <action>
+ <!-- Save the From tag. We'll need it when we send our BYE -->
+ <ereg regexp="(;tag=.*)"
+ header="From:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="remote_tag"/>
+ <!-- Save the From user portion of URI. We'll need it when we send our BYE -->
+ <ereg regexp="(sip:alice|sip:bob_two)"
+ header="From:"
+ search_in="hdr"
+ check_it="true"
+ assign_to="remote_user"/>
+ <!-- Check the Referred-By header. -->
+ <ereg regexp="sip:bob at 127.0.0.3:5060"
+ header="Referred-By"
+ search_in="hdr"
+ check_it="true"
+ assign_to="referred_by"/>
+ </action>
+ </recv>
+
+ <!-- Answer inbound call -->
+ <send retrans="500">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[pid]SIPpTag[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:charlie@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <!-- Send audio -->
+ <nop>
+ <action>
+ <exec rtp_stream="lib/python/asterisk/audio.ulaw,3,0"/>
+ </action>
+ </nop>
+
+ <!-- Wait for re-invite to setup RTP directly between alice and charlie -->
+ <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:]
+ Contact: <sip:charlie@[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 [custom_media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK"
+ rtd="true"
+ crlf="true">
+ </recv>
+
+ <!-- Allow 5s of audio to be sent to alice -->
+ <pause milliseconds="5000" />
+
+ <send retrans="500">
+ <![CDATA[
+
+ BYE [$remote_user]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: <sip:charlie@[local_ip]:[local_port]>;tag=[pid]SIPpTag[call_number]
+ To: <[$remote_user]@[remote_ip]:[remote_port]>[$remote_tag]
+ Call-ID: [call_id]
+ CSeq: [cseq] BYE
+ Contact: sip:charlie@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true">
+ </recv>
+
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+ <Reference variables="referred_by" />
+
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/sipp/charlie.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml Sun Jun 1 22:48:41 2014
@@ -1,0 +1,120 @@
+testinfo:
+ summary: 'Test PJSIP Blind Transfer Callee Initiated Direct Media'
+ description: |
+ 'This test verifies a PJSIP Blind transfer with direct media occurring
+ between each endpoint. This uses a SIPp instance for each of "Alice",
+ "Bob", and "Charlie". Alice calls Bob through Asterisk and direct media
+ is set up between them. Bob then blind transfers Alice to Charlie which
+ causes the direct media between Bob and Alice to be torn down. After
+ Asterisk notifies Bob that Charlie answered, Bob hangs up. Direct
+ media is set up between Alice and Charlie. Charlie hangs up the call. A
+ second iteration is performed to ensure correct behavior when the
+ TRANSFER_CONTEXT channel variable is used. This test ensures that the
+ transfer was successful and that direct media occurs between the
+ endpoints. It also ensures various channel variables are set
+ appropriately.'
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - asterisk : 'res_pjsip'
+ - sipp :
+ version : 'v3.4.1'
+ tags:
+ - pjsip
+ - transfer
+
+test-modules:
+ add-test-to-search-path: 'True'
+ test-object:
+ config-section: test-case-config
+ typename: 'sipp.SIPpTestCase'
+ modules:
+ -
+ config-section: 'ami-config'
+ typename: 'ami.AMIEventModule'
+
+test-case-config:
+ reactor-timeout: 45
+ connect-ami: 'True'
+ fail-on-any: False
+ test-iterations:
+ # First iteration
+ -
+ scenarios:
+ # Charlie receives transfered call and sends audio to Alice.
+ - { 'key-args': {'scenario': 'charlie.xml', '-p': '5060', '-i': '127.0.0.4', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.4'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+ # Bob receives call from Alice and sends audio. Bob then attemps to blind transfer Alice to Charlie.
+ - { 'key-args': {'scenario': 'bob.xml', '-p': '5060', '-i': '127.0.0.3', '-s': 'alice', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.3'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+ # Alice calls Bob and sends audio.
+ - { 'key-args': {'scenario': 'alice.xml', '-p': '5060', '-i': '127.0.0.2', '-s': 'bob', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.2'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+ # Second iteration
+ -
+ scenarios:
+ # Charlie receives transfered call and sends audio to Alice.
+ - { 'key-args': {'scenario': 'charlie.xml', '-p': '5060', '-i': '127.0.0.4', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.4'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+ # Bob receives call from Alice and sends audio. Bob then attempts to blind transfer Alice to Charlie.
+ - { 'key-args': {'scenario': 'bob.xml', '-p': '5060', '-i': '127.0.0.3', '-s': 'alice', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.3'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+ # Alice calls Bob and sends audio.
+ - { 'key-args': {'scenario': 'alice.xml', '-p': '5060', '-i': '127.0.0.2', '-s': 'bob_two', '-timeout': '20s', '-min_rtp_port': '6004', '-max_rtp_port': '6008', '-mi': '127.0.0.2'},
+ 'ordered-args': ['-timeout_error', '-key', 'custom_media_port', '6004'] }
+
+ami-config:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
+ Variable: 'SIPTRANSFER'
+ Value: 'yes'
+ count: 2
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
+ Channel: 'PJSIP/alice-.{8}'
+ Variable: 'SIPREFERRINGCONTEXT'
+ Value: 'transfertest'
+ count: 1
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
+ Channel: 'PJSIP/alice-.{8}'
+ Variable: 'SIPREFERRINGCONTEXT'
+ Value: 'other'
+ count: 1
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
+ Channel: 'PJSIP/alice-.{8}'
+ Variable: '_{0,2}SIPREFERREDBYHDR'
+ Value: 'sip:bob at 127.0.0.3:5060'
+ count: 2
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
+ Variable: '_{0,2}SIPREFERTOHDR'
+ Value: 'sip:charlie at 127.0.0.1'
+ count: 2
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'BlindTransfer'
+ TransfererChannel: 'PJSIP/bob-.{8}'
+ count: 2
+
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_direct_media/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf Sun Jun 1 22:48:41 2014
@@ -1,0 +1,27 @@
+
+[transfertest]
+
+exten => bob,1,NoOp()
+ same => n,Dial(PJSIP/bob)
+ same => n,Hangup()
+
+exten => bob_two,1,NoOp()
+ same => n,Dial(PJSIP/bob,,b(alicecontext^alice_two^1))
+ same => n,Hangup()
+
+exten => charlie,1,NoOp()
+ same => n,Dial(PJSIP/charlie)
+ same => n,Hangup()
+
+[other]
+
+; Second test iteration should execute
+exten => charlie,1,NoOp()
+ same => n,Dial(PJSIP/charlie)
+ same => n,Hangup()
+
+[alicecontext]
+
+exten => alice_two,1,NoOp()
+ same => n,Set(TRANSFER_CONTEXT=other)
+ same => n,Return()
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf Sun Jun 1 22:48:41 2014
@@ -1,0 +1,44 @@
+[global]
+type=global
+debug=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=g722,ulaw,alaw
+context=transfertest
+direct_media=no
+media_address=127.0.0.1
+aors=alice
+
+[alice]
+type=aor
+max_contacts=1
+
+[bob]
+type=endpoint
+allow=g722,ulaw,alaw
+context=transfertest
+direct_media=no
+media_address=127.0.0.1
+aors=bob
+
+[bob]
+type=aor
+max_contacts=1
+
+[charlie]
+type=endpoint
+allow=g722,ulaw,alaw
+context=transfertest
+direct_media=no
+media_address=127.0.0.1
+aors=charlie
+
+[charlie]
+type=aor
+max_contacts=1
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/test-config.yaml?view=auto&rev=5090
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/transfers/blind_transfer/callee_refer_only/test-config.yaml Sun Jun 1 22:48:41 2014
@@ -1,0 +1,124 @@
+testinfo:
+ summary: 'Test PJSIP Blind Transfer Callee Initiated With Only REFER'
+ description: |
+ 'This test verifies a basic PJSIP Blind transfer where no re-INVITE is
+ sent to put an endpoint on hold. This uses a SIPp instance for each of
+ "Alice", "Bob", and "Charlie". Alice calls Bob through Asterisk. Bob
+ then blind transfers Alice to Charlie. After Asterisk notifies Bob that
+ Charlie answered, Bob hangs up. Charlie hangs up the call with Alice. A
+ second iteration is performed to ensure correct behavior when the
+ TRANSFER_CONTEXT channel variable is used. This test ensures that the
+ transfer was successful and that various channel variables are set
+ appropriately.'
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - python: 'pjsua'
+ - asterisk : 'res_pjsip'
+ tags:
+ - pjsip
+ - transfer
+
+test-modules:
+ add-test-to-search-path: 'True'
+ test-object:
+ config-section: test-case-config
+ typename: 'test_case.TestCaseModule'
+ modules:
+ -
+ config-section: 'pjsua-config'
+ typename: 'pjsua_mod.PJsua'
+ -
+ config-section: 'ami-config'
+ typename: 'ami.AMIEventModule'
+
+test-case-config:
+ connect-ami: 'True'
+
+pjsua-config:
+ callback_module: 'transfer'
+ callback_method: 'transfer'
+ transports:
+ -
+ name: 'local-ipv4-1'
+ bind: '127.0.0.1'
+ bindport: '5061'
+ -
+ name: 'local-ipv4-2'
+ bind: '127.0.0.1'
+ bindport: '5062'
+ -
+ name: 'local-ipv4-3'
+ bind: '127.0.0.1'
+ bindport: '5063'
+ accounts:
+ -
+ name: 'alice'
+ username: 'alice'
+ domain: '127.0.0.1'
+ transport: 'local-ipv4-1'
+ -
+ name: 'bob'
+ username: 'bob'
+ domain: '127.0.0.1'
+ transport: 'local-ipv4-2'
+ -
+ name: 'charlie'
+ username: 'charlie'
+ domain: '127.0.0.1'
+ transport: 'local-ipv4-3'
+
+ami-config:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'VarSet'
[... 1064 lines stripped ...]
More information about the asterisk-commits
mailing list