<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Brandon,<br>
<br>
you are missing the multi-line matching flag, try:<br>
xlog("L_INFO", "[$ci] $(rb{re.subst,/^(.*)m=audio ([0-9]+)(.*)$/\2/s})")<br>
<br>
Note the 's' after the last '/' in subst expression.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
On 4/29/10 10:21 PM, Brandon Armstead wrote:
<blockquote
 cite="mid:n2v97ef8e3c1004291321q31ca99e9v6e7d8aad8523d7bc@mail.gmail.com"
 type="cite">Daniel,<br>
  <br>
Here is the XLOG output, the top log is the unmodified version and the
bottom is the modified version.<br>
  <br>
xlog("L_INFO", "[$ci] $rb") OUTPUTS:<br>
  <br>
Apr 29 20:17:23 sip-core02 /sbin/kamailio[23550]: [<a
 moz-do-not-send="true" href="mailto:6db72a2f-7e263847@192.168.1.75">6db72a2f-7e263847@192.168.1.75</a>]
v=0#015#012o=- 24986155 24986155 IN IP4
99.21.137.236#015#012s=-#015#012c=IN IP4 174.37.45.134#015#012t=0
0#015#012m=audio 55630 RTP/AVP 0 2 4 8 18 96 97 98
101#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:2
G726-32/8000#015#012a=rtpmap:4 G723/8000#015#012a=rtpmap:8
PCMA/8000#015#012a=rtpmap:18 G729a/8000#015#012a=rtpmap:96
G726-40/8000#015#012a=rtpmap:97 G726-24/8000#015#012a=rtpmap:98
G726-16/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101
0-15#015#012a=ptime:30#015#012a=sendrecv#015#012a=nortpproxy:yes#015<br>
  <br>
xlog("L_INFO", "[$ci] $(rb{re.subst,/^(.*)m=audio ([0-9]+)(.*)$/\2/})")
OUTPUTS:<br>
  <br>
Apr 29 20:17:23 sip-core02 /sbin/kamailio[23550]: [<a
 moz-do-not-send="true" href="mailto:6db72a2f-7e263847@192.168.1.75">6db72a2f-7e263847@192.168.1.75</a>]
v=0#015#012o=- 24986155 24986155 IN IP4
99.21.137.236#015#012s=-#015#012c=IN IP4 174.37.45.134#015#012t=0
0#015#01255630#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:2
G726-32/8000#015#012a=rtpmap:4 G723/8000#015#012a=rtpmap:8
PCMA/8000#015#012a=rtpmap:18 G729a/8000#015#012a=rtpmap:96
G726-40/8000#015#012a=rtpmap:97 G726-24/8000#015#012a=rtpmap:98
G726-16/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101
0-15#015#012a=ptime:30#015#012a=sendrecv#015#012a=nortpproxy:yes#015<br>
  <br>
As for the actual INVITE / SDP BODY:<br>
  <br>
v=0.<br>
o=- 24986155 24986155 IN IP4 99.21.XXX.XXX.<br>
s=-.<br>
c=IN IP4 174.37.XX.XXX.<br>
t=0 0.<br>
m=audio 55630 RTP/AVP 0 2 4 8 18 96 97 98 101.<br>
a=rtpmap:0 PCMU/8000.<br>
a=rtpmap:2 G726-32/8000.<br>
a=rtpmap:4 G723/8000.<br>
a=rtpmap:8 PCMA/8000.<br>
a=rtpmap:18 G729a/8000.<br>
a=rtpmap:96 G726-40/8000.<br>
a=rtpmap:97 G726-24/8000.<br>
a=rtpmap:98 G726-16/8000.<br>
a=rtpmap:101 telephone-event/8000.<br>
a=fmtp:101 0-15.<br>
a=ptime:30.<br>
a=sendrecv.<br>
a=nortpproxy:yes.<br>
  <br>
Let me know if this is sufficient or if there is anything else I can
provide.&nbsp; Thanks!<br>
  <br>
Sincerely,<br>
Brandon Armstead<br>
  <br>
  <div class="gmail_quote">On Wed, Apr 28, 2010 at 3:54 PM,
Daniel-Constantin Mierla <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">Hello,<br>
    <br>
can you paste here the sip message and the result of the substitution?
It will help to troubleshoot if is something wrong there.<br>
    <br>
Cheers,<br>
Daniel
    <div>
    <div class="h5"><br>
    <br>
    <br>
On 4/27/10 2:35 AM, Brandon Armstead wrote:
    </div>
    </div>
    <blockquote type="cite">
      <div>
      <div class="h5">Hello All,<br>
      <br>
&nbsp; Correction, it seems both the last supplied regex and xlog("L_INFO",
"[$ci] m=audio $(rb{re.subst,/(.*)m=audio ([0-9]+) (.*)/\2/})"); return
the same invalid results.<br>
      <br>
Thanks again!<br>
      <br>
Sincerely,<br>
Brandon Armstead<br>
      <br>
      <div class="gmail_quote">On Mon, Apr 26, 2010 at 7:33 PM, Brandon
Armstead <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:brandon@cryy.com" target="_blank">brandon@cryy.com</a>&gt;</span>
wrote:<br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello
All,<br>
        <br>
&nbsp;&nbsp; I hate to dig-up this older mailing list entry.&nbsp; However I am some
additional trouble with what I believe is a completely posix-only regex.<br>
        <br>
xlog("L_INFO", "[$ci] m=audio $(rb{re.subst,/(.*)m=audio(.*)/\2/})");<br>
        <br>
I would expect to give me the port from the m=audio line, however it
does not -- it simply removes m=audio.<br>
        <br>
Any thoughts / ideas / suggestions?<br>
        <br>
Sincerely,<br>
        <font color="#888888">Brandon Armstead</font>
        <div>
        <div><br>
        <br>
        <div class="gmail_quote">On Wed, Dec 23, 2009 at 9:31 PM, I&ntilde;aki
Baz
Castillo <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:ibc@aliax.net" target="_blank">ibc@aliax.net</a>&gt;</span>
wrote:<br>
        <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">El
Mi&eacute;rcoles,
23 de Diciembre de 2009, Daniel-Constantin Mierla escribi&oacute;:<br>
          <div>&gt; the re.subst transformation uses Posix regexp for
matching, only the<br>
&gt; format of the command is perl-like. I implemented this because
textops<br>
&gt; has no dependency of extra libraries than core and I wanted to
keep it so.<br>
&gt;<br>
&gt; Maybe is good to add a pcre.subst transformation in regex module
to be<br>
&gt; able to use extended regexp formats given by libpcre.<br>
          <br>
          </div>
I&iexcl;ll try to implement it when I get some spare time :)<br>
          <div><br>
          <br>
--<br>
I&ntilde;aki Baz Castillo &lt;<a moz-do-not-send="true"
 href="mailto:ibc@aliax.net" target="_blank">ibc@aliax.net</a>&gt;<br>
          <br>
_______________________________________________<br>
          </div>
          <div>
          <div>Kamailio (OpenSER) - Users mailing list<br>
          <a moz-do-not-send="true"
 href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
          <a moz-do-not-send="true"
 href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users"
 target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
          <a moz-do-not-send="true"
 href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users"
 target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a></div>
          </div>
        </blockquote>
        </div>
        <br>
        </div>
        </div>
      </blockquote>
      </div>
      <br>
      </div>
      </div>
      <pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org"
 target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true"
 href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
 target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
  </pre>
    </blockquote>
    <br>
    <pre cols="72"><div class="im">-- 
Daniel-Constantin Mierla
* <a moz-do-not-send="true" href="http://www.asipto.com/"
 target="_blank">http://www.asipto.com/</a></div>
* <a moz-do-not-send="true" href="http://twitter.com/miconda"
 target="_blank">http://twitter.com/miconda</a>
* <a moz-do-not-send="true"
 href="http://www.linkedin.com/in/danielconstantinmierla"
 target="_blank">http://www.linkedin.com/in/danielconstantinmierla</a> 
    </pre>
    </div>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
* <a class="moz-txt-link-freetext" href="http://www.asipto.com/">http://www.asipto.com/</a>
* <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a>
* <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/danielconstantinmierla">http://www.linkedin.com/in/danielconstantinmierla</a> 
</pre>
</body>
</html>