0

我想在接听后挂断电话。

exten => _3XXXXXXXXXX,1,Set(CALLERID(num)=1234567890)
same => n,MixMonitor(${UNIQUEID}.wav)
same => n,Dial(SIP/${EXTEN:1}@provider,,M(hang))
same => n,StopMixMonitor()
same => n,Hangup()

[macro-hang]
exten => s,1,Hangup()

任何想法?我试过一个宏,但它不起作用。

4

2 回答 2

1

来自星号文档

 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.

ABORT 和 CONTINUE 都应该做你想做的事。

于 2019-05-03T02:11:05.573 回答
0

使用 Dial 的 L 选项。这样您就可以调整通话的长度。来自https://www.voip-info.org/asterisk-cmd-dial : L(x[:y][:z]): 将呼叫限制为 'x' ms,剩余 'y' ms 时发出警告,每'z'毫秒重复一次)。注意:如果您将呼叫一个 SIP 提供商,他们将向上取整时间(如果您设置 L(1),即使它是 1 毫秒也将计为 1 秒)。此外,他们很可能会因 wangiri 欺诈而暂停您的帐户。

于 2019-09-16T20:28:30.773 回答