Asterisk 星号,拨号计划,回答后我怎么挂?

Asterisk 星号,拨号计划,回答后我怎么挂?,asterisk,dialplan,Asterisk,Dialplan,我想在接完电话后挂断电话 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,Hangu

我想在接完电话后挂断电话

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()
有什么想法吗?我试过一个宏,但它不起作用。

来自asterisk doc

 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.
M(宏[^arg[^…]):
macro—应执行的宏的名称。
arg-宏参数
在连接到之前,执行为*被调用*通道指定的
呼叫频道。可以使用“^”作为参数为宏指定参数
定界符。宏可以设置变量${macro\u RESULT}来指定
宏执行完毕后,执行以下操作:
${MACRO_RESULT}:如果已设置,则此操作将在宏之后执行
执行完毕。
中止:挂断呼叫的两个分支
拥塞:表现为遇到线路拥塞
忙:表现为遇到忙信号
继续:挂断被叫方并允许被叫方
以下一个优先级继续执行拨号计划
转到:[[^]^]:将呼叫转接到
指定的目的地。

中止和继续都可以执行您想要的操作。

使用拨号的L选项。这样,您可以调整通话的长度。发件人: L(x[:y][:z]):将呼叫限制为“x”毫秒,当“y”毫秒离开时发出警告,每“z”毫秒重复一次)。 注意:如果您要呼叫SIP提供商,他们会将启动时间四舍五入(如果您设置L(1),即使是1ms,也将计为1秒)。此外,他们很可能会因旺吉里欺诈而暂停您的帐户