API or Command to create / update / delete extensions in freepbx


(Nick) #1

Hi,

Is there any way to create an extensions through PHP script or command line interface in Freepbx.


(Jared K Smith) #2

With FreePBX 15, we introduced a technology preview of a GraphQL API that you should be able to use to add and remove extensions. It’s still not fully fleshed out, and you might run into a few bugs, but hopefully the basic functionality is there. I wrote up an introduction here that should get you started: https://www.freepbx.org/graphql-support-in-freepbx-15/


(Lorne Gaetz) #3

Bulk Handler module has command line support for importing extensions via csv:
https://wiki.freepbx.org/pages/viewpage.action?pageId=37912685#fwconsolecommands(13+)-BulkImport


(Nick) #5

Go through the documentation and trying to create PJSIP extension with “mutation” and following parameters but its creating a virtual type extension instead of PJSIP / SIP.

mutation{
addCoreUser(input:{
extension:456789,
password:“123456”,
busy_cid:“test”,
noanswer_cid:“yes”,
chanunavail_cid:“test”,
noanswer_dest:“123123”,
busy_dest:“123123”,
chanunavail_dest:“6001”,

}) {
clientMutationId
}
}

Can you please suggest me where I’m wrong OR trying any wrong implementation?


(Matt Brooks) #6

For what it’s worth, I tried doing this in the past, but was unsuccessful. I ran out of time, but someone in the community found a bug with my query. Check it out here:


(Nick) #7

How can I delete single / multiple extensions using using bulimport or I need to use some thing else to achieve this.


(system) closed #8

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