<div dir="ltr">i have another rule that strip prefix and insert 1 instead which is work perfect with \1 so i don't think its DB related.<div><br></div><div>the syntax </div><div><br></div><div>do you see something wrong there ?</div><div><br></div><div><div style="color:rgb(248,248,242);background-color:rgb(39,40,34);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div>if (dp_translate(<span style="color:rgb(230,219,116)">"17"</span>, <span style="color:rgb(230,219,116)">"$rU/$rU"</span>)){</div><br><div> </div><div> if (!lb_start(<span style="color:rgb(230,219,116)">"4"</span>,<span style="color:rgb(230,219,116)">"pstn"</span>)) {</div><div> send_reply(<span style="color:rgb(230,219,116)">"503"</span>,<span style="color:rgb(230,219,116)">"No Destination available"</span>)<span style="color:rgb(136,132,111)">;</span></div><div> exit<span style="color:rgb(136,132,111)">; </span></div><div> }</div><div> } </div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 5, 2024 at 2:29 PM Ben Newlin <<a href="mailto:Ben.Newlin@genesys.com">Ben.Newlin@genesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-5137326193636630198">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_-5137326193636630198WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">It looks right to me. The error you get when changing repl_exp to “\1” implies to me that it is causing the dpid to fail to load from the database at all due to some syntax issue. Is you database escaping
or converting the “\” maybe?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">I’d recommend increasing the logging verbosity of opensips and doing a module reload and the test scenario and see what the logs say about why it isn’t matching.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">Ben Newlin</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div id="m_-5137326193636630198mail-editor-reference-message-container">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Users <<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>> on behalf of morris edery <<a href="mailto:morrisedery@gmail.com" target="_blank">morrisedery@gmail.com</a>><br>
<b>Date: </b>Wednesday, June 5, 2024 at 1:46 PM<br>
<b>To: </b>OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br>
<b>Subject: </b>Re: [OpenSIPS-Users] Strip prefix<u></u><u></u></span></p>
</div>
<div>
<div>
<div>
<div>
<table border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
<tbody>
<tr>
<td style="border:1pt solid rgb(182,0,0);background:white;padding:0.75pt">
<p class="MsoNormal"><b><span style="font-size:12pt;font-family:Calibri,sans-serif;color:rgb(182,0,0)"> EXTERNAL EMAIL - Please use caution with links and attachments <u></u><u></u></span></b></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Helvetica"><u></u> <u></u></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12pt;font-family:Helvetica">
<hr size="0" width="100%" align="center">
</span></div>
</div>
<p class="MsoNormal"><span style="font-size:12pt">Yes i change it all <u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<pre><span style="color:black">dpid = 17</span><span style="color:rgb(80,0,80)"><u></u><u></u></span></pre>
<pre><span style="color:black">pr = 0</span><span style="color:rgb(80,0,80)"><u></u><u></u></span></pre>
<pre><span style="color:black">match_op = 1</span><span style="color:rgb(80,0,80)"><u></u><u></u></span></pre>
<pre><span style="color:black">match_exp = ^770555.+</span><u></u><u></u></pre>
<pre><span style="color:black">match_flags = 0</span><u></u><u></u></pre>
<pre><span style="color:black">subst_exp = ^770555(.+)</span><u></u><u></u></pre>
<pre><span style="color:black">repl_exp = \1</span><u></u><u></u></pre>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">without \1 im able to complete the call but prefix still there and when i add the \1 on repl_exp i get the error<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">On Wed, Jun 5, 2024 at 1:13</span><span style="font-size:12pt;font-family:Arial,sans-serif"> </span><span style="font-size:12pt">PM Ben Newlin <<a href="mailto:Ben.Newlin@genesys.com" target="_blank">Ben.Newlin@genesys.com</a>>
wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Did you make all the changes I suggested or only changed the repl_exp? I detailed changes needed to the match_exp and subst_exp as well.</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">Ben Newlin</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<div id="m_-5137326193636630198m_3886724202306823975m_3816089330321388602mail-editor-reference-message-container">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Users <<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>> on behalf of morris edery <<a href="mailto:morrisedery@gmail.com" target="_blank">morrisedery@gmail.com</a>><br>
<b>Date: </b>Wednesday, June 5, 2024 at 12:44 PM<br>
<b>To: </b>OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br>
<b>Subject: </b>Re: [OpenSIPS-Users] Strip prefix</span><span style="font-size:12pt"><u></u><u></u></span></p>
</div>
<div>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td style="border:1pt solid rgb(182,0,0);background:white;padding:0.75pt">
<p class="MsoNormal"><b><span style="font-size:12pt;font-family:Calibri,sans-serif;color:rgb(182,0,0)"> EXTERNAL EMAIL - Please use caution with links and attachments </span></b><span style="font-size:12pt"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Helvetica"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12pt;font-family:Helvetica">
<hr size="0" width="100%" align="center">
</span></div>
</div>
<p class="MsoNormal"><span style="font-size:12pt">Still no luck. <u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">when i add </span><span style="font-size:12pt;font-family:"Courier New";color:black">repl_exp = \1</span><span style="font-size:12pt"><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">i get this<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: input is 7705557867129454<br>
Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: no information available for dpid 17<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">DBG:sl:sl_reply_error: error text is Bad URI (475/SL)<u></u><u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">On Wed, Jun 5, 2024 at 10:04</span><span style="font-size:12pt;font-family:Arial,sans-serif"> </span><span style="font-size:12pt">AM Ben Newlin
<<a href="mailto:Ben.Newlin@genesys.com" target="_blank">Ben.Newlin@genesys.com</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">There’s a few issues.</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix.</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left
for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it
in the replace.</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Try this:</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<pre><span style="color:black">dpid = 17</span><u></u><u></u></pre>
<pre><span style="color:black">pr = 0</span><u></u><u></u></pre>
<pre><span style="color:black">match_op = 1</span><u></u><u></u></pre>
<pre><span style="color:black">match_exp = ^770555.+</span><u></u><u></u></pre>
<pre><span style="color:black">match_flags = 0</span><u></u><u></u></pre>
<pre><span style="color:black">subst_exp = ^770555(.+)</span><u></u><u></u></pre>
<pre><span style="color:black">repl_exp = \1</span><u></u><u></u></pre>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">Ben Newlin</span><span style="font-size:12pt"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<div id="m_-5137326193636630198m_3886724202306823975m_3816089330321388602m_7266489831648704288mail-editor-reference-message-container">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Users <<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.opensips.org</a>> on behalf of morris edery <<a href="mailto:morrisedery@gmail.com" target="_blank">morrisedery@gmail.com</a>><br>
<b>Date: </b>Wednesday, June 5, 2024 at 12:48 AM<br>
<b>To: </b>OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br>
<b>Subject: </b>[OpenSIPS-Users] Strip prefix</span><span style="font-size:12pt"><u></u><u></u></span></p>
</div>
<div>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td style="border:1pt solid rgb(182,0,0);background:white;padding:0.75pt">
<p class="MsoNormal"><b><span style="font-size:12pt;font-family:Calibri,sans-serif;color:rgb(182,0,0)"> EXTERNAL EMAIL - Please use caution with links and attachments </span></b><span style="font-size:12pt"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Helvetica"> </span><span style="font-size:12pt"><u></u><u></u></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12pt;font-family:Helvetica">
<hr size="0" width="100%" align="center">
</span></div>
</div>
<p class="MsoNormal"><span style="font-size:12pt">Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong
? below <u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">opensips 2.4.8<u></u><u></u></span></p>
<div>
<pre><span style="color:black">dpid = 17</span><u></u><u></u></pre>
<pre><span style="color:black">pr = 0</span><u></u><u></u></pre>
<pre><span style="color:black">match_op = 1</span><u></u><u></u></pre>
<pre><span style="color:black">match_exp = ^770555+</span><u></u><u></u></pre>
<pre><span style="color:black">match_flags = 0</span><u></u><u></u></pre>
<pre><span style="color:black">subst_exp = ^(*770555*)(.+)</span><u></u><u></u></pre>
<pre><span style="color:black">repl_exp = \2</span><u></u><u></u></pre>
<pre><span style="color:black"> </span><u></u><u></u></pre>
<pre><span style="color:black">need to remove 770555</span><u></u><u></u></pre>
<pre><span style="color:black">on cfg file </span><u></u><u></u></pre>
<div>
<div>
<pre style="line-height:14.25pt;background:rgb(39,40,34)"><span style="font-size:10.5pt;font-family:Consolas;color:rgb(248,248,242)"> if (dp_translate(</span><span style="font-size:10.5pt;font-family:Consolas;color:rgb(230,219,116)">"17"</span><span style="font-size:10.5pt;font-family:Consolas;color:rgb(248,248,242)">, </span><span style="font-size:10.5pt;font-family:Consolas;color:rgb(230,219,116)">"$rU/$rU"</span><span style="font-size:10.5pt;font-family:Consolas;color:rgb(248,248,242)">)){ } </span><u></u><u></u></pre>
</div>
</div>
<pre><span style="color:black"> </span><u></u><u></u></pre>
<pre><span style="color:black"> </span><u></u><u></u></pre>
<pre><span style="color:black">Thanks</span><u></u><u></u></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12pt">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">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><u></u><u></u></span></p>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:12pt">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">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><u></u><u></u></span></p>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></blockquote></div>