July 2017
Intermediate to advanced
434 pages
12h 59m
English
If the pattern matches, the phrase macro will find in registers the parts of input between the pattern parentheses.
It is exactly the same as with the "expression" patterns in dialplan: let's say the input pattern is "^\d(\d{3})(\d)(.*)$"; if the input is "1234567ciao", the phrase macro will then find "234" in $1, "5" in $2, and "67ciao" in $3.
Registers enable a single macro to be used to read variable contents to the caller. Let's look at how a macro can be used to read the number of messages (new or saved) in the caller's mailbox:
<macro name="voicemail_message_count"> <input pattern="^(1):(.*)$" break_on_match="true"> <match> <action function="play-file" data="voicemail/vm-you_have.wav"/> <action function="say" ...
Read now
Unlock full access