gpt4 book ai didi

java - 如何为 Asterisk 中的被叫者播放声音

转载 作者:行者123 更新时间:2023-12-01 13:47:54 25 4
gpt4 key购买 nike

调用我正在使用的号码

exec("DIAL", "DAHDI/g0/" + callingPhoneNo + "," + currentTimeOut + ",mg,");

在我的java应用程序中。并使用此代码片段为调用者播放声音:

exec("background", "custom/incorrectPassword");

但是在被叫者接通电话后如何为调用接收者播放声音?

最佳答案

有 3 个选项可以执行此操作。实际上只需要一个选项,但历史上我们有 3 个

1) 正是为了这个目的,Dial 命令 diallout 参数中的选项 A

A(x): 
x - The file to play to the called party
Play an announcement to the called party, where <x> is the prompt
to be played

2) 隐私模式选项。

p: This option enables screening mode. This is basically Privacy mode without memory.

P([x]): Enable privacy mode. Use <x> as the family/key in the AstDB
database if it is provided. The current extension is used if a database
family/key is not specified.

根据来电显示隐私播放消息,如果未找到则询问姓名

3) Macro 和 Gosub 的答案。只是用不同且最灵活的方式来处理调用,使用它您可以收集输入/确认/拒绝调用等。

M(macro[^arg[^...]]):

        macro - Name of the macro that should be executed.

arg - Macro arguments

Execute the specified <macro> for the *called* channel before
connecting to the calling channel. Arguments can be specified to the Macro
using '^' as a delimiter. The macro can set the variable ${MACRO_RESULT}
to specify the following actions after the macro is finished executing:

${MACRO_RESULT}: If set, this action will be taken after
the macro finished executing.

ABORT: Hangup both legs of the call

CONGESTION: Behave as if line congestion was
encountered

BUSY: Behave as if a busy signal was encountered

CONTINUE: Hangup the called party and allow the
calling party to continue dialplan execution at the next priority

GOTO:[[<context>^]<exten>^]<priority>: Transfer the
call to the specified destination.




U(x[^arg[^...]]):

x - Name of the subroutine to execute via Gosub
arg - Arguments for the Gosub routine

Execute via Gosub the routine <x> for the *called* channel before
connecting to the calling channel. Arguments can be specified to the Gosub
using '^' as a delimiter. The Gosub routine can set the variable ${GO
SUB_RESULT} to specify the following actions after the Gosub returns.

${GOSUB_RESULT}:
ABORT: Hangup both legs of the call.
CONGESTION: Behave as if line congestion was
encountered.
BUSY: Behave as if a busy signal was encountered.
CONTINUE: Hangup the called party and allow the
calling party to continue dialplan execution at the next priority.
GOTO:[[<context>^]<exten>^]<priority>: Transfer the
call to the specified destination.

关于java - 如何为 Asterisk 中的被叫者播放声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20212644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com