<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>I use a:</div><div><br></div><div><action application = "log" data ="${curl_response_data}"/></div><div><br></div><div>to see in the xml cdr the curl_response_data variable.</div><div><br></div><div>Exactly: "<span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">+</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; color: rgb(128, 0, 0); background-color: rgb(238, 238, 238);">34987654321</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; color: rgb(128, 0, 0); background-color: rgb(238, 238, 238);">971234567</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; color: rgb(128, 0, 0); background-color: rgb(238, 238, 238);">000</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; color: rgb(128, 0, 0); background-color: rgb(238, 238, 238);">00001</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">CUB281281</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">CUB301993</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">,</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);">OP024000"</span></div><div><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; font-size: 13px; padding: 0px; border: 0px; background-color: rgb(238, 238, 238);"><br></span></div><div><font face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif"><span style="font-size: 13px;">The curl request is executed in the same dialplan, t</span></font><span style="font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;">his is the first action.</span></div><br><div><hr id="stopSpelling">From: steveayre@gmail.com<br>Date: Fri, 16 Oct 2015 21:35:24 +0100<br>To: freeswitch-users@lists.freeswitch.org<br>Subject: Re: [Freeswitch-users] Freeswitch - Regular Expression in Condition<br><br><div dir="ltr">Nevermind, it won't match on the 6 digit part and will on the 4-17 part.<div><br></div><div>Your regex is fine and matches that string. So the problem is likely elsewhere. How is curl_response_data set? Is it set before the hunting phase? If you're fetching it during the execution of the dialplan then it won't work, you'll need to transfer to trigger a new dialplan hunt.</div><div><br></div><div>You can see what the string it's comparing to the regex is in the DEBUG-level logs, where you'll see it evaluating the extensions/conditions in the dialplan.</div></div><div class="ecxgmail_extra"><br><div class="ecxgmail_quote">On 16 October 2015 at 21:31, Steven Ayre <span dir="ltr"><<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr">971234567 is 9 digits but you're matching 10-23 digits in that section.<br></div><div class="ecxgmail_extra"><br><div class="ecxgmail_quote"><div><div class="h5">On 15 October 2015 at 17:54, Ximo Peral <span dir="ltr"><<a href="mailto:ximop_22@hotmail.com" target="_blank">ximop_22@hotmail.com</a>></span> wrote:<br></div></div><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">
<div><div dir="ltr"><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);">I have this condition on a dialplan:</p><pre style="padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238);"><code style="padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;"><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(128,0,0);"><condition</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">field</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"${curl_response_data}"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">expression</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{4,17}),(\d{3,5}),(\d{3,5}),(NP\d{3}|RG\d{4,8}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3}|TLSIOS),?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?$"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">break</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"on-true"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">></span><span style="padding:0px;border:0px;color:rgb(0,0,0);">
</span><span style="padding:0px;border:0px;color:rgb(128,0,0);"><action</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">application</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"set"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">inline</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"true"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">data</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"auto_hunt=true"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">/></span><span style="padding:0px;border:0px;color:rgb(0,0,0);">
</span><span style="padding:0px;border:0px;color:rgb(128,0,0);"><action</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">application</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"transfer"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">data</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"${num_dest} XML routing.Saliente"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">/></span></code></pre><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);"></p><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);">And this curl response:</p><pre style="padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238);"><code style="padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;"><span style="padding:0px;border:0px;color:rgb(0,0,0);">+</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">34987654321</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">971234567</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">000</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">00001</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">CUB281281</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">CUB301993</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">,</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">OP024000</span></code></pre><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);">But I do not get the transfer, the regular expression is not working.</p><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);">I tried this and if it works:</p><pre style="padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238);"><code style="padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;"><span style="padding:0px;border:0px;color:rgb(128,0,0);"><condition</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">field</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"${curl_response_data}"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">expression</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5})(,(\w*))*$"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">break</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"on-true"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">></span><span style="padding:0px;border:0px;color:rgb(0,0,0);">
</span><span style="padding:0px;border:0px;color:rgb(128,0,0);"><action</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">application</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"set"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">inline</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"true"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">data</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"auto_hunt=true"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">/></span><span style="padding:0px;border:0px;color:rgb(0,0,0);">
</span><span style="padding:0px;border:0px;color:rgb(128,0,0);"><action</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">application</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"transfer"</span><span style="padding:0px;border:0px;color:rgb(0,0,0);"> </span><span style="padding:0px;border:0px;color:rgb(255,0,0);">data</span><span style="padding:0px;border:0px;color:rgb(0,0,0);">=</span><span style="padding:0px;border:0px;color:rgb(0,0,255);">"${num_dest} XML routing.Saliente"</span><span style="padding:0px;border:0px;color:rgb(128,0,0);">/></span></code></pre><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);"></p><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);">The problem is from the fourth comma</p><p style="border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;background-color:rgb(255,255,255);"><br></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;">Desperate, I tried it with this conditions and does not work!</span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><br></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><i><condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5}),CUB281281,CUB301993,OP024000$" break="on-true"></i></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><br></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;">and</span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><br></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><i><condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5}),(CUB281281),(CUB301993),(OP024000)$" break="on-true"></i></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;"><br></span></font></p><p style="border:0px;clear:both;background-color:rgb(255,255,255);"><font color="#222222" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:15px;line-height:19.5px;">Any ideas??</span></font></p>                                            </div></div>
<br></div></div><span>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></span></blockquote></div><br></div>
</blockquote></div><br></div>
<br>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org</div>                                            </div></body>
</html>