Conditions (and "patterns")
Conditions are, broadly speaking, the building blocks for the "patterns" we talked about before in this chapter.
Conditions are contained by "extension". Conditions contain "action". Conditions have the following generic appearance:
<extension name="this_extension"> <condition field="destination_number" expression=""^1234$"> <!-- action --> <!-- action --> </condition> </extension>
Inside a dialplan "context" (that is, it would be inside "default" or "public" context in demo configuration) we have a opening "extension" tag, then conditions begin. Between the opening and closing condition tag, we find actions.
In this case the condition will check if the "destination_number" call variable is matched by the "expression" (regular expression, or regex) "^1234$". If the number called was actually 1234, then the action(s) contained between this one condition opening and closing tags will be added to the TODO...