<div dir="ltr">I tried to remove the () on the first regex : same result (and problem with ARRAY result)<div>I didn&#39;t try to remove them on the other regex, as I want to catch the 9 digits and set a variable</div><div><br></div><div>I also tried the syntax <span style="font-size:12.8px">&lt;regex field=&quot;sip_req_user&quot; expression=&quot;^0(\d{9})$&quot;/&gt; (without the ${}), but in this case, the variable seems empty (which is not the case as seen with the info app)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I&#39;m just trying to :</span></div><div><span style="font-size:12.8px">- Call an extension to check the destination number</span></div><div><span style="font-size:12.8px">- Normalise the dest number and modify it (or set a custom variable)</span></div><div><span style="font-size:12.8px">- Return to the main dialplan to route the call</span></div><div><span style="font-size:12.8px"><br></span></div><div>I still stuck on that. Does someone have any advice or a working example ?</div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><p><font face="verdana, sans-serif"><b><span lang="EN-US"><span></span><span></span>Dominique
Jeannerod</span></b><span lang="EN-US"></span></font></p>

<p><span lang="EN-US"><i><font face="verdana, sans-serif">Interact-iv.com</font></i></span></p><font face="verdana, sans-serif">Mobile: +33 698 778 763<br><font size="1"><br></font></font><div><font face="verdana, sans-serif"><font size="1">Headquarter : 600 rue Felix Trombe – tecnosud – 66100 Perpignan - France</font><br><font size="1">France : 0826 10 23 21 (0,15€/mn) International +33 (0)4 20 10 45 45</font></font></div></div></div></div></div>
<br><div class="gmail_quote">2015-09-29 18:04 GMT+02:00 Sergey Safarov <span dir="ltr">&lt;<a href="mailto:s.safarov@gmail.com" target="_blank">s.safarov@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Try remove &quot;()&quot; symbols in first condition or all regex.</p>
<br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 29, 2015, 18:26 Dominique Jeannerod &lt;<a href="mailto:dominique.jeannerod@interact-iv.com" target="_blank">dominique.jeannerod@interact-iv.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>i&#39;m trying to call an extension, to normalize the called number to FR format, needed by an external operator SIP trunk, using the sip_req_user variable, and set a variable iv_dest_number to bridge the call using the normalized dest number.</div><div>I&#39;d like to use extensions to split a big dialplan, and make my configuration more readable.</div><div><br></div><div>I&#39;m quite confused by the way the regex is returning the $1 variable inside this extension : ARRAY</div><div>This same code is working without problem inside the main dialplan.</div><div><br></div><div>What am i doing wrong ?</div><div>What would be the best way to do that ?</div><div><br></div><div>Thanks with anticipation for any advice</div><div><br></div><div>Extension :</div><div>    &lt;extension name=&quot;N_called_FR&quot;&gt;<br></div><div><div>        &lt;!-- All numeric and non empty called number                    --&gt;</div><div>        &lt;condition field=&quot;${sip_req_user}&quot; expression=&quot;^\+?(\d+)$&quot; break=&quot;on-true&quot;&gt;</div><div>            &lt;condition regex=&quot;any&quot;&gt;</div><div>                &lt;!-- Called number in FR format                          --&gt;</div><div>                &lt;regex field=&quot;${sip_req_user}&quot; expression=&quot;^0(\d{9})$&quot;/&gt;<br></div><div>                &lt;regex field=&quot;${sip_req_user}&quot; expression=&quot;^33(\d{9})$&quot;/&gt;</div><div>                &lt;regex field=&quot;${sip_req_user}&quot; expression=&quot;^\+33(\d{9})$&quot;/&gt;</div><div>                &lt;regex field=&quot;${sip_req_user}&quot; expression=&quot;^0033(\d{9})$&quot;/&gt;</div><div><br></div><div>                &lt;action application=&quot;set&quot; data=&quot;iv_dest_number=0$1&quot;/&gt;<br></div><div>            &lt;/condition&gt;<br></div><div>        &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div></div><div><br></div><div>Freeswitch log :</div><div><div><div>EXECUTE sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> execute_extension(N_called_FR XML iv_common_N_called)</div><div>2015-09-29 12:09:34.644195 [INFO] mod_dialplan_xml.c:635 Processing Test &lt;33123456789&gt;-&gt;N_called_FR in context iv_common_N_called</div><div>Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> parsing [iv_common_N_called-&gt;N_called_FR] continue=false</div><div>|--- Dialplan: Processing recursive conditions level:1 [N_called_FR_recur_1] require-nested=TRUE</div><div>|--- Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> Regex (FAIL) [N_called_FR_recur_1] ${sip_req_user}(0698778763) =~ /^([1-9]\d{8})$/ match=any</div><div>|--- Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> Regex (PASS) [N_called_FR_recur_1] ${sip_req_user}(0698778763) =~ /^0(\d{9})$/ match=any</div><div>|--- Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> Action log(INFO N_called_FR : FR Called number)</div><div>|--- Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> Action set(iv_dest_number=0RRAY::04)</div><div>Dialplan: sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> Regex (PASS) [N_called_FR] ${sip_req_user}(0698778763) =~ /^\+?(\d+)$/ break=on-true</div><div>2015-09-29 12:09:34.644195 [NOTICE] switch_core_session.c:2866 Execute log(INFO N_called_FR : FR Called number)</div><div>EXECUTE sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> log(INFO N_called_FR : FR Called number)</div><div>2015-09-29 12:09:34.644195 [INFO] mod_dptools.c:1670 N_called_FR : FR Called number</div><div>2015-09-29 12:09:34.644195 [NOTICE] switch_core_session.c:2866 Execute set(iv_dest_number=0RRAY::04)</div><div>EXECUTE sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> set(iv_dest_number=0RRAY::04)</div><div>2015-09-29 12:09:34.644195 [DEBUG] mod_dptools.c:1477 sofia/external_trk/<a href="mailto:33123456789@10.199.16.172" target="_blank">33123456789@10.199.16.172</a> SET [iv_dest_number]=[0RRAY::04]</div></div></div><div><br></div><div>D. Jeannerod</div></div>
_________________________________________________________________________<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></blockquote></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">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">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></blockquote></div><br></div>