On Thu, Jul 8, 2010 at 5:58 PM, Evgeny Miloslavsky <emiloslav...@juniper.net
> wrote:

>  Hi All!
>
> I need to run 30 SIP Calls (m 30) parallely. SDP offered Media Port for
> each call must be bigger by 2 from previous call Media Port. I thought of
> making Media Port to be a function of [call_number] *2.  The algorithm is
> below:
>
> * *
>
> *<nop>*
>
> *   <action>*
>
> *     <assign assign_to="2" value="2818"/> <!-- Variable2 conatins initial
> SDP Media Port -->*
>
> *     <assign assign_to="3" value="0"/> <!-- Variable3 will contain final
> SDP Media Port -->*
>
> *     <assign assign_to="4" value="[call_number]" /> <!-- Variable4
> contains current call number -->*
>

I don't know if this is valid (I'm not sure if you can use [call_number] as
value for assign).

*     <multiply assign_to="4" value="2" /> <!-- variable 4 = Variable4*2, so
> we'll allways get an even numbers -->*
>
> *     <add assign_to="3" variable="4"/> <!--Variable3=Variable3+Variable4
> -->*
>
> *     <add assign_to="3" variable="2"/> <!-- Variable3 =
> Variable3+Variable2 -->*
>
> *   </action>*
>
> * </nop>*
>
> * *
>
> *      m=message [$3] TCP/MSRP **
>
> * *
>
> Thus Media Port of the first call will be 2820, of the 2nd call 2822 af
> the 3rd call 2824. The problem is SIPP interpret [call_number] as string
> and not as integer.
>
If you can assign [call_number] to a variable, then what you could do is to
use todouble to convert the string to a double:

<todouble assign_to="4" variable="3" />


> Any ideas for a solution/workaround?
>

You could also try with a global variable:

  <Global variables="counter" />

  <recv request="INVITE" crlf="true">
    <action>
      <add assign_to="counter" value="1"/>
      <multiply assign_to="counter" value="2" />
      ... etc ...
    </action>

 (but I'm not sure if SIPp ensures that the operations in the globals will
not overlap among calls).
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to