Code Monkey home page Code Monkey logo

kamailio-etcd-dispatcher's Introduction

kamailio-etcd-dispatcher

Build Status

Adds service discovery for Asterisk to Kamailio, letting Kamailio dynamically discover Asterisk boxes, and then load balance to them. Modifies a Kamailio dispatcher to have Kamailio act as a load balancer for machines discovered with etcd.

This tool automatically builds a dispatcher.list for Kamailio (using the Kamailio Dispatcher), in order to dynamically load balance Asterisk hosts, e.g. for when they're run under Fleet in CoreOS. In short, you run one instance as a side-kick to Kamailio (in "dispatcher mode") and then another instance as a side-kick to each Asterisk instance (in "announcer mode")

kamailio-etcd-dispatcher is part of a High Availability setup with Asterisk under CoreOS & Docker. Make sure you check out docker-asterisk which has more information on running a high availability Asterisk setup using CoreOS & Docker. Additionally, I presented information about this tool at Astricon 2015, and my presentation slide show is available @ astricon.dougbtv.com (hopefully youtube video coming soon, too)

Install

Install globally so you can just run it:

npm install -g kamailio-etcd-dispatcher

Basic Usage

Basic usage can be found a la:

[user@localhost ~]$ etcd-dispatcher --help

Usage: node etcd-dispatcher [options]

Options:
   -e, --etcdhost       Set etcd host or ip address  [127.0.0.1]
   -o, --etcdport       Set etcd host or ip address  [4001]
   -r, --rootkey        Set etcd root key to use  [asterisk]
   -t, --timeout        Timeout before heartbeat pulse check fails (in milliseconds)  [20000]
   -l, --listpath       Path of the dispatcher.list file [dispatcher mode only]  [/etc/kamailio/dispatcher.list]
   -a, --announce       Start in "announce" mode (defaults to dispatcher mode)
   -i, --announceip     IP Address to announce [announce mode only]  [127.0.0.1]
   -n, --announcename   Name to use in announcement, is key in etcd [announce mode only]
   -p, --announceport   Port to announce [announce mode only]  [false]
   -w, --weight         Percentage of calls to distribute to this node [announce mode only]  [false]
   -h, --heartbeat      Time between heartbeat pulses [announce mode only]  (in milliseconds)  [5000]
   --logdisable         Disable logging (not always useful...)
   --logfile            Log specifically to a file  [false]

Usage examples

You can always get help with:

etcd-dispatcher --help

Run an dispatcher like:

etcd-dispatcher --etcdhost 192.168.1.1 --timeout 25000

Run an announcer like:

etcd-dispatcher --announce --etcdhost 192.168.1.1 --timeout 5500

More information

Works in both "dispatcher" mode, which sits next to a Kamailio box and watches for Asterisk to announce itself. And in "announce" mode where it announces to Kamailio that it's available (and pulses heartbeats to it).

kamailio-etcd-dispatcher's People

Contributors

dougbtv avatar

Watchers

 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.