代码之家  ›  专栏  ›  技术社区  ›  Igor Liferenko

如果未在星号中指定hangup(),则如何终止通道?

  •  0
  • Igor Liferenko  · 技术社区  · 5 年前

    考虑asterisk/extensions.conf中的以下示例:

    exten => 1,1,AGI(my)
    exten => 2,1,Answer()
    same => n,Playback(tt-weasels)
    same => n,Hangup()
    

    有必要在agi()之后指定hangup()吗?

    如果改为使用extensions.conf,情况会如何变化?(与之前的不同之处在于 Answer() 使用)

    exten => 1,1,Answer()
    same => n,AGI(my)
    exten => 2,1,Answer()
    same => n,Playback(tt-weasels)
    same => n,Hangup()
    

    为了完整起见,这里是agi脚本:

    #!/bin/sh
    read; while [ "$REPLY" ]; do read; done
    some-command
    echo SET VARIABLE AGISTATUS SUCCESS; read
    
    0 回复  |  直到 5 年前
        1
  •  1
  •   arheops    5 年前

    来自extensions.conf.sample

    ; If autofallthrough is set, then if an extension runs out of
    ; things to do, it will terminate the call with BUSY, CONGESTION
    ; or HANGUP depending on Asterisk's best guess. This is the default.
    ;
    ; If autofallthrough is not set, then if an extension runs out of
    ; things to do, Asterisk will wait for a new extension to be dialed
    ; (this is the original behavior of Asterisk 1.0 and earlier).
    ;
    
    ;autofallthrough=no