Giter VIP home page Giter VIP logo

ast_mongo's Introduction

MongoDB Plugins for Asterisk Build Status

The ast_mongo project provides the following plugins for Asterisk;

  1. Realtime configuration engine with MongoDB,
  2. Queue logging for MongoDB (preliminarly),
  3. CDR backend for MongoDB,
  4. CEL backend for MongoDB (contributed by viktike, thanks viktike),
  5. and a test bench with MongoDB replica set based on Docker technology(Deprecated).
  6. and a test bench based on Docker technology.
Plugin name Realtime CDR CEL Source code Config file(s)
res_mongodb.so * * * res_mongodb.c
res_config_mongodb.so * res_config_mongodb.c res_config_mongodb.conf
sorcery.conf
extconfig.conf
cdr_mongodb.so * cdr_mongodb.c cdr_mongodb.conf
cel_mongodb.so * cel_mongodb.c cel_mongodb.conf

How to get the plugins

The plugins are provided as source code patches to Asterisk. See src and patches in detail.

Test

See Test.

Test bench

(Deprecated, use Test instead of it)

The test bench based on Docker technology for these plugins is also provided. You can examine how it works on your desktop simply. See test bench in detail.

Setting up

Preconditions (example)

Name of DB Name of Collection Comment
asterisk ps_endpoints as realtime resources
asterisk ps_auths as realtime resources
asterisk ps_aors as realtime resources
asterisk ast_config as non-realtime resources
cdr cdr
cel cel

Config files as example

  • [email protected]: The three config files res_config_mongodb.conf, cdr_mongodb.conf and cel_mongodb.conf have compiled into one ast_mongo.conf.

  • ast_mongo.conf for ast_mongo plugins;

      ;==========================================
      ;
      ; for common configuration
      ;
      [common]
      ;------------------------------------------
      ; MongoDB C Driver - Logging configuration
      ; see http://mongoc.org/libmongoc/current/logging.html in detail
      ;
      ; -1 = disable logging of mongodb-c-driver
      ; 0 = MONGOC_LOG_LEVEL_ERROR,
      ; 1,2,...,
      ; 6 = MONGOC_LOG_LEVEL_TRACE
      ; default is -1
      ;mongoc_log_level=-1
      ;------------------------------------------
      ; MongoDB C Driver - APM configuration
      ; see http://mongoc.org/libmongoc/current/application-performance-monitoring.html in detail
      ;
      ; 0  = disable monitoring
      ; 0 != enable monitoring
      ; default is 0
      ;apm_command_monitoring=0
      ;apm_sdam_monitoring=0
      ;==========================================
      ;
      ; for realtime configuration engine
      ;
      [config]
      uri=mongodb://mongodb.local/asterisk    ; location of database
      ;------------------------------------------
      ; 0 != enable APM
      ; default is disabled (0)
      ;apm=0
      ;==========================================
      ;
      ; for CDR plugin
      ;
      [cdr]
      uri=mongodb://mongodb.local/cdr ; location of database
      database=cdr                    ; name of database
      collection=cdr                  ; name of collection to record cdr data
      ;------------------------------------------
      ; 0 != enable APM
      ; default is disabled (0)
      ;apm=0
      ;==========================================
      ;
      ; for CEL plugin
      ;
      [cel]
      uri=mongodb://mongodb.local/cel ; location of database
      database=cel                    ; name of database
      collection=cel                  ; name of collection to record cel data
      ;------------------------------------------
      ; 0 != enable APM
      ; default is disabled (0)
      ;apm=0
    
  • sorcery.conf specifies map from asterisk's resources to database's collections.

      [res_pjsip]
      endpoint=realtime,ps_endpoints  ; map endpoint to ps_endpoints source
      auth=realtime,ps_auths          ; map auth to ps_auths source
      aor=realtime,ps_aors            ; map aor to ps_aors source
    
  • extconfig.conf specifies database for database's collections mapped above.

      [settings]
    
      ; specify the ps_endpoints source is in asterisk database provided by ast_mongo plugin
      ; i.e. endpoint => ps_endpoints => asterisk database of mongodb plugin
      ps_endpoints => mongodb,asterisk
      ps_auths => mongodb,asterisk
      ps_aors => mongodb,asterisk
    
      ; map extensions.conf to ast_config collection of asterisk database
      extensions.conf => mongodb,asterisk,ast_config
      pjsip.conf => mongodb,asterisk,ast_config
    
      ; For queue logging (preliminarly)
      ;queue_log => mongodb,queues,queue_log
    
  • See Asterisk's official document Setting up PJSIP Realtime as well.

Supporting library

  • ast_mongo_ts which is nodejs library provides functionalities to handle asterisk's object through MongoDB.

License and Copyright

  • The related code to Asterisk:
    • GNU GENERAL PUBLIC LICENSE Version 2
  • Any other resources and files:
    • The MIT License (MIT)
  • Copyright: (C) 2016-2018, KINOSHITA minoru, viktike for cel_mongodb

ast_mongo's People

Contributors

minoruta avatar viktike 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.