Just a correction....
you have to convert the double value you got from the strcmp to boolean,
something like this should work:
<strcmp assign_to="temp_dtmf_1" variable="dtmf" value="1"/>
<test assign_to="dtmf_1" variable="temp_dtmf_1" compare="equal" value="1"/>



On Fri, Sep 16, 2011 at 2:31 PM, Patrick Wakano <pwak...@gmail.com> wrote:

>
> I had a similar need sometime ago.... I wanted to inform the pcap in the
> command line(with the parameter -key) so I tried exactly what you did and
> faced the same problem....
> From what I can remember, after investigating the problem I found out that
> the pcap file is read in the beginning of the script execution, while the
> variable/keyword substitution or field injection only happen before sending
> a message, that's why you got that error...
> This seems a restriction of SIPp... it has to read the pcap file in the
> beginning and only once to avoid delays in the middle of the test and the
> variables are replaced just before sending the message to assure they have
> the right value... seems logical to me. What it lacks is a way to make
> replacements in the text of the script before script parsing or
> execution..... this kind of feature would solve your problem....
> Since we dont have this feature you can try something like this:
> <nop>
>     <action>
>         <assignstr assign_to="dtmf" value="[field4]"/> *** Gets the value
> from the injection file
>         <strcmp assign_to="dtmf_1" variable="dtmf" value="1"/> *** Check if
> the value was 1, if so sets dtmf_1
>         <strcmp assign_to="dtmf_2" variable="dtmf" value="2"/> *** Check if
> the value was 2, if so sets dtmf_2
>          .... *** repeat for every dtmf you have
>     </action>
> </nop>
> <nop condexec="dtmf_1"> *** plays the pcap only if the dtmf is 1
>     <action>
>         <exec play_pcap_audio="/usr/share/sipp/pcap/dtmf_2833_1.pcap"/>
>     </action>
> </nop>
> <nop condexec="dtmf_2"> *** plays the pcap only if the dtmf is 2
>     <action>
>         <exec play_pcap_audio="/usr/share/sipp/pcap/dtmf_2833_2.pcap"/>
>     </action>
> </nop>
> ..... *** repeat for every dtmf you have
>
> I haven't tested it, seems dumb and gets way too long but may work!
>
>
>
> On Fri, Sep 16, 2011 at 11:08 AM, Ingemar Nilsson <
> ingemar.nils...@confy.se> wrote:
>
>> Hi,
>>
>> I'm trying to send DTMF digits using RTP according to a CSV injection
>> file, but I don't understand how to get it right. First, I tried this:
>>
>> <nop>
>> <action>
>> <exec play_pcap_audio="/usr/share/sipp/pcap/dtmf_2833_[field4].pcap"/>
>> </action>
>> </nop>
>>
>> But SIPp claims it cannot find the file
>> "/usr/share/sipp/pcap/dtmf_2833_[field4].pcap", because it did not
>> expand [field4] from the injection file. I read some thread on
>> sipp-users from 2007 that said that you should assign the value to a
>> variable first, like this:
>>
>> <nop>
>> <action>
>> <assignstr assign_to="2" value="[field4]" />
>> <exec play_pcap_audio="/usr/share/sipp/pcap/dtmf_2833_$2.pcap"/>
>> </action>
>> </nop>
>>
>> But that didn't work either, since $2 was not expanded to the value of
>> [field4] in pcap_play_audio.
>>
>> Is there any way to do this? I have a working scenario that uses SIP
>> INFO and reads DTMF digits from an injection file, and I also have a
>> working scenario with a hard-coded pcap_play_audio sequence. But I would
>> like the pcap_play_audio sequence to be determined by the injection
>> file, just like in my SIP INFO scenario, and I cannot figure out how to
>> do that.
>>
>> I'm using SIPp 3.1.9 (from the EPEL repo) on CentOS 5.
>>
>> Regards
>> Ingemar
>>
>>
>>
>> ------------------------------------------------------------------------------
>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>> http://p.sf.net/sfu/rim-devcon-copy2
>> _______________________________________________
>> Sipp-users mailing list
>> Sipp-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sipp-users
>>
>
>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to