<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div><font face="arial, helvetica, sans-serif">Hi Sindrek,</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><font face="arial, helvetica, sans-serif">look to this example from <span>opensips</span> documentation :</font><div><pre class="programlisting"><font face="arial, helvetica, sans-serif"># replace the uri in to: with the value of avp sip_address </font></pre><pre class="programlisting"><font face="arial, helvetica, sans-serif">subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig') </font></pre><font face="arial, helvetica, sans-serif"><div><font face="arial, helvetica, sans-serif"><br></font></div>regards</font></div><div><font face="arial, helvetica, sans-serif">//Binan<br></font><font size="2" style="font-family: arial; ">--- On </font><b style="font-family: arial; font-size: 10pt; ">Mon, 8/20/12,
sindrek <i><rauskjegg@gmail.com></i></b><font size="2" style="font-family: arial; "> wrote:</font><br><blockquote style="font-family: arial; font-size: 10pt; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; "><br>From: sindrek <rauskjegg@gmail.com><br>Subject: [OpenSIPS-Users] textops replace and variables ..<br>To: users@lists.opensips.org<br>Date: Monday, August 20, 2012, 4:07 AM<br><br><div class="plainMail">Hi,<br><br>I'm stuck with an idiotic thing her .. probably an easy thing which I can<br>not see ..<br><br>I want to add "something" in front of a register contact uri.<br><br>This static way works:<br><br>if(is_method("REGISTER")){ <br> replace("Contact: <sip:", "Contact: <sip:something");<br> };<br><br>This dynamic way does
not:<br><br>if(is_method("REGISTER")){<br> $var(contact) = "something";<br> <br> replace("Contact: <sip:", "Contact: <sip:"+$var(contact));<br> #or this:<br> replace("Contact: <sip:", "Contact: <sip: $var(contact)"); #does not get<br>the variable content, just it's name<br>};<br><br>I guess the replace method in the textops module does see the variable as<br>text/string? It migth need somethings like a .toString?<br><br>/BR<br>Sindre<br><br><br><br><br><br><br>--<br>View this message in context: <a href="http://opensips-open-sip-server.1449251.n2.nabble.com/textops-replace-and-variables-tp7581301.html" target="_blank">http://opensips-open-sip-server.1449251.n2.nabble.com/textops-replace-and-variables-tp7581301.html</a><br>Sent from the
OpenSIPS - Users mailing list archive at Nabble.com.<br><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opensips.org" href="/mc/compose?to=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></div></blockquote></div></td></tr></table>