<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Ah so<br>
    &lt;condition&gt;<br>
    &lt;/condition&gt;<br>
    <br>
    is essentially an "unconditional condition" ;-)<br>
    <br>
    That is useful... <br>
    <blockquote
cite="mid:CAPf+86VpHXqnnJpCOmq7TNu4g1WBXyO8PpsuStftWYiwLwhVBA@mail.gmail.com"
      type="cite">i checked it myself again and i find the following
      example in the wiki...
      <div><br>
      </div>
      <div>
        <pre style="padding:1em;border:1px dashed rgb(47,111,171);background-color:rgb(249,249,249);line-height:1.1em"> &lt;extension name="9191"&gt;
   &lt;condition field="destination_number" expression="^9191$"/&gt;
   &lt;condition field="${sip_authorized}" expression="true"&gt;
     &lt;anti-action application="reject" data="407"/&gt;
   &lt;/condition&gt;

   &lt;condition&gt;
     &lt;action application="playback" data="/tmp/itworked.wav"/&gt;
   &lt;/condition&gt;
 &lt;/extension&gt;</pre>
        <div>i hope this helps..</div>
        <br>
        <div class="gmail_quote">On Wed, Jun 13, 2012 at 2:31 PM,
          huseyin kalyoncu <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:hkalyoncu@gmail.com"
              target="_blank">hkalyoncu@gmail.com</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">yes action
            statements must be inside condition tags. i thought you
            wrote them in condition in your first mail..
            <div><br>
            </div>
            <div>for the expression=true ; i not sure you can do that
              but there is an example usage together with regex in the
              wiki. </div>
            <div>again check the link i sent before..</div>
            <span class="HOEnZb"><font color="#888888">
                <div><br>
                </div>
                <div>huseyin</div>
              </font></span>
            <div class="HOEnZb">
              <div class="h5">
                <div> </div>
                <div>
                  <div> <br>
                    <br>
                    <div class="gmail_quote">
                      On Wed, Jun 13, 2012 at 2:00 PM, Alex <span
                        dir="ltr">&lt;<a moz-do-not-send="true"
                          href="mailto:alex@thewinelake.com"
                          target="_blank">alex@thewinelake.com</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000"> 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>
                                  &lt;condition field="${ani}"
                          expression="^(\d+)$" break="never" &gt;
                          <div><br>
                                    &lt;action inline="true"
                            application="set" data="testvarA=hello"/&gt;<br>
                                    &lt;action inline="true"
                            application="set" data="testvarB=hello"/&gt;<br>
                          </div>
                                  &lt;/condition&gt;<br>
                                 &lt;condition field="${testvarA}"
                          expression="^$" break="never" /&gt;<br>
                                  &lt;condition field="${testvarB}"
                          expression="^$" break="never"&gt;
                          <div><br>
                                            &lt;action application="log"
                            data="WARNING TestVarsA and B are both
                            empty"/&gt;<br>
                                            &lt;anti-action
                            application="log" data="WARNING TestVarsA
                            and B are NOT both empty"/&gt;<br>
                                   &lt;/condition&gt;<br>
                            <br>
                            <br>
                          </div>
                          Then it works. (Comparing ani to any number of
                          digits).<br>
                          What I really want is something like
                          &lt;condition expression="true"&gt;
                          <div>
                            <div><br>
                              <br>
                              <blockquote type="cite"> Mmm. Strangely
                                enough, I stumbled on that just after
                                posting, but it still doesn't work<br>
                                <br>
                                        &lt;action inline="true"
                                application="set"
                                data="testvarA=hello"/&gt;<br>
                                        &lt;action inline="true"
                                application="set"
                                data="testvarB=hello"/&gt;<br>
                                       &lt;condition field="${testvarA}"
                                expression="^$" /&gt;<br>
                                        &lt;condition
                                field="${testvarB}" expression="^$" &gt;<br>
                                                &lt;action
                                application="log" data="WARNING
                                TestVarsA and B are both empty"/&gt;<br>
                                                &lt;anti-action
                                application="log" data="WARNING
                                TestVarsA and B are NOT both empty"/&gt;<br>
                                       &lt;/condition&gt;<br>
                                <br>
                                Result: "TestVarsA and B are both empty"<br>
                                <br>
                                <blockquote type="cite">hello alex,
                                  <div><br>
                                    <div>you must set testvarA and
                                      testvarB as inline</div>
                                    <div><br>
                                    </div>
                                    <div>check this  <a
                                        moz-do-not-send="true"
                                        href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions"
                                        target="_blank">http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions</a></div>
                                    <div><br>
                                    </div>
                                    <div>huseyin</div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                      <br>
                                      <div class="gmail_quote"> On Wed,
                                        Jun 13, 2012 at 1:14 PM, Alex
                                        Lake <span dir="ltr">&lt;<a
                                            moz-do-not-send="true"
                                            href="mailto:alex@thewinelake.com"
                                            target="_blank">alex@thewinelake.com</a>&gt;</span>
                                        wrote:<br>
                                        <blockquote class="gmail_quote"
                                          style="margin:0 0 0
                                          .8ex;border-left:1px #ccc
                                          solid;padding-left:1ex">
                                          <div>I've been struggling a
                                            bit with conditions. In
                                            particular the "break"<br>
                                            attribute, which I couldn't
                                            really find any
                                            documentation on.<br>
                                            <br>
                                          </div>
                                          &lt;action application="set"
                                          data="testvarA=hello/&gt;<br>
                                          &lt;action application="set"
                                          data="testvarB=hello/&gt;<br>
                                          &lt;condition
                                          field="${testvarA}"
                                          expression="^$" /&gt;<br>
                                          &lt;condition
                                          field="${testvarB}"
                                          expression="^$" &gt;<br>
                                             &lt;action
                                          application="log"
                                          data="WARNING TestVarsA and B
                                          are both<br>
                                          empty"/&gt;<br>
                                             &lt;anti-action
                                          application="log"
                                          data="WARNING TestVarsA and B
                                          are NOT<br>
                                          both empty"/&gt;<br>
                                          &lt;/condition&gt;<br>
                                          <br>
                                          The above gives "TestVarsA and
                                          B are both empty" which I
                                          don't understand!<br>
                                          <div>
                                            <div><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="dp0095"&gt;<br>
                                              &lt;extension
                                              name="Outbound_call"&gt;<br>
                                                  if
                                              (${default_ani_prefix} ==
                                              "" and sip_auth_username
                                              == "") {<br>
                                              &lt;action
                                              application="log"
                                              data="WARNING
                                              default_ani_prefix and<br>
                                              sip_auth_username are not
                                              set (A)"/&gt;<br>
                                              &lt;action
                                              application="set"
                                              data="default_ani_prefix=${tenant_id}${b_ext}1"/&gt;<br>
                                                  }<br>
                                                  if
                                              (${default_ani_prefix} ==
                                              "") {<br>
                                              &lt;action
                                              application="log"
                                              data="WARNING
                                              default_ani_prefix is not
                                              set (B)"/&gt;<br>
                                              &lt;action
                                              application="set"
                                              data="ani_prefix=${sip_auth_username}0"/&gt;<br>
                                                  } else {<br>
                                              &lt;action
                                              application="set"
                                              data="ani_prefix=${default_ani_prefix}"/&gt;<br>
                                                  }<br>
                                                  if
                                              ($destination_number ==
                                              "^(\d{8}.*)") {<br>
                                              &lt;action
                                              application="bridge"<br>
data="[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
                                                moz-do-not-send="true"
                                                href="mailto:1@193.105.54.10"
                                                target="_blank">1@193.105.54.10</a>"/&gt;<br>
                                                  }<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 moz-do-not-send="true"
href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
                                              <a moz-do-not-send="true"
href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
                                              <br>
                                              FreeSWITCH-powered IP PBX:
                                              The CudaTel Communication
                                              Server<br>
                                              <a moz-do-not-send="true"
href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
                                              <br>
                                              Official FreeSWITCH Sites<br>
                                              <a moz-do-not-send="true"
href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
                                              <a moz-do-not-send="true"
href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
                                              <a moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
                                              <a moz-do-not-send="true"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                                                target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                                              UNSUBSCRIBE:<a
                                                moz-do-not-send="true"
                                                href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                                                target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                                              <a moz-do-not-send="true"
href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
                                            </div>
                                          </div>
                                        </blockquote>
                                      </div>
                                      <br>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                  <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a moz-do-not-send="true" href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                  <p color="#000000" align="left">No
                                    virus found in this message.<br>
                                    Checked by AVG - <a
                                      moz-do-not-send="true"
                                      href="http://www.avg.com"
                                      target="_blank">www.avg.com</a><br>
                                    Version: 2012.0.2177 / Virus
                                    Database: 2433/5065 - Release Date:
                                    06/12/12</p>
                                </blockquote>
                                <br>
                                <br>
                                <fieldset></fieldset>
                                <br>
                                <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a moz-do-not-send="true" href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                                <br>
                                <fieldset></fieldset>
                                <br>
                                <p color="#000000" align="left">No virus
                                  found in this message.<br>
                                  Checked by AVG - <a
                                    moz-do-not-send="true"
                                    href="http://www.avg.com"
                                    target="_blank">www.avg.com</a><br>
                                  Version: 2012.0.2177 / Virus Database:
                                  2433/5065 - Release Date: 06/12/12</p>
                              </blockquote>
                              <br>
                            </div>
                          </div>
                        </div>
                        <br>
_________________________________________________________________________<br>
                        Professional FreeSWITCH Consulting Services:<br>
                        <a moz-do-not-send="true"
                          href="mailto:consulting@freeswitch.org"
                          target="_blank">consulting@freeswitch.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://www.freeswitchsolutions.com"
                          target="_blank">http://www.freeswitchsolutions.com</a><br>
                        <br>
                        FreeSWITCH-powered IP PBX: The CudaTel
                        Communication Server<br>
                        <a moz-do-not-send="true"
                          href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
                        <br>
                        Official FreeSWITCH Sites<br>
                        <a moz-do-not-send="true"
                          href="http://www.freeswitch.org"
                          target="_blank">http://www.freeswitch.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://wiki.freeswitch.org"
                          target="_blank">http://wiki.freeswitch.org</a><br>
                        <a moz-do-not-send="true"
                          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 moz-do-not-send="true"
                          href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                          target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                          target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                        UNSUBSCRIBE:<a moz-do-not-send="true"
                          href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                          target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                        <a moz-do-not-send="true"
                          href="http://www.freeswitch.org"
                          target="_blank">http://www.freeswitch.org</a><br>
                        <br>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <p class="" avgcert""="" color="#000000" align="left">No virus
        found in this message.<br>
        Checked by AVG - <a moz-do-not-send="true"
          href="http://www.avg.com">www.avg.com</a><br>
        Version: 2012.0.2177 / Virus Database: 2433/5065 - Release Date:
        06/12/12</p>
    </blockquote>
    <br>
  </body>
</html>