get data

Usage: GET DATA <file to be streamed> [timeout] [max digits]

Stream the given file, and recieve DTMF data.

This is similar to stream file, but this command can accept and return many DTMF digits, while stream file returns immediately after the first DTMF digit is detected.

Asterisk looks for the file to play in /var/lib/asterisk/sounds/ by default.

If the user doesn't press any keys when the message plays, there is <timeout> milliseconds of silence then the command ends.

The user has the opportunity to press a key at any time during the message or the post-message silence. If the user presses a key while the message is playing, the message stops playing. When the first key is pressed a timer starts counting for <timeout> milliseconds. Every time the user presses another key the timer is restarted. The command ends when the counter goes to zero or <max digits> are entered, whichever happens first.

If you don't specify a <timeout>, then a default timeout of 2000 is used following a pressed digit. If no digits are pressed then 6 seconds of silence follow the message.

If you don't specify <max digits>, then the user can enter as many digits as they want.

Pressing the # key ends the command. When ended this way, the command ends successfully with any previously keyed digits in the result. A side effect of this is that there is no easy way to read a # key using this command. However, it is possible to read a single # key, as the result will be empty, but the timeout attribute will not be present: "200 result=".

failure: 200 result=-1
timeout with pressed digits: 200 result=<digits> (timeout)
timeout without pressed digits: 200 result= (timeout)
success: 200 result=<digits>

<digits> is the digits pressed.

See also

Go back to Asterisk AGI
Created by: awysocki, Last modification: Wed 30 of Oct, 2013 (09:43 UTC) by weinerk
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+