<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I was about to answer and say  &lt;action&gt; tags must be inside &lt;condition&gt; tags.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I think you can in fact remove you break=”never” everywhere except:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${testvarA}&quot; expression=&quot;^$&quot; break=&quot;never&quot; /&gt;<br><br><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Your first “condition” can just be “&lt;condition&gt;”  which is always true.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>And </span> &lt;condition field=&quot;${testvarB}&quot; expression=&quot;^$&quot; break=&quot;never&quot;&gt; <o:p></o:p></p><p class=MsoNormal>doesn’t need a break=”never” as it has &lt;action&gt; and &lt;anti-action&gt;s.<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hope that helps (and is correct!)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sean<o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>On Behalf Of </b>Alex<br><b>Sent:</b> Wednesday, June 13, 2012 7:00 AM<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] Conditions<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>OK... I think there's a fundamental misunderstanding about what code actually gets executed.<br><br>The setting never happened in my example. If I change it to:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${ani}&quot; expression=&quot;^(\d+)$&quot; break=&quot;never&quot; &gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;testvarA=hello&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;testvarB=hello&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${testvarA}&quot; expression=&quot;^$&quot; break=&quot;never&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${testvarB}&quot; expression=&quot;^$&quot; break=&quot;never&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are both empty&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anti-action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are NOT both empty&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br><br><br>Then it works. (Comparing ani to any number of digits).<br>What I really want is something like &lt;condition expression=&quot;true&quot;&gt;<br><br><br><o:p></o:p></p><p class=MsoNormal>Mmm. Strangely enough, I stumbled on that just after posting, but it still doesn't work<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;testvarA=hello&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action inline=&quot;true&quot; application=&quot;set&quot; data=&quot;testvarB=hello&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${testvarA}&quot; expression=&quot;^$&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${testvarB}&quot; expression=&quot;^$&quot; &gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are both empty&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anti-action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are NOT both empty&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br><br>Result: &quot;TestVarsA and B are both empty&quot;<br><br><br><o:p></o:p></p><p class=MsoNormal>hello alex, <o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>you must set testvarA and testvarB as inline<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>check this&nbsp; <a href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions">http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>huseyin<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Wed, Jun 13, 2012 at 1:14 PM, Alex Lake &lt;<a href="mailto:alex@thewinelake.com" target="_blank">alex@thewinelake.com</a>&gt; wrote:<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>I've been struggling a bit with conditions. In particular the &quot;break&quot;<br>attribute, which I couldn't really find any documentation on.<o:p></o:p></p></div><p class=MsoNormal>&lt;action application=&quot;set&quot; data=&quot;testvarA=hello/&gt;<br>&lt;action application=&quot;set&quot; data=&quot;testvarB=hello/&gt;<br>&lt;condition field=&quot;${testvarA}&quot; expression=&quot;^$&quot; /&gt;<br>&lt;condition field=&quot;${testvarB}&quot; expression=&quot;^$&quot; &gt;<br>&nbsp; &nbsp;&lt;action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are both<br>empty&quot;/&gt;<br>&nbsp; &nbsp;&lt;anti-action application=&quot;log&quot; data=&quot;WARNING TestVarsA and B are NOT<br>both empty&quot;/&gt;<br>&lt;/condition&gt;<br><br>The above gives &quot;TestVarsA and B are both empty&quot; which I don't understand!<o:p></o:p></p><div><div><p class=MsoNormal><br>I think it would be nice to put some examples in the wiki that translate<br>from the usual way of doing things (perhaps using PHP or JavaScript<br>notation) to the dialplan format.<br><br>For example, I have a requirement that might be expressed like this:<br><br>&lt;context name=&quot;dp0095&quot;&gt;<br>&lt;extension name=&quot;Outbound_call&quot;&gt;<br>&nbsp; &nbsp; if (${default_ani_prefix} == &quot;&quot; and sip_auth_username == &quot;&quot;) {<br>&lt;action application=&quot;log&quot; data=&quot;WARNING default_ani_prefix and<br>sip_auth_username are not set (A)&quot;/&gt;<br>&lt;action application=&quot;set&quot; data=&quot;default_ani_prefix=${tenant_id}${b_ext}1&quot;/&gt;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; if (${default_ani_prefix} == &quot;&quot;) {<br>&lt;action application=&quot;log&quot; data=&quot;WARNING default_ani_prefix is not set (B)&quot;/&gt;<br>&lt;action application=&quot;set&quot; data=&quot;ani_prefix=${sip_auth_username}0&quot;/&gt;<br>&nbsp; &nbsp; } else {<br>&lt;action application=&quot;set&quot; data=&quot;ani_prefix=${default_ani_prefix}&quot;/&gt;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; if ($destination_number == &quot;^(\d{8}.*)&quot;) {<br>&lt;action application=&quot;bridge&quot;<br>data=&quot;[tenant_id=${tenant_id},a_ext=${a_ext},b_ext=${b_ext},origination_callee_id_number=$1,origination_caller_id_number=${ani_prefix}${ani}]sofia/internal/8980000000002$<a href="mailto:1@193.105.54.10">1@193.105.54.10</a>&quot;/&gt;<br>&nbsp; &nbsp; }<br>&lt;/extension&gt;<br>&lt;/context&gt;<br><br>What is the nefarious combination of conditions, breaks, actions and<br>anti-actions required to implement this?<br><br>I'm happy to try and put a newbie-perspective updates into some part of<br>the wiki. Talking of which, maybe it would be good to have more<br>example-based content in the wiki, but put it in a separate section so<br>that it doesn't clutter up the more reference-orientated bits.<br><br>Alex<br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<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" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><o:p></o:p></p></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>_________________________________________________________________________<o:p></o:p></pre><pre>Professional FreeSWITCH Consulting Services:<o:p></o:p></pre><pre><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<o:p></o:p></pre><pre><a href="http://www.cudatel.com">http://www.cudatel.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Official FreeSWITCH Sites<o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.cluecon.com">http://www.cluecon.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Join Us At ClueCon - Aug 7-9, 2012<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-users mailing list<o:p></o:p></pre><pre><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><o:p></o:p></pre><pre>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><p class=MsoNormal><br><br><br><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>No virus found in this message.<br>Checked by AVG - <a href="http://www.avg.com">www.avg.com</a><br>Version: 2012.0.2177 / Virus Database: 2433/5065 - Release Date: 06/12/12<o:p></o:p></p><p class=MsoNormal><br><br><br><br><o:p></o:p></p><pre>_________________________________________________________________________<o:p></o:p></pre><pre>Professional FreeSWITCH Consulting Services:<o:p></o:p></pre><pre><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<o:p></o:p></pre><pre><a href="http://www.cudatel.com">http://www.cudatel.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Official FreeSWITCH Sites<o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://www.cluecon.com">http://www.cluecon.com</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Join Us At ClueCon - Aug 7-9, 2012<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>FreeSWITCH-users mailing list<o:p></o:p></pre><pre><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><o:p></o:p></pre><pre><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><o:p></o:p></pre><pre>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><o:p></o:p></pre><pre><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><o:p></o:p></pre><p class=MsoNormal><br><br><br><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>No virus found in this message.<br>Checked by AVG - <a href="http://www.avg.com">www.avg.com</a><br>Version: 2012.0.2177 / Virus Database: 2433/5065 - Release Date: 06/12/12<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>