<div dir="ltr">That is magic, Liviu. Even in v1.6! <div><br></div><div><br></div><div>- Jeff</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 1:13 PM, Liviu Chircu <span dir="ltr"><<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div><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><div><div class="h5"><br>
<br>
On 11/11/2014 08:07 PM, Liviu Chircu wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div><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 cols="72">Liviu Chircu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
On 11/11/2014 06:54 PM, Jeff Pyle wrote:<br>
</div>
<blockquote 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></fieldset>
<br>
<pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>