litnimax / astconfman

Asterisk ConfBridge Manager
GNU Lesser General Public License v3.0
45 stars 36 forks source link

Asterisk ConfBridge Manager

MAINTAINER IS WANTED If you would like to maintain this repo pls create a new ticket.

This is a WEB based interface for managing Asterisk ConfBridge application.

Built on Asterisk ConfBridge, Flask, SSE, React.js

You can request a new feature or see current requests and bugs here.

How it works

Flask is used as a WEB server. By default it uses SQLite3 database for storage but other datasources are also supported (see config.py).

Conference participants are invited using Asterisk call out files. To track participant dial status local channel is used. No AMI/AGI/ARI is used. Everything is built around asterisk -rx 'confbridge <...>' CLI commands. Asterisk and Flask are supposed to be run on the same server but it's possible to implement remote asterisk command execution via SSH. The software is distributed as as on BSD license. Asterisk resellers can easily implement their own logo and footer and freely redistribute it to own customers (see BRAND_ options in config.py).

Features

Demo

atsconf

Here is the demo with the folling scenatio:

Demo

Installation

Requirements

On Ubuntu:

sudo apt-get install python-pip python-virtualenv python-dev

In Debian 11 pip2 and virtualenv was deleted from repository, install them manually:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
sudo pip2 install virtualenv

Download the latest version:

wget https://github.com/litnimax/astconfman/archive/master.zip
unzip master.zip
mv astconfman-master astconfman

Or you can clone the repository with:

git clone https://github.com/litnimax/astconfman.git

Next steps:

cd astconfman
virtualenv env
source env/bin/activate
pip2 install -r requirements.txt
mv env/lib/python2.7/site-packages/asterisk/ env/lib/python2.7/site-packages/asterisk2/

The above will download and install all runtime requirements.

To enable AMI events put content of astconfman/asterisk_etc/manager.conf file into /etc/asterisk/manager.conf or change AMI credentials in 'config.py' manually. Don't forget to enable talker detection events in participant profile settings and reload Asterisk config.

Now you should init database and run the server:

cd astconfman
./manage.py init
./run.py

Now visit http://localhost:5000/ in your browser.

Default user/password is admin/admin. Don't forget to override it.

Configuration

WEB server configuration

Go to instance folder and create there config.py file with your local settings. See config.py for possible options to override. Options in config.py file are self-descriptive.

Asterisk configuration

Asterisk must have CURL function compiled and loaded. Check it with

*CLI> core show  function CURL

You must include files in astconfman/asterisk_etc folder from your Asterisk installation.

Put

#include /path/to/astconfman/asterisk_etc/extensions.conf

to your /etc/asterisk/extensions.conf and

#include /path/to/astconfman/asterisk_etc/confbridge.conf

to your /etc/asterisk/confbridge.conf.

Open extensions.conf with your text editor and set your settings in globals section.

Open /etc/asterisk/asterisk.conf and be sure that

live_dangerously = no

Participant menu

While in the conference participants can use the following DTMF options:

Dialplan for calling external users

[confman-dialout]
include => localph
include => extph

[localph]
exten => _XXX,1,Dial(SIP/${EXTEN},60)
exten => _ХXX,2,Set(ret=${CURL(${CONFMAN_HOST}/asterisk/dial_status/${conf_number}/${participant_number}/${DIALSTATUS})})
[extph]
exten => _XXXX.,1,Dial(${DIALOUT_TRUNK1}/${EXTEN},60)
exten => _XXXX.,2,Set(ret=${CURL(${CONFMAN_HOST}/asterisk/dial_status/${conf_number}/${participant_number}/${DIALSTATUS})})

Frequent errors

Asterisk monitor path not accessible

(env)max@linux:~/astconfman/astconfman$ ./manage.py init
Traceback (most recent call last):
  File "./manage.py", line 7, in <module>
    from app import app, db, migrate
  File "/home/max/astconfman/astconfman/app.py", line 60, in <module>
    from views import asterisk
  File "/home/max/astconfman/astconfman/views.py", line 608, in <module>
    menu_icon_value='glyphicon-hdd'
  File "/home/max/astconfman/env/local/lib/python2.7/site-packages/flask_admin/contrib/fileadmin.py", line 193, in __init__
    raise IOError('FileAdmin path "%s" does not exist or is not accessible' % base_path)
IOError: FileAdmin path "/var/spool/asterisk/monitor/" does not exist or is not accessible

(env)max@linux:~/astconfman/astconfman$ ls -l /var/spool/
итого 16
drwxr-x--- 9 asterisk asterisk 4096 сент.  1 22:20 asterisk
drwxr-xr-x 5 root     root     4096 сент.  1 22:09 cron
lrwxrwxrwx 1 root     root        7 сент.  1 22:05 mail -> ../mail
drwxr-xr-x 2 root     root     4096 апр.  11  2014 plymouth
drwx------ 2 syslog   adm      4096 дек.   4  2013 rsyslog
(env)max@linux:~/astconfman/astconfman$

To fix it add user running astwebconf to asterisk group.

Conference makes multiple outgoing calls on dialout call

Check if run.py are running with same user as Asterisk and what env directory has read-write access for Asterisk user.