Setting up fast agi

we have a server where we are using regular agi we want to change it to fast agi

i tried to follow
https://stackoverflow.com/questions/29487705/how-to-convert-existing-asterisk-agi-scripts-to-fastagi-script

i setup as phpagi readme but i get this when trying to telnet

[root@pbx phpagi]# telnet 127.0.0.1 4573
Trying 127.0.0.1…
Connected to 127.0.0.1.
Escape character is ‘^]’.
Connection closed by foreign host.

any help tips would be appreciated thanks

That gives you a remote AGI, but not a fast one! (There may be some speed advantage, even without this, as you won’t fork the whole of Asterisk before exec’ing the script, but I’d really expect a self contained server to get a real advantage.)

To really get speed advantages you need to have a loop on accept() in the script itself. What the article describes put that loop in xinetd, so it will PHP will get launched for every new invocation.

Things that could go wrong in your case are:

  • having the wrong value for server;
  • using relative file names that assume a different current directory from that in which xinetd is running (you really shouldn’t use any relative names);
  • assuming the presence or contents of environment variables which differ from those available to xinetd.

As it is running a root, you shouldn’t have permission problems, as long as the script is marked executable for someone.

You may get a clue looking at the system log on the server running xinetd.

thank you @david551
got it to work as far as the fastagi
the problem was it was calling php from a wrong dir
there is something called a shbang header in a script
the first line has a #with a the path to php that path was wrong
but now the agi response is messed up will need to investigate further

Enabling AGI debugging (‘agi set debug on’) may yield clues.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.