Jeannot Langlois wrote:
> Now using the following piece of code:
>
> <ereg regexp="[^&lt&gt]*" search_in="hdr" header="m:" check_it="false" 
> assign_to="3"/>
>
> And I see $3 being printed as:
>
> <sip:jeanno
>
> Rather than what I was expecting:
>
> sip:[EMAIL PROTECTED]
>
>
> This appears to be a bug.  Is there any way to workaround this 
> problem?  Or what could I be doing incorrectly?
> (What I really want to do is to capture the entire m: header without 
> the angle brackets...)

I came with a workaround to my problem after much debugging with SIPp.  
To parse the following Contact header:

m: <sip:[EMAIL PROTECTED]>


...I am now successfully using the following workaround regexp:

      <ereg regexp="[^ &lt;].*[^&gt;]" search_in="hdr" header="m:" 
check_it="false" assign_to="3"/>

=> "In the 'm:' header, skip any space character, any opening angle 
brace, capture any number of characters coming afterwards except a 
closing angle brace".


1.  SIPp's XML parser does not like < and > characters directly (e.g. 
this conflicts with XML tag matching, somehow...), so using &lt; and 
&gt; is necessary -- these are internally replaced by SIPp with < and > 
later.  What a hack.

2.  I wasn't using a semi-colon (";") in each of these, causing 't' 
(first character that matched) in " <sip:[EMAIL PROTECTED]>" to 
be recognized at the end delimiter.  This explains why I was getting the 
following:
<sip:jeanno

3.  For some dark reason, the simpler regexp didn't work either:

[^ &lt;&gt;]*



Cheers,

-- 
Jeannot Langlois
Software Developer / Programmeur-Analyste
aka "SIP Phone Doctor" and "SIP PUBLISH/PRACK/UPDATE Expert"
Macadamian Technologies
(613) 739-5976 #137
www.macadamian.com

CONFIDENTIALITY: 
The information contained in this email is intended by Macadamian Technologies 
Inc. for the use by the named individual or entity to which it is addressed and 
may contain information that is privileged or confidential. It is not intended 
for transmission to, or receipt by, any individual or entity other than the 
named addressee expressly permitted in this email. If you have received this 
email in error, please delete it without copying or forwarding it, and notify 
the sender.

Subscribe to the Critical Path, our free monthly email on software management:
http://www.macadamian.com/subscribe



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to