FastAGI (Perl) Trouble (Asterisk 1.4)

Hello,

I got a problem with a FastAGI script. I’m trying to do the following:
User A calls User B -> As soon as the Call is accepted, a FastAGI Script is called, which shall establish a new connection -> The Call shall be placed on Hold -> When the new connection is established, the FastAGI script sends a command back to Asterisk, which then resumes the call.
So far the theory, but I’m already failing in the very beginning, where I’m just calling a Fastagi script which does some prompts to check if it’s working. It DOES print all the stuff it should, but the Call is not processed the way it should be. The caller always keeps on getting the “ringing” message, while the callee says “connection established”.
As I am rather new to Asterisk, I can’t really figure out where the problem is. Unnecessary to say that I’m quite confused and would appreciate any Help or Hints that may help me solve my problem.

So long,
Manuel