On Mon, Mar 30, 2009 at 10:37 PM, Evgeny Miloslavsky
<[email protected]> wrote:
>
>
> HI All!
>
> Within INVITE request received, I want to validate that userpart of To
> header equals to field3 value of .csv file.
>
>
>
> I tried two options:
>
> 1) <ereg regexp="[ [email protected]:8877" search_in=”hdr" header="To:"
> assign_to="1" />
>
>
>
> 2) <assignstr assign_to="3" value="[field4]" />
>
> <ereg regexp=" [[email protected]:8877" search_in="hdr" header="To:"
> check_it="true" assign_to="1"/>
>
>
>
> In both I got pretty match the same result: Failed regexp match: looking in
> ' Mr.Smith <sip:[email protected]:8877>;tag=ForwardManipulationRule', with
> regexp'Mr.Smith <[[email protected]:8877>' That is SIPp does not inject field3
> value from .csv file while performing ereg regexp procedure, but uses [$3]
> as string to search.
>
>
>
> My question is how to cause SIPp to take field3 value from .csv file and to
> use this value while performing ereg regexp action
Hello,
you cannot reference variables or fields inside regular expressions
because their syntax will clash with regex syntax (and even if you
could escape them somehow, as far as I know, SIPp will not interpolate
them into the regex).
So you should divide your matching operations.
Something like this:
<recv request="INVITE" crlf="true">
<action>
<ereg regexp="sip:([...@]+)@MyDUT.com:8877" search_in="hdr"
header="To:" assign_to="whole_uri,username" check_it="true" />
<assignstr assign_to="username_to_match" value="[field3]" />
<strcmp assign_to="result" variable="username"
variable2="username_to_match" />
<test assign_to="OK" variable="result" compare="equal" value="0.0" />
</action>
</recv>
<Reference variables="whole_uri" />
After that, you can check check variable OK and do some conditional operation:
<nop condexec="OK" condexec_inverse="true">
<action>
<warning message="username didn't match" />
</action>
</nop>
regards,
takeshi
------------------------------------------------------------------------------
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users