Hello,
I am trying to port an AGI application presently running on Asterisk 1.4.25 under Centos to my current installation of Asterisk 22.2.0 on Debian 12.10. I have installed Asterisk 22.2.0 by installing FreePBX 17.0.19.23.
I am able to dial in to asterisk using the following dialplan defined in /etc/asterisk/extensions_custom.comf (not in FreePBX):
[from-blue]
exten => _.,1,Noop(Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.)
exten => _.,n,Goto(blue-2,s,1)
[blue-2]
exten => s,1,Set(__FROM_DID=${EXTEN})
exten => s,n,GotoIf($[ "${CALLERID(name)}" != "" ] ?cidok)
exten => s,n,Set(CALLERID(name)=${CALLERID(num)})
exten => s,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => s,n,Goto(blue-3,s,1)
[blue-3]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(PAID=${PJSIP_HEADER(P-Asserted-Identity)})
exten => s,n,Set(CALLERID(number)=${CUT(PAID,<,2):4:10})
exten => s,n,Set(FROM_DNIS=${hank})
exten => s,n,Set(DialOut_ID)
exten => s,n,AGI(TPW.php,8441112222,5553334444)
exten => s,n,Hangup
The incoming call (on a toll-free line) successfully launches the AGI script, which plays prompts to the caller and collects/processes DTMF digits in response.
However, 30 seconds after the AGI script launches, Asterisk hangs up the incoming phone call. The AGI script continues to run (even though I am using AGI and not DEADAGI) with the AGUI “GET DATA” commands timing out, until the script reaches it’s end.
It’s as if Asterisk thinks that the call is inactive once the AGI script starts, even though I hear prompts and can transmit digits in response throughout the 30 seconds.