PHP Fatal error: Class 'FreePBX_Helpers' not found

Hi everybody,

I’m using the latest distro of FreePBX.
I tried to simply add a device programmatically but keep getting the same error :

PHP Fatal error: Class ‘FreePBX_Helpers’ not found in /var/www/html/admin/modules/core/Core.class.php on line 4

This is the small test-program I use :

<?php
namespace FreePBX\modules;

include("/var/www/html/admin/modules/core/Core.class.php");

    class Automation extends \FreePBX_Helpers
    {
        function __construct()
        {
            $this->pushDevToDB();
        }

        function pushDevToDB() {
            $core = new Core();
            $core->addDevice(100, 'sip');
        }

    }

Can anyone help me on how to get started by solving this issue ? Or maybe helping me with an example of code that works to add a device ?

Yours sincerely,
Lowie

2 posts were merged into an existing topic: Error when trying to add device programmatically