FastAGI script and DIAL execution

Home » Asterisk Users » FastAGI script and DIAL execution
Asterisk Users 1 Comment

Hi all,

I am trying to control the whole call using a FastAGI script. To that
effect I launch a FastAGI script (written with asterisk-java).

Basically, I want to DIAL from within the FastAGI script. When the call
ends I want to control the hangup (if executed at the remote end), and
depending on the cause, dial again, play a message, or hang up. This is a
pretty standard telephony scenario. I did it before by executing the AGI,
setting variables, calling the DIAL command from the dialplan, and then
executing a second AGI script for the cleanup logic. However, now that I am
using FastAGI it seems like a better idea to keep the AGI script alive
during the duration of the call. This gives me a lot of control and
fexibility on reporting.

However, as far as I can tell, once the called party hangs up, the CDR is
generated and posted, _even though my script is still in execution_! As you
can see from the sample below, the called party hangs up, and dialplan
execution starts immediately at the h extension, even though my script is
still running. In fact, I have quite a bit of cleanup to do, adding
variables to the CDR’s, and none of them are saved! I believe this is
because the CDR is already finised.

It’s like if once you call the DIAL aplication, the dialplan forks off and
your script is running in a different place. I do not understand it. I
assumed when I called DIAL from within a script, that the script execution
would suspend, but be resumed once the DIAL command returned, but this is
not what is happening.

Is there any way to get that behaviour?



“Entering customer extension”

One thought on - FastAGI script and DIAL execution