ZVON > References > VoiceXML Reference
Element:elseif
Attributes: | cond |
Parents: | if |
Description:

Go to Standard

Examples:


<if cond="city == 'LA'">
     <assign name="city" expr="'Los Angeles'"/>
     <elseif cond="city == 'Philly'"/>
     <assign name="city" expr="'Philadelphia'"/>
     <elseif cond="city =='Constantinople'"/>
     <assign name="city" expr="'Istanbul'"/>
</if>
<assign name="var1" expr="var1 + 1"/>
<if cond="i > 1">
     <assign name="i" expr="i-1"/>
</if>


<form name="transfer">
     <var name="mydur" expr="0"/>
     <block>
          <audio src="chopin12.wav"/>
     </block>
     <transfer name="mycall" dest="phone://18005551234" connecttimeout="30s" bridge="true">
          <filled>
               <assign name="mydur" expr="mycall$.duration"/>
               <if cond="mycall == 'busy'">
                    <prompt> Sorry, our customer support team is busy serving other customers. Please try again later. </prompt>
                    <elseif cond="mycall == 'noanswer'"/>
                    <prompt> Sorry, our customer support team's normal hours are 9 am to 7 pm Monday through Saturday. </prompt>
               </if>
          </filled>
     </transfer>
     <block>
          <submit namelist="mycall mydur" next="/cgi-bin/report"/>
     </block>
</form>


<if cond="total > 1000">
     <prompt>This is way too much to spend.</prompt>
     <throw event="com.xyzcorp.acct.toomuchspent"/>
</if>
<if cond="amount < 29.95">
     <assign name="x" expr="amount"/>
     <else/>
     <assign name="x" expr="29.95"/>
</if>
<if cond="flavor == 'vanilla'">
     <assign name="flavor_code" expr="'v'"/>
     <elseif cond="flavor == 'chocolate'"/>
     <assign name="flavor_code" expr="'h'"/>
     <elseif cond="flavor == 'strawberry'"/>
     <assign name="flavor_code" expr="'b'"/>
     <else/>
     <assign name="flavor_code" expr="'?'"/>
</if>