打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
play_and_get_digits Misc. Dialplan Tools play and get digits

Contents

 [hide

Description

Play a prompt and get digits.

Usage

<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp> <digit_timeout> <transfer_on_failure>

Parameters

  • min = Minimum number of digits to fetch (minimum value of 0)
  • max = Maximum number of digits to fetch (maximum value of 128)
  • tries = numbers of tries for the sound to play
  • timeout = Number of milliseconds to wait for a dialed response after the file playback ends and before PAGD does a retry.
  • terminators = digits used to end input if less than <max> digits have been pressed. (Typically '#')
  • file = Sound file to play while digits are fetched
  • invalid_file = Sound file to play when digits don't match the regexp
  • var_name = Channel variable into which digits should be placed
  • regexp = Regular expression to match digits
  • digit_timeout = Inter-digit timeout; number of milliseconds allowed between digits; once this number is reached, PAGD assumes that the caller has no more digits to dial
  • transfer_on_failure = where to transfer call when max tries has been reached, example: 1 XML hangup
    • Note: digit_timeout is optional and defaults to the value of <timeout>

Channel Variables

On exit, there may be some useful values in channel variables

  • read_terminator_used = The digit used to terminate entry (if a digit was used). Note that if termination was due to a timeout or hangup, then this channel variable is not touched (so may be left as nil or whatever it was on entry)

Examples

<extension name="play_and_get_digits example">  <condition field="destination_number" expression="^(1888)$">    <action application="play_and_get_digits" data="2 5 3 7000 # $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav foobar \d+"/>    <action application="log" data="CRIT ${foobar}"/>  </condition></extension>

This example demonstrates using say (or phrase) to get one digit after 3s, 250ms of silence on fail (no digit entered). Quote the text string!

<extension name="play_and_get_digits with say">  <condition field="destination_number" expression="^(6500)$">    <action application="play_and_get_digits" data="1 1 1 3000 # say:'press one for technicial support' silence_stream://250 res \d+" />  </condition></extension>

Note that the parameters are slightly different in the lua version (and you can't use "say"!)

       session:setVariable("read_terminator_used","-")       destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", "phrase:getnum", "phrase:error", "\\d+")       terminator = session:getVariable("read_terminator_used")

See Also

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
使用Asterisk manager API实现自动拨号
AngularJS 性能优化
Nginx RTMP 模块 nginx-rtmp-module 指令详解
Lua variable scoping with setfenv
execl()
Generating Microsoft Word Doc with dynamic data | SAP Blogs
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服