AGI only runs when Asterisk runs with asterisk -vvvgc

Hello.

Asterisk 1.8.20.0
My PHP AGI have all permissions: -rwxrwxrwx 1 asterisk asterisk
SELinux is disabled.

On “normal” mode, Asterisk dont runs the AGI. Enabling “agi set debug on” I see this: “AGI Script x.php completed, returning 0”. And I have not response from AGI.

But when I runs Asterisk with -vvvgc, the AGI runs succesfully!

Why? :unamused:

Helo.

How can I to do that Asterisk runs with option -vvvgc after reboot the machine?

Change the startup script (OS dependent). Note that c requires a console to be attached, which is not something that should normally happen in a startup script, although safe_asterisk does actually start asterisk with c, on tty9.

The startup script is /etc/init.d/asterisk, right?

This is its content:

[code]#!/bin/sh

BEGIN INIT INFO

Provides: asterisk

Required-Start: $network $syslog $named $local_fs $remote_fs

Required-Stop: $network $syslog $named $local_fs $remote_fs

Should-Start: dahdi misdn lcr wanrouter mysql postgresql

Should-Stop: dahdi misdn lcr wanrouter mysql postgresql

Default-Start: 3 5

Default-Stop: 0 1 2 6

Short-Description: Asterisk PBX

Description: the Asterisk Open Source PBX

END INIT INFO

. /etc/rc.status
pid="/var/run/asterisk/asterisk.pid";
dmn="/usr/sbin/asterisk";
case “$1” in
start)
echo -en "Starting asterisk ";
startproc -sp “$pid” “$dmn” -fn;
rc_status -v;;
stop)
echo -en “Stopping asterisk “;
killproc -p “$pid” “$dmn”;
rc_status -v;;
status)
echo -en “Checking for asterisk “;
checkproc -p “$pid” “$dmn”;
rc_status -v;;
reload)
echo -en “Reloading asterisk “;
killproc -p “$pid” -HUP “$dmn”;
rc_status -v;;
restart)
”$0” stop;
”$0” start;
rc_status;;
try-restart)
”$0” status >/dev/null && “$0” restart;
rc_status;;
*)
echo “Usage: $0 {start|stop|status|reload|restart|try-restart}”;
exit 1;;
esac;
rc_exit;
[/code]

Should I to change the line «startproc -sp “$pid” “$dmn” -fn;» to «startproc -sp “$pid” “$dmn” -fn -vvgc;»?

No idea. I’m not familiar with that distribution. I suspect there is a lower level subroutine that needs understanding.