Giter Club home page Giter Club logo

auto-dial's Introduction

auto-dial

A sample nodejs project for implementing a "blast dial" feature using the CMS API.

The auto-dial service exposes an HTTP API that can be used to configure what remote destinations are associated with a space. The API lives at /api/configs on port 8444

To create a new config POST /api/configs
To modify an existing config PUT /api/configs/<id>
To delete a config and start over DELETE /api/configs/<id>
To view a config GET /api/configs/<id>
To view all configs GET /api/configs

The configs node accepts a JSON object during POST and PUT operations :

{
    "cospace":"String",
    "participants":[Array]
}

Requirements

Installation

If you have an existing nodejs and mongodb environment:

  • Clone the repo git clone https://github.com/ciscocms/auto-dial.git
  • Install the node modules used in the project npm install
  • Edit config.js with your deployment specific details
  • Alternately you can set the following environment variables to configure the service. CMS_HOST CMS_API_USERNAME CMS_API_PASSWORD API_PORT MONGO_HOST E.g.; export CMS_HOST="cms.empire.net:444"
  • Start the service node app.js

Configuring CMS

  • In Webadmin add a CDR receiver that points to the host running the service on the port you specified in config.js
  • http://ip:port/api/cdr

Configuring the auto-dial service API

  • Identify a space that you would like to target for the auto-dial function
  • Retrieve the space GUID from the CMS API. You can use a browser and simply browse to https://ip:port/api/v1/cospaces?filter=vader You'll get back a cospace object that has a GUID
<coSpaces total="1">
    <coSpace id="4855289f-0ae9-4253-af1a-c8f5f12eb596">
        <name>Vader's Space</name>
        <autoGenerated>false</autoGenerated>
        <uri>vaders.space</uri>
        <callId>333879826</callId>
    </coSpace>
</coSpaces>
  • POST to http://ip:port/api/configs with the space GUID and an array of URIs that you want to be dialed when the space generates a callStart CDR record
{
    "cospace":"4855289f-0ae9-4253-af1a-c8f5f12eb596",
    "participants":["[email protected]", "[email protected]"]
}

Tools

curl as an API client

  • Create a config - curl -X "POST" "http://ip:port/api/configs" -H "Content-Type: application/json; charset=utf-8" -d $'{"cospace": "4855289f-0ae9-4253-af1a-c8f5f12eb596","participants": ["[email protected]"]}'
  • Get a config curl "http://ip:port/api/configs/<id>"
  • Delete a config curl -X "DELETE" "http://ip:port/api/configs/<id>"

Vagrant

  • The project includes a Vagrantfile to speed up the deployment
  • The Vagrantfile includes a shell provisioner for Debian
  • You'll need to modify config.vm.box = "" to match a Debian box that you already have or you can download a new one. The project is built on Debian jessie
  • The default networking mode is public_network "bridged". Modify config.vm.network as needed for your environment

auto-dial's People

Contributors

ryanquinlan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.