On Tue, Feb 23, 2010 at 10:38 PM, Evgeny Miloslavsky <
emiloslav...@juniper.net> wrote:

>  Hi
>
> Thank you for your help.
>
> Will the following be working?
>
>
>
> <recv request="OPTIONS">
>
>      <action>
>
>         <ereg regexp="OPTIONS 
> (sip:1000-junipersyst...@[local_ip]:[local_port])
> SIP/2.0" search_in="msg" check_it="true" assign_to="2"/>
>
>      </action>
>
>    </recv>
>
Hello,
no, this will not work. SIPp doesn't interpolate keywords/variables into
regexps (anyway, square brackets have special meaning in regexps: they
define a character class).
Here's a sample to collect parts of the URI in a INVITE:

  <recv request="INVITE" crlf="true">
    <action>
      <ereg regexp="INVITE sip:([...@]+)@([^:]+):([^ ]+) SIP/2.0"
search_in="msg" check_it="true"
assign_to="whole_thing,username,domain,port"/>
      <log message="Parts: whole_thing='[$whole_thing]'
username='[$username]' domain='[$domain]' port='[$port]'"/>
    </action>

After using the above, I got this in the log file:

Parts: whole_thing='INVITE sip:take...@192.168.2.4:6060 SIP/2.0'
username='takeshi' domain='192.168.2.4' port='6060'

So you could collect the parts and check them afterwards maybe using strcmp
(but beware that if the port is not sent in the request, the match will
fail).



> *From:* mayamatakeshi [mailto:mayamatake...@gmail.com]
>
> *Sent:* Tuesday, February 23, 2010 12:12 PM
> *To:* Evgeny Miloslavsky
> *Cc:* sipp-users@lists.sourceforge.net;
> sipp-users-boun...@lists.sourceforge.net
> *Subject:* Re: [Sipp-users] HowTo search regular expression within request
> line
>
>
>
>
>
> On Tue, Feb 23, 2010 at 6:50 PM, Evgeny Miloslavsky <
> emiloslav...@juniper.net> wrote:
>
> Hi All!
>
> I have to find SIP-URI for example (sip:30...@somedomain.com) within
> Request-Line (not header) of ID OPTIONS request received.
>
> What shoud be an *search_in* value within <actions> field?
>
> That is :
>
> <recv request=OPTIONS>
>
>             <action>
>
>                         <ereg regexp=” sip:30...@somedomain.com”
> search_in=”*??????*” check_it=”true” assign_to=”1”/>
>
> </action>
>
> </recv>
>
>
> Have you tried search_in="msg" to search the whole message?
> I would expect something like this to work:
>
> <ereg regexp="OPTIONS (sip:30...@somedomain.com) SIP/2.0" search_in="msg"
> check_it="true" assign_to="whole_thing,the_uri" />
>
>
>
>
>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to