在Asterisk

时间:2016-03-01 06:05:54

标签: asterisk channel agi elastix

我想在被叫方挂断后为主叫方执行AGI脚本。例如,为了对客户进行调查,我将在代理挂起后运行AGI脚本。 不幸的是,当AGI脚本运行时,agi调试输出说: “511:命令无法在死信道上执行” 我在我的agi脚本中使用“ANSWER”或“STREAM FILE”等命令,需要运行一个通道。 我知道一旦被叫方挂机,呼叫频道就会挂断。 我在拨号命令中尝试了DeadAGI而不是AGI以及“g”选项,但它们都不起作用。 所以,我认为我必须寻找一个解决方案来保持调用频道,以便我可以运行我的脚本。 有什么建议吗?

2 个答案:

答案 0 :(得分:0)

最后我找到了答案。问题是我们不必在h扩展中执行agi脚本,否则我们会在agi中收到一些函数,比如answer或streamfile。我们必须在h扩展之前将调用重定向到某个扩展名,而在elastix中我必须更改extensions.conf。

答案 1 :(得分:0)

在这种情况下你不应该使用“g”参数,因为它是CALLER挂断。你应该使用“F”

    F([[context^]exten^]priority): When the caller hangs up, transfer
    the *called* party to the specified destination and *start* execution
    at that location.
    NOTE: Any channel variables you want the called channel to inherit
    from the caller channel must be prefixed with one or two underbars ('_').
    F: When the caller hangs up, transfer the *called* party to the next
    priority of the current extension and *start* execution at that location.
    NOTE: Any channel variables you want the called channel to inherit
    from the caller channel must be prefixed with one or two underbars ('_').
    NOTE: Using this option from a Macro() or GoSub() might not make
    sense as there would be no return points.
    g: Proceed with dialplan execution at the next priority in the current
    extension if the destination channel hangs up.