Hi Rob,
I am not in a position to try this for a few days, but I am hoping this
nugget of info that I had not picked up is the kwy.
I will report back so that others may have the results.

Thank you very much for your response.

Paul


On Sun, May 25, 2014 at 7:15 PM, Paul Miller <idkpmil...@sip2serve.com>wrote:

> Hi All.
> Firstly I am not good at regex, so I have been reading tutorials and
> looking at this site (http://regex101.com/) to practise my matching
> techniques.
>
> using the following example Via headers I want to match the port number
> when it is available.
>
> e.g.
> TEST1: Via: SIP/2.0/UDP 192.168.0.65;rport;branch=z9hG4bK380
> TEST2: Via: SIP/2.0/UDP 192.168.0.65:5060;rport;branch=z9hG4bK380
> TEST3: Via: SIP/2.0/UDP 192.168.0.65:15080;rport;branch=z9hG4bK380
>
> (don't get tied up on the rport syntax)
>
> I expect that the matches for each of the three Test samples should be as
> follow
>
> TEST1='' (no match)
> TEST2='5060'
> TEST3='15080'
>
> Using the following regex in the website I get my desired outcome:
>
> .*:([0-9]{4,5})[:;]
>
> I am sure that this will not be the best way but certainly it works in the
> website just fine.
>
> however when I use it an SIPp xml file I never get the same match as the
> website suggest
>
> example for input sample TEST2
> the match is SIPp is
> SIP/2.0/UDP 192.168.0.65:5060;
>
> I am using this in the SIPp xml file
>
>   <recv request="REGISTER" crlf="true">
>     <action>
> <ereg regexp=".*:([0-9]{4,5})[:;]" search_in="hdr" header="Via:"
> assign_to="vPort" />
>     </action>
>   </recv>
>
> I would like to have a reliable way to develop and test the regex in a
> interactive tool such as the website I am using that returns the same
> results when I use the epression in SIPp, can someone guide me to what I
> need to do to accomplish this goal.
>
> Also fro the case of TEST1 where there is no match I would like that vPort
> be assigned a default value of 5060, if there is a way to achieve this
> outcome that would be great to know also.
>
> Thanks
>
> Paul
>
>
>
>
------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to