FS-7648 add condition testing for regex all and xor cases

This commit is contained in:
Brian West 2015-06-16 10:46:15 -05:00
parent 30b83daaab
commit 4389886f05
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<extension name="Logical AND" >
<condition field="destination_number" expression="^6030$"/>
<condition regex="all"> <!-- ALL -->
<!-- ALL CAN NOT MATCH EVER -->
<regex time-of-day="08:00:00-12:00:00"/> <!-- CAN'T TIME TRAVEL -->
<regex time-of-day="23:00:00-24:00:00"/> <!-- CAN'T BE IN TWO TIMES AT ONCE -->
<regex wday="3"/>
<action application="log" data="INFO At least one of the conditions matched!"/>
<action application="playback" data="ivr/ivr-yes_we_have_no_bananas.wav"/>
<anti-action application="log" data="WARNING None of the conditions matched!"/>
<anti-action application="playback" data="ivr/ivr-no_no_no.wav"/>
</condition>
</extension>
<extension name="Logical AND 2" >
<condition field="destination_number" expression="^6031$"/>
<condition regex="all">
<regex field="caller_id_name" expression="testuser"/>
<regex field="caller_id_number" expression="^1000$"/>
<regex field="destination_number" expression="^6031$"/>
<action application="log" data="INFO At least one of the conditions matched!"/>
<anti-action application="log" data="WARNING None of the conditions matched!"/>
<action application="playback" data="ivr/ivr-yes_we_have_no_bananas.wav"/>
<anti-action application="playback" data="ivr/ivr-no_no_no.wav"/>
</condition>
</extension>

View File

@ -0,0 +1,24 @@
<extension name="Logical XOR" >
<condition field="destination_number" expression="^6040$"/>
<condition regex="xor">
<regex time-of-day="08:00:00-19:00:00"/>
<regex wday="4"/>
<action application="log" data="INFO At least one of the conditions matched!"/>
<action application="playback" data="ivr/ivr-yes_we_have_no_bananas.wav"/>
<anti-action application="log" data="WARNING None of the conditions matched!"/>
<anti-action application="playback" data="ivr/ivr-no_no_no.wav"/>
</condition>
</extension>
<extension name="Logical XOR 2" >
<condition field="destination_number" expression="^6041$"/>
<condition regex="xor">
<regex field="caller_id_name" expression="testuser"/>
<regex field="caller_id_number" expression="^1000$"/>
<regex field="destination_number" expression="^6041$"/>
<action application="log" data="INFO At least one of the conditions matched!"/>
<anti-action application="log" data="WARNING None of the conditions matched!"/>
<action application="playback" data="ivr/ivr-yes_we_have_no_bananas.wav"/>
<anti-action application="playback" data="ivr/ivr-no_no_no.wav"/>
</condition>
</extension>