Try this:
<label id="2" /> <!-- label for reINV looping -->
<recv request="BYE" optional="true" next="5" timeout="15000" ontimeout="4">
</recv>
<recv request="INVITE" timeout="15000" ontimeout="4" next="3">
</recv>
I.E. you need to put the timeout in every line in an optional sequence.
Peter
Date: Sat, 12 Sep 2009 00:18:26 +0530
Subject: Re: [Sipp-users] Expecting multiple incoming requests with timeout.
From: hspah...@gmail.com
To: plh...@hotmail.com
CC: sipp-users@lists.sourceforge.net
I couldn't get the real meaning of your email; below is my sipp script for
reference (also attached it):
Thanks
Harry
===========================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="Carrier Grade Generic Script Caller">
<!-- sending INVITE -->
<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: sipp <sip:s...@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[servi...@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:s...@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
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 [field0] RTP/AVP 0 8 18 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:18 g729/8000
a=fmtp:101 0-11,16
a=rtpmap:101 telephone-event/8000
a=sendrecv
]]>
</send>
<recv response="404" optional="true" next="1">
</recv>
<recv response="408" optional="true" next="1">
</recv>
<recv response="415" optional="true" next="1">
</recv>
<recv response="480" optional="true" next="1">
</recv>
<recv response="487" optional="true" next="1">
</recv>
<recv response="500" optional="true" next="1">
</recv>
<recv response="503" optional="true" next="1">
</recv>
<recv response="183" optional="true">
</recv>
<recv response="180" optional="true">
</recv>
<recv response="200" rtd="true">
<action>
<ereg regexp=".*" search_in="hdr" header="Record-Route: "
assign_to="1"/>
<ereg regexp=".*" search_in="hdr" header="Contact:" assign_to="2"/>
<ereg regexp=".*" search_in="hdr" header="To:" assign_to="3"/>
<ereg regexp="sip:.*:[0-9][0-9][0-9][0-9]" search_in="hdr"
header="Contact:" assign_to="4"/>
</action>
</recv>
<send crlf="true">
<![CDATA[
ACK [$4] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:s...@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[servi...@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:s...@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<!-- Call Established -->
<!--
;transport=[transport]
<action>
<ereg regexp="tag=.*" search_in="hdr" header="From:" check_it="false"
assign_to="5"/>
</action>
-->
<label id="2" /> <!-- label for reINV looping -->
<!--
<recv request="BYE" optional="true" next="5" crlf="true">
</recv>
-->
<recv request="INVITE" timeout="15000" ontimeout="4" next="3">
</recv>
<!--
<recv request="INVITE" optional="true" next="3">
</recv>
<recv request="BYE" timeout="15000" ontimeout="4" next="5" crlf="true"/>
</recv>
-->
<label id="3"/><!-- label for handling reINV -->
<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:s...@[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 [media_port] RTP/AVP 0 8 18 101
a=rtpmap:18 g729/8000
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
]]>
</send>
<recv request="ACK" crlf="true" next="2">
</recv>
<!-- Finished reINVITE loop -->
<label id="5"/> <!-- label for recieving BYE in the reINV loop -->
<send next="6" crlf="true">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
[last_Record-Route:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<label id="4" />
<send>
<![CDATA[
BYE [$4] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:s...@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[servi...@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 2 BYE
Contact: sip:s...@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0
]]>
</send>
<recv response="481" optional="true" next="6">
</recv>
<recv response="200" rtd="true" next="6" crlf="true">
</recv>
<label id="1" /> <!-- label for handling negative resp for INV -->
<send next="6">
<![CDATA[
ACK sip:[servi...@[remote_ip]:[remote_port] SIP/2.0
[last_Via:]
From: sipp <sip:s...@[local_ip]:[local_port]>;tag=[call_number]
To: sut <sip:[servi...@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Subject: Performance Test
Content-Length: 0
]]>
</send>
<label id="6" /> <!-- label for final finishing the script -->
</scenario>
===========================
On Fri, Sep 11, 2009 at 11:50 PM, Peter Higginson <plh...@hotmail.com> wrote:
First a caveat - I have not looked at this in a while so things may have
changed. On the other hand I wrote the timeout code originally and it probably
still works the same way.
The problem with optional sequences is that the state machine normally sits at
the first option, but may move to any of the optional or the final
(non-optional) line. Hence you need to put the timeout on all the optional
lines as well as the final (non-optional) line.
In your particular case, since you are breaking out of the optional, you could
probably get away with just putting the timeout on the first optional line.
Just to complete the explanation - if you are not jumping out of the optionals,
then the timeout could vary between the value used and n times that value.
Regards,
Peter
Date: Fri, 11 Sep 2009 19:12:43 +0530
From: hspah...@gmail.com
To: sipp-users@lists.sourceforge.net
Subject: [Sipp-users] Expecting multiple incoming requests with timeout.
Hi All,
I am trying to design a generator script which after initiating the call, waits
for an incoming reINVITE or a BYE. At the same time I want to have a timeout &
then send a BYE message none of these messages arrive.
I tried using the following 2 sequences for the INVITE and BYE after generating
the call:
SEQUENCE 1: this sequence works for receiving any of these 2 messages but gets
stuck here; the timeout never fires & the script keeps sitting here. This
sequence will never send a BYE.
<recv request="BYE" optional="true" next="5" crlf="true">
</recv>
<recv request="INVITE" timeout="15000" ontimeout="4" next="3">
</recv>
SEQUENCE 2: this sequence works but it will never send out a BYE message.
<recv request="INVITE" optional="true" next="3">
</recv>
<recv request="BYE" optional="true" next="5">
</recv>
Is there a way to design a script which can wait for 2 incoming messages (out
of which one would arrive) & if the wait is times-out then scrip should send a
BYE.
Thanks in Advance.
Harry
Have more than one Hotmail account? Link them together to easily access both.
--
We must all hang together, or assuredly we shall all hang separately.
_________________________________________________________________
Access your other email accounts and manage all your email from one place.
http://clk.atdmt.com/UKM/go/167688463/direct/01/
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users