Nonlinear Programming Methods
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

freepbx

2.1.2 • Public • Published

FreePBX Node JS Module

This module is used to connect a Node Process to the FreePBX ecosystem.

npm install http://mirror.freepbx.org/npm/freepbx-2.0.0.tgz --save

This module provides basic mysql and asterisk manager connections that you can interact with as well

You can utilize FreePBX like so:

var FreePBX = require("freepbx");
 
FreePBX.connect().then(function (pbx) {
    //FreePBX is now ready
    //freepbx.ami == https://github.com/pipobscure/NodeJS-AsteriskManager
    //freepbx.db == https://github.com/mysqljs/mysql
 
    //Note these two are promised based libraries!!
    //freepbx.config == see example below:
 
    pbx.config.get("VALUE FROM ADVANCED SETTINGS")
    .then(function(val) {
        console.log(val);
    }).catch(function(err) {
    });;
 
    //freepbx.kvstore == see examples below:
 
    console.log("PBX is ready");
    pbx.kvstore.setConfig('Dashboard','foo',"hello world")
    .then(function(res) {
        return pbx.kvstore.getConfig('Dashboard','foo')
    })
    .then(function(val) {
        console.log(val)
    }).catch(function(err) {
        console.log(err);
    });
});

The repository is at: https://git.freepbx.org/projects/FL/repos/freepbx-nodejs/browse

Keywords

none

install

npm i freepbx

Downloadsweekly downloads

131

version

2.1.2

license

AGPL-3.0

repository

Gitgit

last publish

collaborators

  • avatar
Report a vulnerability