-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [APM] added mongoDB APM functions. - [CONFIG MONGODB] added code for update2, store and destroy. - [MONGO C LOGGIN] added mongoc logging handler. - [UNIFIED CONFIG] unified configs for ast_mongo to one. - [IMPROVED] release db pool properly. - [MONGO C DRIVER] updated to 1.8.2 - [ASTERISK] updated to 15.1.3 - [CONFIG.JSON] removed useless parameters from config.json - [CONFIG.JSON] specify 'bundled' to use bundled option with pjsip - [UNIFIED CONFIG] unified configs for ast_mongo to one. - [TEST] added new testing (#16) - [NEW TEST] added new test - [RES CONFIG MONGODB] added a feature to handle id as ObjectID - [DOCS] update docs for new test - [TRAVIS CI] added Travis CI for testing (#15)
- Loading branch information
Showing
63 changed files
with
9,894 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
before_install: | ||
- docker pull minoruta/pjsip-node-alpine | ||
- docker image ls | ||
install: | ||
- cd test/docker | ||
- docker-compose build | ||
before_script: | ||
- docker-compose up -d | ||
script: | ||
- docker exec -it tester ash -c 'cd ast_mongo && npm install && npm test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
ARG VERSION_UBUNTU=latest | ||
FROM ubuntu:$VERSION_UBUNTU | ||
MAINTAINER KINOSHITA minoru <[email protected]> | ||
|
||
ARG VERSION_ASTERISK=15.1.3 | ||
ARG VERSION_MONGOC=1.8.2 | ||
|
||
WORKDIR /root | ||
RUN mkdir src | ||
COPY src/* src/ | ||
RUN mkdir ast_mongo | ||
#COPY ./LICENSE ast_mongo/ | ||
#COPY README.md ast_mongo/ | ||
|
||
RUN apt update -q \ | ||
&& apt install -y -q \ | ||
libssl-dev \ | ||
libsasl2-dev \ | ||
libncurses5-dev \ | ||
libnewt-dev \ | ||
libxml2-dev \ | ||
libsqlite3-dev \ | ||
libjansson-dev \ | ||
libcurl4-openssl-dev \ | ||
libsrtp0-dev \ | ||
pkg-config \ | ||
build-essential \ | ||
autoconf \ | ||
uuid-dev \ | ||
wget \ | ||
file \ | ||
git | ||
|
||
RUN cd $HOME \ | ||
&& wget -nv "https://github.com/mongodb/mongo-c-driver/releases/download/$VERSION_MONGOC/mongo-c-driver-$VERSION_MONGOC.tar.gz" -O - | tar xzf - \ | ||
&& cd mongo-c-driver-$VERSION_MONGOC \ | ||
&& ./configure --disable-automatic-init-and-cleanup > /dev/null \ | ||
&& make all install \ | ||
&& cd $HOME \ | ||
&& rm -rf mongo-c-driver-$VERSION_MONGOC | ||
|
||
RUN cd $HOME \ | ||
&& wget -nv "http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$VERSION_ASTERISK.tar.gz" -O - | tar -zxf - \ | ||
&& cd asterisk-$VERSION_ASTERISK \ | ||
&& git config --global user.email "[email protected]" \ | ||
&& git init && git add . && git commit . -m "initial" \ | ||
&& cd $HOME/asterisk-$VERSION_ASTERISK/cdr \ | ||
&& cp $HOME/src/cdr_mongodb.c . \ | ||
&& git add . \ | ||
&& cd $HOME/asterisk-$VERSION_ASTERISK/cel \ | ||
&& cp $HOME/src/cel_mongodb.c . \ | ||
&& git add . \ | ||
&& cd $HOME/asterisk-$VERSION_ASTERISK/res \ | ||
&& cp $HOME/src/res_mongodb.c . \ | ||
&& cp $HOME/src/res_mongodb.exports.in . \ | ||
&& cp $HOME/src/res_config_mongodb.c . \ | ||
&& git add . \ | ||
&& cd $HOME/asterisk-$VERSION_ASTERISK/include/asterisk \ | ||
&& cp $HOME/src/res_mongodb.h . \ | ||
&& git add . \ | ||
&& cd $HOME/asterisk-$VERSION_ASTERISK \ | ||
&& patch -p1 -F3 -i $HOME/src/mongodb.for.asterisk.patch \ | ||
&& git diff build_tools/menuselect-deps.in configure.ac makeopts.in > $HOME/ast_mongo/mongodb.for.asterisk.patch \ | ||
&& git diff HEAD > $HOME/ast_mongo/ast_mongo-$VERSION_ASTERISK.patch \ | ||
&& ./bootstrap.sh \ | ||
&& ./configure --disable-xmldoc > /dev/null \ | ||
&& tar czf $HOME/ast_mongo/asterisk-$VERSION_ASTERISK-config.log.tgz config.log \ | ||
&& make all \ | ||
&& make install \ | ||
&& ldconfig /usr/lib \ | ||
&& make samples | ||
|
||
|
||
CMD asterisk -c > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,11 @@ Plugin name |Realtime |CDR|CEL|Source code|Config file(s) | |
The plugins are provided as source code patches to Asterisk. | ||
See [patches](patches) in detail. | ||
|
||
## Test | ||
See [Test](test/docker). | ||
|
||
## Test bench | ||
## ~~Test bench~~ | ||
**(Deprecated, use [Test](test/docker) 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. | ||
|
@@ -47,13 +50,68 @@ Name of DB |Name of Collection |Comment | |
`cdr` | `cdr` | ||
`cel` | `cel` | ||
|
||
### Config files for the exmaple | ||
|
||
|
||
- [`res_config_mongodb.conf`](test_bench/configs/res_config_mongodb.conf) for realtime configuration engine | ||
|
||
[mongodb] | ||
### 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`](test_bench/configs/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`](test_bench/configs/sorcery.conf) specifies map from asterisk's resources to database's collections. | ||
|
||
|
@@ -73,30 +131,16 @@ Name of DB |Name of Collection |Comment | |
ps_aors => mongodb,asterisk | ||
|
||
; map extensions.conf to ast_config collection of asterisk database | ||
extensions.conf => mongodb,asterisk,ast_config | ||
extensions.conf => mongodb,asterisk,ast_config | ||
pjsip.conf => mongodb,asterisk,ast_config | ||
|
||
- [`cdr_mongodb.conf`](test_bench/configs/cdr_mongodb.conf) specifies the location, name and collection of database for cdr backend. | ||
|
||
[mongodb] | ||
uri=mongodb://mongodb.local/cdr ; location of database | ||
database=cdr ; name of database | ||
collection=cdr ; name of collection to record cdr data | ||
|
||
- [`cel_mongodb.conf`](test_bench/configs/cel_mongodb.conf) specifies the location, name and collection of database for cel backend. | ||
|
||
[mongodb] | ||
uri=mongodb://mongodb.local/cel ; location of database | ||
database=cel ; name of database | ||
collection=cel ; name of collection to record cel data | ||
|
||
- See Asterisk's official document [Setting up PJSIP Realtime][5] as well. | ||
|
||
## License and Copyright | ||
|
||
- The related code to Asterisk: | ||
- The related code to Asterisk: | ||
- GNU GENERAL PUBLIC LICENSE Version 2 | ||
- Any other resources and files: | ||
- Any other resources and files: | ||
- The MIT License (MIT) | ||
- Copyright: (C) 2016-17, KINOSHITA minoru, [viktike][9] for cel_mongodb | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.