mod_dptools: read
About
Read DTMF (touch-tone) digits.
Click here to expand Table of Contents
- 1 Usage
- 2 Parameters
- 3 Examples
- 4 See Also
Usage
read <min> <max> <sound file> <variable name> <timeout> <terminators>
Parameters
- min = Minimum number of digits to fetch.
- max = Maximum number of digits to fetch.
- sound file = Sound file to play before digits are fetched.
- variable name = Channel variable that digits should be placed in.
- timeout = Number of milliseconds to wait on each digit
- terminators = Digits used to end input if less than <min> digits have been pressed. (Typically '#')
Examples
Read and playback digits. In this example 400 is the destination number min digits 0 max 10 with # as a terminator. The timeout argument is an inter-digit timeout.
<extension name="Read Example">
<condition field="destination_number" expression="^400$">
<action application="answer"/>
<action application="sleep" data="1"/>
<action application="read" data="0 10 $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav res 10000 #"/>
<action application="phrase" data="spell,${res}"/>
<action application="hangup"/>
</condition>
</extension>
You can also have multiple terminators just comma separate them.
<extension name="Read Example">
<condition field="destination_number" expression="^400$">
<action application="answer"/>
<action application="sleep" data="1"/>
<action application="read" data="0 10 $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav res 10000 #,*"/>
<action application="phrase" data="spell,${res}"/>
<action application="hangup"/>
</condition>
</extension>