如何在sayDigits函数中配置asterisk AGI中的语言

问题描述 投票:0回答:1
 /**
   * Play the given number
   * @param {*} context AGI call context
   * @param {string} value Value to play
   * @returns {Promise<{any}>} 
   */
  static sayNumber(context, value) {
    return context.sayNumber(value, "*");
  }

  /**
   * Play the given string
   * @param {*} context AGI call context
   * @param {string} value Value to play
   * @returns {Promise<{any}>}
   */
  static sayAlpha(context, value) {
    return context.sayAlpha(value, "*");
  }

  /**
   * Play the given digits
   * @param {*} context AGI call context
   * @param {string} value value to play
   * @returns {Promise<{any}>}
   */
  static sayDigits(context, value) {
    return context.sayDigits(value, "*");
  }

我们正在使用 Agi 服务器和 ding-dong 节点 Agi 分支来进行 IVR 呼叫。

上述函数中参数定义如下:-

  1. 上下文包含呼叫事件和元信息、变量信息和呼叫会话。
  2. Value 是要读回的值。
  3. “*”参数定义为转义值,用于在说话时转义任何数字。

这里 AGI 总是读回英语输入,但我们希望针对西班牙语等语言动态配置它。

我尝试将语言作为第三个参数传递:

  static sayDigits(context,value,language) {
   return context.sayDigits(value, "*",language);
  }

但这对我不起作用。我怎样才能控制语言?

asterisk agi
1个回答
0
投票

在 dialplan 中,你可以这样做

Set(CHANNEL(language)=it)

在您的 AGI 中,您可以使用 set_full_variable 等命令或您的库中的任何命令执行相同的操作。

每个数字都没有支持

SAY DIGITS NUMBER ESCAPE_DIGITS

https://docs.asterisk.org/Asterisk_16_Documentation/API_Documentation/AGI_Commands/say_digits/

© www.soinside.com 2019 - 2024. All rights reserved.