Good tutorial,<br><br>now that i see it, I think you can try using the following:<br><pre><font size="4">$` eq &quot;Lord Wo&quot;;<br>$&amp; eq &quot;pp&quot;;<br>$&#39; eq &quot;er of Fibbing&quot;;<br></font></pre><br>$rU = $(rU{re.subst,/^%23/$`$&#39;})<br>
so you get the match before and after the string, but you should try it first, I&#39;m not sure if it will impact on the var and avp space.<br><br>The previous example matched some string followed by %23 and followed by some other string. Then the translaion only used the strings and forgot about the %23.<br>
<br>This one does the same without using internal REGEXP variables.<br><br>Glad I could help.<br>Uriel<br><br><br><div class="gmail_quote">On Wed, Jan 13, 2010 at 5:23 AM, alex pappas <span dir="ltr">&lt;<a href="mailto:rebel.pappas@gmail.com">rebel.pappas@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;">Hi <br><br>I found this tutorial on internet <a href="http://www.comp.leeds.ac.uk/Perl/sandtr.html" target="_blank">http://www.comp.leeds.ac.uk/Perl/sandtr.html</a>  which is explaining in deep the sustitution.<br>
<br>Thank you<br><font color="#888888">Alex</font><div><div></div><div class="h5"><br>
<br><br><br><div class="gmail_quote">On Wed, Jan 13, 2010 at 10:10 AM, alex pappas <span dir="ltr">&lt;<a href="mailto:rebel.pappas@gmail.com" target="_blank">rebel.pappas@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;">

Hi,<br><br>That is very cool and it works :-))<br>Could you explain how the substitution is done so i can learn that and use it again?<br><br>Thank you<br><font color="#888888">Alex</font><div><div></div><div><br>
<br><br><br><div class="gmail_quote">On Tue, Jan 12, 2010 at 6:51 PM, Uriel Rozenbaum <span dir="ltr">&lt;<a href="mailto:uriel.rozenbaum@gmail.com" target="_blank">uriel.rozenbaum@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;">Alex,<br>I think you can use:<br><br>$rU = $(rU{re.subst,/^(.*)%23(.*)/\1\2/})<br><br>Maybe you should use some variable to make this modification.<br>


<br>Cheers,<br><font color="#888888">Uriel</font><div><div></div><div><br><br><div class="gmail_quote">On Tue, Jan 12, 2010 at 12:12 PM, alex pappas <span dir="ltr">&lt;<a href="mailto:rebel.pappas@gmail.com" target="_blank">rebel.pappas@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;">Hi <br><br>I fixed in this way:<br><br><br>        if($rU =~ &quot;^.*%+&quot;)<br>        {<br>



                xlog(&quot;alx ------- The number contains %23 OR #&quot;);<br>                $var(new_prefix) = $(rU{s.select,0,%});          # get the prefix to re use it later<br>
                $var(new_num) = $(rU{s.select,1,%});             # cat the %<br>                $var(cat_hash) = $(var(new_num){s.substr,2,0});  # cat the 23<br>                $rU = $var(new_prefix) + $var(cat_hash);<br>




                xlog(&quot;alx ------- The var(new_prefix) = $var(new_prefix) the var(new_num) = $var(new_num) new rU = $var(cat_hash) -------&quot;);<br>        }<br><br>i don&#39;t know if is the best way but it works. If anyone can suggest something else less power consuming, is welcomed.<br>




<br>Cheers<br><font color="#888888">Alex</font><div><div></div><div><br><br><br><br><div class="gmail_quote">On Tue, Jan 12, 2010 at 4:49 PM, alex pappas <span dir="ltr">&lt;<a href="mailto:rebel.pappas@gmail.com" target="_blank">rebel.pappas@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;">
Hi,<br><br>I already tried that and i was expecting to see back a # but that did not happen. Anyway i will read more carefully the docs and see if I find something there.<br><br><br>Cheers<br><font color="#888888">Alex</font><div>




<div></div><div><br><br><br><br><div class="gmail_quote">
On Tue, Jan 12, 2010 at 4:41 PM, Alex Balashov <span dir="ltr">&lt;<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.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;">





Section 19.1.2 (&quot;Character Escaping Requirements&quot;) of RFC 3261 says quite clearly that special characters must be escaped when appearing in SIP URIs.<br>
<br>
It&#39;s up to the SIP stack to decode them and translate them into something usable by the caller, if needed.  Kamailio doesn&#39;t do this for &#39;#&#39; by default.<br>
<br>
If you want to decode escaped characters, try use the transformations that are designed for that, i.e. {s.unescape.user}.  Example:<br>
<br>
   $(rU{s.unescape.user})<div><div></div><div><br>
<br>
On 01/12/2010 09:29 AM, alex pappas wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
Dear Friends,<br>
<br>
Do you have any idea on how to remove from $rU the %23 when is send in<br>
to my network?<br>
The scenario is: The customer will send (prefix # number). This is<br>
translated in sip in (prefix %23 number). I need to remove this in order<br>
to check against PDT module.<br>
<br>
Thanks<br>
Alex<br>
<br>
<br>
<br>
<br>
<br></div></div>
_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote>
<br>
<br>
-- <br>
Alex Balashov - Principal<br>
Evariste Systems<br>
Web     : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>
Tel     : (+1) (678) 954-0670<br>
Direct  : (+1) (678) 954-0671<br>
<br>
_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>