Create Queues, Time conditions,... via script

Hi all,

What is the best way to create Queues, Time conditions, Inbound routes via a (PHP) script?
I tried setting up a PHP file with:

include ‘/etc/freepbx.conf’;
print_r(FreePBX::Core());

… to use the built-in functions of FreePBX. But I already get the error:

Unable to locate the FreePBX BMO Class ‘Core’

Thanks!

If you are using FreePBX 15, take a look at the new GraphQL API.

Hi, it seems the GraphQL API is really limited for the moment.

There is no endpoint related to Queues / Time conditions according to Sangoma Documentation

Or did I miss something?

@lgaetz Maybe you have an idea?
I’m also trying to use your lgaetz-dnd.php script as mini-API to enable/disable DND, so not via the CLI… and have the same issue. Is this because of the authentication part or so?

GraphQL is a work in progress, so new features are added to it on a continuous basis. If you want this interface added to GQL, I recommend one of the two following courses:

  1. Start a development effort yourself and donate the code back to the project.
  2. Submit a Feature Request through the Support link at the top of the page and get your feature added to the list of features being worked on.

There is a project going that we talked about in the OpenSource Lounge last night, and IIRC, this specific ask was made. A little documentation support or elbow grease might get it moving reasonably quickly.

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