<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">try this:</div><div class=""><br class=""></div><div class="">&lt;extension name="8 prefix" continue="true"&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;condition field="destination_number" expression="^8(0\d{9,15})"&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;action application="set" data="dst_number=$1" inline="true"/&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;condition field="${db(exists/${sip_from_user}/cli8}" expression="true"&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;action application="set" data="destination_number=${dst_number}" inline="true"/&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                        </span>&lt;action application="log" data="INFO ${dst_number} ${destination_number}"/&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/condition&gt;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/condition&gt;</div><div class="">&lt;/extension&gt;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">"destination_number" is a FreeSWITCH variable; it shouldn't be changed.</div></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Srigo</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 24, 2017, at 7:14 PM, Rick Jarvis &lt;<a href="mailto:rick@magicmail.mooo.com" class="">rick@magicmail.mooo.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Is there a way of referencing captured regex in the first condition of nested conditions?<div class=""><br class=""></div><div class="">EG If I have:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 188, 38); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&lt;extension</span><span style="font-variant-ligatures: no-common-ligatures" class=""> name="8 prefix" continue="true"</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&gt;</span></div><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 188, 38); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&lt;condition</span><span style="font-variant-ligatures: no-common-ligatures" class=""> field="destination_number" expression="^8(0\d{9,15})"/</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&gt;</span></div><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 188, 38); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&lt;condition</span><span style="font-variant-ligatures: no-common-ligatures" class=""> field="${db(exists/${sip_from_user}/cli8}" expression="true"</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&gt;</span></div><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 188, 38); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&lt;action</span><span style="font-variant-ligatures: no-common-ligatures" class=""> application="set" data="destination_number=$1" inline="true"/</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc8" class="">&gt;</span></div><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 187, 200); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">&lt;/condition&gt;</span></div><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(52, 187, 200); background-color: rgba(0, 0, 0, 0.933333);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #f4f4f4" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">&lt;/extension&gt;</span></div>
<br class=""></div><div class="">At the moment this doesn’t capture the number, and just gives me an actual ‘$1’. I guess I could rearrange the conditions, but I don’t want to break all my logic really…</div></div>_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></blockquote></div><br class=""></body></html>