<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><font face="monospace">On second
thoughts, my regex is utterly broken if the vars contain SIP
headers. This one will work much better:<br>
<br>
avp_subst("$avp(str)", "/[\t ]+$//");</font><br>
<br>
On 11/11/2014 08:07 PM, Liviu Chircu wrote:<br>
</div>
<blockquote cite="mid:5462507C.2020406@opensips.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix"><tt>Hello Jeff,<br>
<br>
You could do something like:<br>
<br>
...<br>
loadmodule "avpops.so"<br>
...<br>
startup_route<br>
{<br>
$var(str) = "foofoo ";<br>
$avp(str) = $var(str);<br>
avp_subst("$avp(str)", "/([^ ]*) *$/\1/");<br>
xlog("Replacement for '$var(str)' is '$avp(str)'\n");<br>
}<br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 11/11/2014 06:54 PM, Jeff Pyle wrote:<br>
</div>
<blockquote
cite="mid:CACYJG3JNPYh0qHOEJ2T=R581BDDj=y7q=hCo7rCtGSwRWMK1Rw@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>How might one remove trailing white space from a script
variable or avp from within the OpenSIPS script?</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>- Jeff</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>