Giter VIP home page Giter VIP logo

excdr-pusher's Introduction

Push FreeSWITCH CDRs to PostgreSQL Build Status

Collect and push CDRs from FreeSWITCH Sqlite to PostgreSQL.

Usage Dev

Run dev:

MIX_ENV=dev iex -S mix

Check outdated deps:

mix hex.outdated

Usage Test

Run test.watch:

MIX_ENV=dev mix test.watch

Usage Prod

Compile and release:

MIX_ENV=prod mix compile
# MIX_ENV=prod mix release.init
MIX_ENV=prod mix release --verbose

Installation

Create directory for logs:

mkdir /var/log/freeswitch_realtime

Add host in your /etc/hosts eg:

127.0.0.1     influxdb-host

Compile & Build Release

Firstly, edit version in mix.exs.

Then compile:

MIX_ENV=prod mix compile

Finally, build the release:

MIX_ENV=prod mix release

Build with Docker for Debian 8 (Jessie)

Create releases directory & give permissions:

mkdir releases
chmod 0777 releases

Create the new docker image and then create the releases:

docker build --tag=build-elixir-jessie -f docker/Dockerfile.build.elixir .
docker run -e "MIX_ENV=prod" -v $PWD/releases:/app/releases build-elixir-jessie mix release --verbose --env=prod

Run tests

You will need to install inotify-tools to use mix test.watch. mix test.watch will automatically run your Elixir project's tests each time you save a file (https://github.com/lpil/mix-test.watch)

You will need inotify-tools installed.

Code linter

We use Credo as colinter

mix credo

Start on reboot

Add excdr_pusher to systemd on Debian 8.x:

cp excdr_pusher.service /lib/systemd/system/excdr-pusher.service
systemctl enable excdr-pusher.service
systemctl daemon-reload
systemctl restart excdr-pusher.service

Todo

List of improvements and tasks,

  • Repo.insert_all make genserver crash on error, so we need to find a way to capture error, and uncommit the sqlite CDRs that were fetched, this will ensure that on error we can do something, maybe flag the CDRs as errors for future checks
  • use conform to support config file
  • add inch_ex
  • add credo - https://github.com/rrrene/credo

excdr-pusher's People

Contributors

areski avatar

Stargazers

Ryan Niemi avatar Casey Strouse avatar  avatar

Watchers

 avatar James Cloos avatar  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.