Hello,
I spent the last couple of days figuring out the best way to simulate an
attended transfer scenario (exactly as it is listed in the documentation
under 3pcc). But in the documentation it was listed as "reported to be
do-able":
Another scenario that has been reported to be do-able with the 3PCC
feature is the following:
* A calls B. B answers. B and A converse
* B calls C. C answers. C and B converse
* B "REFER"s A to C and asks to replace A-B call with B-C call.
* A accepts. A and C talk. B drops out of the calls.
This is what I needed to do. I finally have it working so I am attaching
my xml scenarios and my shell script (called runit) to run the scenarios
from a Linux environment. You can create a similar batch file to use on
Windows if you so chose.
Hope this helps save some time for the next user and maybe we can get
these scenarios added to the documentation so they are readily available?
Regards,
Kalpan
Aumtech, Inc.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'uas' scenario. -->
<!-- -->
<scenario name="ReferALeg">
<recv request="INVITE" crlf="true">
<action>
<!-- Getting the original Contact and placing it in [$2] -->
<ereg regexp="(sip:[[:alnum:]...@\.\:\+]*)"
search_in="hdr"
header="Contact:"
check_it="true"
assign_to="1,2"
/>
<!-- Getting the original From tag and placing it in [$4] -->
<ereg regexp="tag=([[:alnum:]\-]*)"
search_in="hdr"
header="From:"
check_it="true"
assign_to="3,4"
/>
<!-- Getting the original branch and placing it in [$12] -->
<ereg regexp="branch=([[:alnum:]\-]*)"
search_in="hdr"
header="Via:"
check_it="true"
assign_to="11,12"
/>
<ereg regexp="([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)\:([0-9]*)" search_in="hdr" header="Contact:" check_it="true" assign_to="dummy,host,port" />
<setdest host="[$host]" port="[$port]" protocol="UDP" />
</action>
</recv>
<send>
<![CDATA[
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<send>
<![CDATA[
SIP/2.0 101 Dialog Establishment
[last_Via:]
[last_From:]
[last_To];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:6023250...@[local_ip]:[local_port];transport=[transport]>
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:+16023250...@[local_ip]:[local_port];transport=[transport]>
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:+16023250...@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
User-Agent: eXosip/3.0.3
Content-Length: [len]
v=0
o=ArcSipIvr 2005 2029 IN IP[local_ip_type] [local_ip]
s=SIP Call
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 96
a=rtpmap:0 PCMU/8000
a=rtpmap:96 telephone-event/8000
a=ptime:20
]]>
</send>
<recv request="ACK"
rtd="true"
crlf="true">
</recv>
<recv request="INVITE" timeout="1000" ontimeout="5" crlf="true">
</recv>
<send>
<![CDATA[
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:+16023250...@[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
User-Agent: eXosip/3.0.3
Content-Length: [len]
v=0
o=ArcSipIvr 2005 2029 IN IP[local_ip_type] [local_ip]
s=SIP Call
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 96
a=rtpmap:0 PCMU/8000
a=rtpmap:96 telephone-event/8000
a=ptime:20
]]>
</send>
<recv request="ACK"
rtd="true"
crlf="true">
</recv>
<label id="5" />
<sendCmd>
<![CDATA[
Call-ID: [call_id]
Start the B Leg
]]>
</sendCmd>
<recvCmd>
<action>
<ereg regexp="Contact: .*(sip:[[:alnum:]...@\.\:]*)"
search_in="msg"
check_it="true"
assign_to="5,6"
/>
<ereg regexp="Call-ID: ([[:alnum:]...@\.\:\-]*)"
search_in="msg"
check_it="true"
assign_to="7,8"
/>
<ereg regexp="tag=([[:alnum:]\-]*)"
search_in="hdr"
header="To:"
check_it="true"
assign_to="9,10"
/>
<log message="A Leg Contact is [$2]" />
<log message="B Leg URI is [$6]" />
<log message="B Leg Call ID is [$8]" />
<log message="B Leg To Tag is [$10]" />
<log message="A Leg From Tag is [$4]" />
<log message="A Leg host is [$host]" />
<log message="A Leg port is [$port]" />
<log message="Printing all the variables [$dummy] [$1] [$8] [$11] [$12] [$2] [$3] [$5] [$7] [$9]" />
</action>
</recvCmd>
<send>
<![CDATA[
REFER [$2] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:6023250...@[local_ip]:[local_port]>;tag=[call_number]
To: "6023250099" <[$2]>;tag=[$4]
[last_Call-ID:]
CSeq: [cseq] REFER
Contact: <sip:+16023250...@[local_ip]:[local_port]>
Max-Forwards: 70
User-Agent: eXosip/3.0.3
Refer-to: <[$6]?Replaces=ABCD///[call_id]%3Bto-tag%3D[$10]%3Bfrom-tag%3D[$4]>
Referred-By: sip:a...@[local_ip]
Content-Length: 0
]]>
</send>
<recv response="202" rtd="true" crlf="true">
</recv>
<recv request="BYE">
</recv>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:6023250...@[local_ip]:[local_port]
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
<pause milliseconds="5000"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'uas' scenario. -->
<!-- -->
<scenario name="ReferBLeg">
<recvCmd>
</recvCmd>
<send retrans="500">
<![CDATA[
INVITE sip:[servi...@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:a...@[local_ip]:[local_port]>;tag=[call_number+5]
To: <sip:[servi...@[remote_ip]:[remote_port]>
Call-ID: ABCD///[call_id]
CSeq: [cseq] INVITE
Contact: <sip:a...@[local_ip]:[local_port]>
Content-Type: application/sdp
Max-Forwards: 70
User-Agent: eXosip/3.0.3
Expires: 120
Content-Length: [len]
v=0
o=ArcSipIvr 2005 2030 IN IP[local_ip_type] [local_ip]
s=SIP Call
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port+5] RTP/AVP 0 96
a=rtpmap:0 PCMU/8000
a=rtpmap:96 telephone-event/8000
a=ptime:20
]]>
</send>
<recv response="100"
optional="true">
</recv>
<recv response="101"
optional="true">
</recv>
<recv response="180" optional="true">
</recv>
<recv response="200" rtd="true" crlf="true">
<action>
<ereg regexp="branch=([[:alnum:]\-]*)"
search_in="hdr"
header="Via:"
check_it="true"
assign_to="8,9"
/>
<ereg regexp="200 OK.*"
search_in="msg"
assign_to="1"/>
<log message="Printing variables [$8]" />
</action>
</recv>
<send>
<![CDATA[
ACK sip:[servi...@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[$9]
From: <sip:a...@[local_ip]:[local_port]>;tag=[call_number+5]
To: <sip:[servi...@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: ABCD///[call_id]
CSeq: [cseq] ACK
Contact: sip:a...@[local_ip]:[local_port]
Max-Forwards: 70
User-Agent: eXosip/3.0.3
Content-Length: 0
]]>
</send>
<sendCmd>
<![CDATA[
Call-ID: [call_id]
[$1]
]]>
</sendCmd>
<recv request="BYE">
</recv>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:6023250...@[local_ip]:[local_port]
User-Agent: eXosip/3.0.3
Content-Length:0
]]>
</send>
<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
<pause milliseconds="4000"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
# This script will use SIPp to create a consultation transfer scenario.
# SIPp will listen on port 5060 of the local system for an incoming call.
# Once the call arrives, it will generate a B-Leg Invite to the configured
"numberB" and IP Address "remoteB".
# After the call has successfully been answered, SIPp will send a REFER to the
A-Leg with a Replaces header in the Refer-To tag.
# Then SIPp will wait for a BYE from both the A and B Legs.
# The script does not handle any error scenarios.
# A known issue exists where if a NOTIFY is received after the REFER, SIPp may
generate a segmentation fault. But the transfer should have happened already
and therefore should not impact the call scenario.
# CONFIG SECTION
numberB="4141" # This is the number you wish to transfer to
remoteB="10.0.10.11:5060" # The is the IP Address and port for the B-Leg.
localportA="5060" # This is the SIP listening port used for the
A-Leg. The port where the call should be placed.
localportB="5061" # This is the SIP send port used for the B-Leg
sharedport="5062" # This is a local port used for 3pcc. This can
be any available port on the system.
#Do not change anything beyond this point
#############################################
remoteA="1.2.3.4:5678"
./sipp -trace_msg -trace_screen -trace_err -trace_logs -aa -sf BLeg.xml -3pcc
127.0.0.1:$sharedport -m 1 -p $localportB -s $numberB $remoteB -bg -nostdin
sleep 1
./sipp -trace_msg -trace_screen -trace_err -trace_logs -aa -sf ALeg.xml -m 1 -p
$localportA -3pcc 127.0.0.1:$sharedport $remoteA
sleep 5
killall sipp
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users