<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">Hello Alcindo,<br>
<br>
This should work:<br>
<br>
mysql> select * from dialplan where id=3;<br>
+----+------+----+----------+-----------+-------------+-----------+----------+----------+-------+<br>
| id | dpid | pr | match_op | match_exp | match_flags |
subst_exp | repl_exp | disabled | attrs |<br>
+----+------+----+----------+-----------+-------------+-----------+----------+----------+-------+<br>
| 3 | 1 | 1 | 1 | ^\d*#.* | 0 |
^(\d*)#.* | \1 | 0 | |<br>
+----+------+----+----------+-----------+-------------+-----------+----------+----------+-------+</font><br>
<font face="monospace"><br>
It basically matches your input string, and catches the user id
with "</font><font face="monospace"><font face="monospace">(\d*)</font>".
It then replaces the $rU with that data, which is now stored in
variable #1: "\1"<br>
<br>
Script usage:<br>
<br>
"<br>
$var(in) = <a class="moz-txt-link-rfc2396E" href="mailto:9675#1209380123@192.168.2.133">"9675#1209380123@192.168.2.133"</a>;<br>
<br>
if (!dp_translate("1", "$var(in)/$rU"))<br>
xlog("XXX failed to translate\n");<br>
else<br>
xlog("XXX translated to: $ru\n");</font><br>
"<br>
<br>
...<br>
<font face="monospace">XXX translated to:
<a class="moz-txt-link-abbreviated" href="mailto:sip:9675@192.168.2.133:5060">sip:9675@192.168.2.133:5060</a></font><br>
...<br>
<br>
<br>
<font face="monospace">Best regards,</font><br>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 04/04/2014 11:24 AM, Alcindo Schleder wrote:<br>
</div>
<blockquote
cite="mid:!&!AAAAAAAAAAAYAAAAAAAAAK3O+iK9cmRBl8k+xOm%2F4qDCgAAAEAAAAHDRdLQEsndCpDsZvwUZhMoBAAAAAA==@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EstiloDeEmail17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">I'm using opensips 1.10xeo dialplan module.
The user send me the following string:
'9675#destinationNumber@serverip’. <o:p></o:p></p>
<p class="MsoNormal">I want to remove only the # 9675 number and
store in $rU. <o:p></o:p></p>
<p class="MsoNormal">I've tried everything and can not succeed.
I tried with subst_exp, repl_exp and nothing.<o:p></o:p></p>
<p class="MsoNormal">What could be wrong?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:PT-BR">Alcindo
Schleder<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;mso-fareast-language:PT-BR">Gerente
de Negócios – <a moz-do-not-send="true"
href="mailto:comercial@renovaretelecom.com.br">comercial@renovaretelecom.com.br</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;mso-fareast-language:PT-BR">(51)
3564-4156<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;mso-fareast-language:PT-BR">(51)
9790-9437<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:PT-BR"><a
moz-do-not-send="true"
href="http://www.renovaretelecom.com.br/">Renovare Telecom</a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<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>