在asterisk中,如何限制呼叫者按DTMF键而不是全部键?

在asterisk中,如何限制呼叫者按DTMF键而不是全部键?,asterisk,dtmf,agi,Asterisk,Dtmf,Agi,我使用asterisk中的php AGI创建了一个调用流。为了从调用方获取DTMF,我有AGI的userfastpass\u get\u data()函数。在此函数中,调用者可以按任意键。当来电者按任意键时,播放提示将停止 现在我想知道,当呼叫者按“1”时,只有播放提示才会停止。所以,当播放提示文件时,用户按除“1”之外的任何数字,都不会影响播放文件。但若用户按“1”,播放提示文件文件应停止并继续调用流 谢谢 使用streamfile命令 stream file Usage: STREAM FI

我使用asterisk中的php AGI创建了一个调用流。为了从调用方获取DTMF,我有AGI的userfastpass\u get\u data()函数。在此函数中,调用者可以按任意键。当来电者按任意键时,播放提示将停止

现在我想知道,当呼叫者按“1”时,只有播放提示才会停止。所以,当播放提示文件时,用户按除“1”之外的任何数字,都不会影响播放文件。但若用户按“1”,播放提示文件文件应停止并继续调用流

谢谢

使用streamfile命令

stream file Usage: STREAM FILE <filename> <escape digits> [sample offset]

Send the given file, allowing playback to be interrupted by the given digits, if any.

Use double quotes for the digits if you wish none to be permitted.

If sample offset is provided then the audio will seek to sample offset before play starts.

Remember, the file extension must not be included in the filename.

Returns: failure: 200 result=-1 endpos=<sample offset> failure on open: 200 result=0 endpos=0 success: 200 result=0 endpos=<offset> digit pressed: 200 result=<digit> endpos=<offset>
流文件用法:流文件[样本偏移量]
发送给定的文件,允许播放被给定的数字中断(如果有)。
如果希望不允许使用双引号,请对数字使用双引号。
如果提供了采样偏移量,则音频将在播放开始前寻找采样偏移量。
请记住,文件扩展名不能包含在文件名中。
返回:失败:200结果=-1结束位置=打开时失败:200结果=0结束位置=0成功:200结果=0结束位置=按下数字:200结果=结束位置=
使用streamfile命令

stream file Usage: STREAM FILE <filename> <escape digits> [sample offset]

Send the given file, allowing playback to be interrupted by the given digits, if any.

Use double quotes for the digits if you wish none to be permitted.

If sample offset is provided then the audio will seek to sample offset before play starts.

Remember, the file extension must not be included in the filename.

Returns: failure: 200 result=-1 endpos=<sample offset> failure on open: 200 result=0 endpos=0 success: 200 result=0 endpos=<offset> digit pressed: 200 result=<digit> endpos=<offset>
流文件用法:流文件[样本偏移量]
发送给定的文件,允许播放被给定的数字中断(如果有)。
如果希望不允许使用双引号,请对数字使用双引号。
如果提供了采样偏移量,则音频将在播放开始前寻找采样偏移量。
请记住,文件扩展名不能包含在文件名中。
返回:失败:200结果=-1结束位置=打开时失败:200结果=0结束位置=0成功:200结果=0结束位置=按下数字:200结果=结束位置=

如果我们使用流文件,就没有等待特定超时的选项。在fastpass_get_data()函数中,提示完成后,它将等待3秒钟,以允许调用者插入DTMF。因此,streamfile()中没有此类超时。“转义数字”是停止播放的数字。streamfile中没有任何超时。如果播放结束后需要延迟,可以在播放后添加静音。如果使用流文件,则无法等待特定超时。在fastpass_get_data()函数中,提示完成后,它将等待3秒钟,以允许调用者插入DTMF。因此,streamfile()中没有此类超时。“转义数字”是停止播放的数字。streamfile中没有任何超时。如果播放结束后需要延迟,可以在播放后添加静音