On Wed, Aug 10, 2011 at 11:24 AM, mayamatakeshi <mayamatake...@gmail.com>wrote:

>
> On Tue, Aug 9, 2011 at 7:07 AM, Daniel Wong <dw...@netsapiens.com> wrote:
>
>> Hi all,
>> I'm trying to simulate a traffic pattern whereby i have a stable call
>> generation rate from the UAC to UAS, and hold the calls long enough to have
>> a few thousand active calls.  Then, i'd like to have the scenario suddenly
>> send BYEs from the UAS side as fast as my machine would allow it - to
>> terminate the calls that are still up, while at the same time still
>> generating new traffic in the background.
>> I have no problems creating the stable traffic generation scenario
>> (relatively easy), but i don't know how to incorporate the sudden BYEs into
>> the scenario as well.
>>
>> Ideas anyone?
>>
>
> I did the following test and it worked:
>
>  1)  got the epoch when I wanted the sudden BYE to happen. Ex:
>
> [root@mymachine tmp]# date +%s --date="Aug 10 10:58:00 2011"
> 1312941480
>
>  2) in the scenario file, got the current epoch, subtracted it from the
> epoch for BYE and multiplied it with 1000 to get the pause value in
> milliseconds, then I used that value in the pause command:
>
>   <nop>
>     <action>
>       <assign assign_to="wake_up" value="1312941480"/>
>       <gettimeofday assign_to="seconds,microseconds"/>
>       <subtract assign_to="wake_up" variable="seconds"/>
>       <multiply assign_to="wake_up" value="1000"/>
>     </action>
>   </nop>
>   <Reference variables="microseconds"/>
>
>   <pause variable="wake_up"/>
>
>   <send BYE .... />
>
> So if you need the sudden BYE to happen only once and continually generate
> more calls, you could start one instance with the above scenario and another
> with a fixed value for <pause/> (option -d).
> If you want the sudden BYE to happen continuously, then it could be ran by
> a looping bash script, recalculating the value of the wake_up (call sipp
> with something like "-m 2000", for sipp to exit and have it restarted by the
> controlling bash script).
>

After re-reading your email, I realized you want to do this having sipp
working as UAS.
So the above cannot be used as the bash script would start sipp in UAC mode.


>
> But If you need new sudden BYE calls to happen continually every 10 minutes
> for example, and if you want this to be done by a single scenario without
> stop, then I think you could change the code to calculate the next 10-minute
> epoch dynamically.
>

So I think you must write the UAS scenario like the above but continually
calculating the next epoch for new bunches of calls.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to