Phpagi.php[1658]: Undefined index: phpagi

After upgrading from 2.5 to 2.7 in a not-so-standard way, (please refer to, I’m getting a lot of messages in /var/log/messages saying:

php: /var/lib/asterisk/agi-bin/phpagi.php[1658]: Undefined index: phpagi

The phpagi.php code it refers to is

if($this->config['phpagi']['debug'] != false)

from the conlog function below:

    function conlog($str, $vbl=1)
      static $busy = false;

      if($this->config['phpagi']['debug'] != false)
        if(!$busy) // no conlogs inside conlog!!!
          $busy = true;
          $this->verbose($str, $vbl);
          $busy = false;

The server also crashed today, 4 days after the freepbx upgrade (kernel panic) but I’m still searching for the root cause (this server was very stable before).

I’m wondering if the php error message I’m reporting can cause trouble on a long run.



same issue here:

I recently installed a new Asterisknow 1.5 system, updated all via yum and also upgraded FPBX to 2.7 and am receiving the same message in the /var/log/messages.

php: /var/lib/asterisk/agi-bin/phpagi.php[1658]: Undefined index: phpagi
last message repeated 200 times
last message repeated 88 times
last message repeated 322 times


I also have been struggling with the same issue for some time now. Eventually calls stop coming in and the only error is in /var/log/messages is the one above, /var/log/asterisk/full shows nothing. I also upgraded to FreePbx I notice that this error occurs only when a call is directed to a queue, with calls directed to ring groups the error does not show up. Unfortunately I need queues as I use a program that gets stats of queues, it cannot work with ring groups. Please help if you can. Thanks.4


Hi Guys,

I am using Piaf, Asterisk 1.4 and FreePBX was upgraded to and I am seeing exact same messages. Today a PRI failed for inbound and outbound which I am thinking has something to do with this.

Something maybe in common with you guys:

  • This system uses Queues heavily.
  • All calls are recorded and there are more than 3000 calls in monitor directory which makes ARI Recording crash but I have a cron job to move them in monitor/backup

I also see this on FreePBX status page since today:

Asterisk Manager Connection Failure
Failed to connect to the Asterisk manager through port: 5038
Added 7 hours, 59 minutes ago

I check and all credentials are fine in manager.conf and manager_custom.conf.

Any developers want to comment on this?

I’ll be glad to comment :slight_smile:

getting a warning about an undefined index is probably a bug though very likely a completely harmless one.

None-the-less, if you want to pin point which line in the module is generating this warning then feel free to open a bug with that information and we can get the module updated to check for the index.

As far as that error message having anything to do with Asterisk or Linux crashing, or the upgrade to version 2.7 having anything to do with that, it is highly unlikely.

All to often we see reports like this and almost always the reality is that the users knowingly or not knowingly updated other components such as Asterisk or other yum updates which are much more likely to be part of the issue.

If you are finding queues as a common problem area, are you running the latest 1.4 version, 1.4.30? This has been a common theme over the last few weeks and as it stands, there is an issue with 1.4.30 that will create problems for queue users.

Otherwise, look for other changes you may have made in more critical areas that may have triggered the onset of these problems. It is very rare that a FreePBX update can have anything to do with true system crashes.