Git Product home page Git Product logo

odoo_asterisk's Introduction

Asterisk inside Odoo - PBX & Dev platform

Imagine all Asterisk PBX features covered around by Odoo.

Static or RealTime, scaling from Embedded PBX to unlimited number of servers in the cloud with central management.

Project description

IMAGE ALT TEXT HERE

This project is Asterisk Management system and also Asterisk development platform based on Odoo.

Currently implemented features:

  • Multi server management - many Asterisk servers are managed from one place.
  • Asterisk .conf files editor with Asterisk syntax highlight. Configuration files are stored in Odoo database and delivered to Asterisk server via Asterisk internal HTTP server.
  • Asterisk WEB console with colors.
  • Stasis apps server implementing different business logic, e.g. set callerid name from Odoo contacts.
  • Call QoS reporting on every CDR.
  • CEL (Channel event logging) on every call.
  • Call Recording with automatic download and cleanup (embedded pbx ready).
  • Apps
  • SIP users and trunks management, peer registration history and statistics.
  • More to come...

Project Components

odoo-addons

This folder contains Odoo modules. You should update your odoo.conf and append path to this folder.

[options]
addons_path =  /usr/lib/python2.7/dist-packages/odoo/addons,/opt/odoo_asterisk/odoo-addons

Don't forget to activate developer mode and update apps list so that Odoo knows about these modules!

Also this folder contains requirements for Odoo, you can install them from pip:

pip install -r requirements.txt

PostgreSQL preparations

Before installing Odoo Asterisk addon modules you have to create PostgreSQL role for Asterisk (set your own password!):

template1=# create user asterisk with password 'asterisk';
CREATE ROLE
template1=#

agent

This folder contains Asterisk agent that should be deployed on your Asterisk server. Currently the agent gives a WEB Asterisk CLI in Odoo.

You should create a python environment using requirements.txt and run the agent.

Clone this repo on your Asterisk server, create python virtual environment, go to agent folder and run

virtualenv env
source env/bin/activate
pip install -r requirements.txt
python cli_server.py

After that go to Odoo and set Asterisk CLI URL in server's settings to (for example if your asterisk server is on 192.168.1.1):

ws://192.168.1.1:8010/websocket

Save, go to Console tab and click Edit to activate Asterisk CLI. Click Discard to leave the console.

services

This folder contains additional helper applications:

  • stasis_apps.py - Asterisk Stasis Application implementing different services, e.g. setting callerid name from Odoo contacts.
  • ami_broker.py - AMI client for asterisk used for example to catch Hangup event to download call recording.

You should create a virtualenvironment using this folder's requirements.txt and run both scripts. See conf.py for configuration settings

After installation

Trigger for CEL

Go to PgSQL console and run:

CREATE OR REPLACE FUNCTION update_cel_cdr_field() RETURNS trigger AS $$
        BEGIN
        UPDATE asterisk_cel set cdr = NEW.id
            WHERE asterisk_cel.uniqueid = NEW.uniqueid;
        RETURN NULL;
        END; $$ LANGUAGE 'plpgsql';

        DROP TRIGGER IF EXISTS update_cel_cdr_field  on asterisk_cdr;
        CREATE TRIGGER update_cel_cdr_field AFTER INSERT on asterisk_cdr
            FOR EACH ROW EXECUTE PROCEDURE update_cel_cdr_field();

Create role for Asterisk

GRANT ALL on asterisk_cdr to asterisk;
GRANT ALL on asterisk_sip_peer to asterisk;
GRANT ALL on asterisk_cdr_id_seq to asterisk;
GRANT ALL on asterisk_cel to asterisk;
GRANT ALL on asterisk_cel_id_seq to asterisk;
GRANT SELECT on asterisk_context to asterisk;
GRANT SELECT on asterisk_conf_extensions to asterisk;

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.