1

I have a simple dialplan in 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). 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?

duccom
  • 134
  • 2
  • 16

1 Answers1

1

AGI interface is simple.

If you do instead of agi file something like

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).

If asterisk go via dialplan to next destination, that mean your agi closed input stream or issued exit(0) or similar command.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • Yes, for my case Asterisk did not wait for AGI call, it release the function Agi() after waiting for 5 seconds. But i just realized that it was because of a setting in Load Balancing, which only keep alive one connection for 5 seconds. – duccom Oct 12 '17 at 13:17