简体   繁体   English

Asterisk 等待 AGI 调用需要多长时间?

[英]How long Asterisk wait for an AGI call?

I have a simple dialplan in Asterisk 13我在 Asterisk 13 中有一个简单的拨号方案

exten => 800,1,Answer()
 ;AGI do something and return AUDIO_FILE tobe played
 same => n,Agi(agi://localhost:1000/doAlotOfThing.agi)
 same => n,Playback(${AUDIO_FILE}
 same => n,Hangup()

I was expect Asterisk will wait for AGI until it done processing the command then return AUDIO_FILE variable (about 20 seconds).我期望 Asterisk 会等待 AGI,直到它完成处理命令然后返回 AUDIO_FILE 变量(大约 20 秒)。 But the actual is Asterisk just wait about few seconds, and even Agi is not done yet, it still passing it and playing AUDIO_FILE (which not be initialized) So the question is: How i can change the AGI timeout setting in Asterisk?但实际是 Asterisk 只需等待几秒钟,即使 Agi 还没有完成,它仍然通过它并播放 AUDIO_FILE(未初始化)所以问题是:我如何更改 Asterisk 中的 AGI 超时设置?

AGI interface is simple. AGI界面很简单。

If you do instead of agi file something like如果你做而不是 agi 文件之类的

while(1){
 sleep(1)
}

then it will wait until caller hangup(actualy even some more time after hangup, but that not granted, so you have AVOID such agi).然后它会等到来电者挂断(实际上挂断后还要多一些时间,但这没有被授予,所以你有避免这样的 agi)。

If asterisk go via dialplan to next destination, that mean your agi closed input stream or issued exit(0) or similar command.如果星号通过拨号计划到下一个目的地,那意味着你的 agi 关闭了输入流或发出了 exit(0) 或类似的命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM