sudo apt-get install mc -y
sudo apt-get install --no-install-recommends lubuntu-desktop
sudo reboot
Using the Webmin APT repository
If you like to install and update the webmin via APT, edit the / etc / apt / sources.list file and add the lines:
deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
You must also be able to get it.
cd /root wget http://www.webmin.com/jcameron-key.asc apt-key add jcameron-key.asc
You may need to run this command as root.
sudo apt-key add jcameron-key.asc
You will now be able to install with the commands:
sudo apt-get update sudo apt-get install webmin
All dependencies should be resolved automatically.
iptables-restore < filename
sudo apt-get update && sudo apt-get upgrade –y && sudo reboot
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
tar -zxvf asterisk-11-current.tar.gz tar -zxvf dahdi-linux-complete-current.tar.gz tar -zxvf libpri-1.4-current.tar.gz
sudo apt-get install build-essential libncurses5-dev openssl libxml2-dev
sudo /usr/src/asterisk-11.12.0/contrib/scripts/install_prereq install
sudo apt-get install libncurses5-dev openssl libssl-dev zlib1g zlib1g-dev mpg123 linux-headers-`uname -r` build-essential mysql-server libmysqlclient15-dev php5 php5-cli php5-mysql php5-gd php-pear apache2 curl sox bison flex cpp g++ gcc make libauthen-pam-perl libio-pty-perl libnet-ssleay-perl libxml2 libxml2-dev libaudiofile-dev subversion libsqlite3-dev
cd /usr/src/dahdi-linux-complete-2.10.0+2.10.0 sudo make all sudo make install sudo make config
cd /usr/src/libpri-1.4.15 sudo make sudo make install
cd /usr/src/asterisk-11.12.0 ./configure sudo make menuselect
sudo make install
contrib/scripts/get_mp3_source.sh
sudo make install
sudo make samples
sudo make config
sudo asterisk start
sudo rasterisk
*CLI>dahdi show version
*CLI>pri show version *CLI>exit
sudo service asterisk stop
sudo adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk PBX" asterisk
sudo chown -R asterisk:asterisk /var/lib/asterisk sudo chown -R asterisk:asterisk /var/log/asterisk sudo chown -R asterisk:asterisk /var/run/asterisk sudo chown -R asterisk:asterisk /var/spool/asterisk sudo chown -R asterisk:asterisk /usr/lib/asterisk sudo chown -R asterisk:asterisk /dev/dahdi sudo chmod -R u=rwX,g=rX,o= /var/lib/asterisk sudo chmod -R u=rwX,g=rX,o= /var/log/asterisk sudo chmod -R u=rwX,g=rX,o= /var/run/asterisk sudo chmod -R u=rwX,g=rX,o= /var/spool/asterisk sudo chmod -R u=rwX,g=rX,o= /usr/lib/asterisk sudo chmod -R u=rwX,g=rX,o= /dev/dahdi sudo chown -R root:asterisk /etc/asterisk sudo chmod -R u=rwX,g=rX,o= /etc/asterisk
AST_USER=«asterisk» AST_GROUP=«asterisk»
sudo service asterisk start
ps aux|grep aster
asterisk 2793 3.0 0.8 2539536 26540? Ssl 20:21 0:00 / usr / sbin / asterisk -U asterisk -G asterisk
sudo apt-get install mysql-client
sudo mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
mysql>
mysql> create database asteriskcdrdb;
mysql> use asteriskcdrdb; mysql>CREATE TABLE `cdr` ( `acctid` int(11) NOT NULL AUTO_INCREMENT, `src` varchar(80) DEFAULT NULL, `dst` varchar(80) DEFAULT NULL, `calldate` datetime NOT NULL, `clid` varchar(80) DEFAULT NULL, `dcontext` varchar(80) DEFAULT NULL, `channel` varchar(80) DEFAULT NULL, `dstchannel` varchar(80) DEFAULT NULL, `lastapp` varchar(80) DEFAULT NULL, `lastdata` varchar(80) DEFAULT NULL, `duration` int(10) unsigned DEFAULT NULL, `billsec` int(10) unsigned DEFAULT NULL, `disposition` varchar(80) NOT NULL DEFAULT '', `amaflags` varchar(80) DEFAULT NULL, `accountcode` int(10) unsigned DEFAULT NULL, `uniqueid` varchar(32) DEFAULT NULL, `userfield` varchar(80) DEFAULT NULL, `import_cdr` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`acctid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
mysql> CREATE USER asterisk_user IDENTIFIED BY 'asterisk_password';
mysql> grant all on asteriskcdrdb.* to 'asterisk'@'localhost' identified by 'asterisk'; mysql> flush privileges;
[global] hostname=localhost dbname=asteriskcdrdb table=cdr password=asterisk user=asterisk sock=/var/lib/mysqld/mysqld.sock
sudo rasterisk *CLI>module unload cdr_mysql.so
Unloaded cdr_mysql.so == Unregistered 'mysql' CDR backend
*CLI> module load cdr_mysql.so
Loaded cdr_mysql.so == Parsing '/etc/asterisk/cdr_mysql.conf': Found -- Found alias start for column calldate Loaded cdr_mysql.so => (MySQL CDR Backend)
*CLI> cdr mysql status
Connected to asterisk on socket file /var/lib/mysql/mysql.sock using table cdr for 0 hours, 2 minutes, 7 seconds. Wrote 0 records since last restart.
wget –no-check-certificate https://raw.github.com/Star2Billing/cdr-stats/master/install/install-cdr-stats-asterisk.sh -O install-cdr-stats-asterisk.sh bash ./install-cdr-stats-asterisk.sh
bash ./install-cdr-stats-asterisk.sh ./install-cdr-stats-asterisk.sh: line 1: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 2: !DOCTYPE: No such file or directory ./install-cdr-stats-asterisk.sh: line 3: html: No such file or directory ./install-cdr-stats-asterisk.sh: line 4: head: No such file or directory ./install-cdr-stats-asterisk.sh: line 5: title: No such file or directory ./install-cdr-stats-asterisk.sh: line 6: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 7: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 8: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 9: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 10: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 11: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 12: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 13: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 14: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 15: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 16: $'\r': command not found ./install-cdr-stats-asterisk.sh: line 17: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 18: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 19: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 20: base: No such file or directory ./install-cdr-stats-asterisk.sh: line 21: link: No such file or directory ./install-cdr-stats-asterisk.sh: line 22: link: No such file or directory ./install-cdr-stats-asterisk.sh: line 23: link: No such file or directory ./install-cdr-stats-asterisk.sh: line 24: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 25: meta: No such file or directory ./install-cdr-stats-asterisk.sh: line 26: link: No such file or directory ./install-cdr-stats-asterisk.sh: line 27: syntax error near unexpected token `<' ./install-cdr-stats-asterisk.sh: line 27: `
#!/bin/bash # # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2Billing SL # # The Initial Developer of the Original Code is # Arezqui Belaid <info@star2billing.com> # # To download and run the script on your server : # cd /usr/src/ ; rm install-cdr-stats-asterisk.sh ; wget --no-check-certificate https://raw.github.com/Star2Billing/cdr-stats/master/install/install-cdr-stats-asterisk.sh -O install-cdr-stats-asterisk.sh; bash install-cdr-stats-asterisk.sh # BRANCH='master' INSTALL_DIR='/usr/share/cdr_stats' #INSTALL TYPE (ASTERISK or FREESWITCH) INSTALL_TYPE='ASTERISK' INSTALLMODE='GENTLE' # Set to FULL to update Selinux, Firewall, etc if not Set to GENTLE echo "" echo "" echo "> > > This is only to be installed on a fresh new installation of CentOS 6.2 or Ubuntu LTS 10.04 / 12.04! < < <" echo "" echo "It will install CDR-Stats on your server" echo "Press Enter to continue or CTRL-C to exit" echo "" read TEMP #Get Scripts dependencies cd /usr/src/ wget --no-check-certificate https://raw.github.com/Star2Billing/cdr-stats/$BRANCH/install/bash-common-functions.sh -O bash-common-functions.sh wget --no-check-certificate https://raw.github.com/Star2Billing/cdr-stats/$BRANCH/install/cdr-stats-functions.sh -O cdr-stats-functions.sh #Include general functions source bash-common-functions.sh source cdr-stats-functions.sh #Identify the OS func_identify_os #Request the user to accept the license func_accept_license_mplv2 #run install menu run_menu_cdr_stats_install
bash install-cdr-stats-asterisk.sh
This script is only intended to run on Ubuntu LTS 10.04 / 12.04 or CentOS 6.X
cd /etc/
DISTRIB_CODENAME = trusty
cd /usr/src/
func_identify_os() { if [ -f /etc/debian_version ] ; then DIST='DEBIAN' if [ "$(lsb_release -cs)" != "lucid" ] && [ "$(lsb_release -cs)" != "precise" ]; then echo "This script is only intended to run on Ubuntu LTS 10.04 / 12.04 or CentOS 6.X" exit 255
/ etc / lsb-release change trusty to precise
cd /usr/src bash install-cdr-stats.sh
It will install CDR-Stats on your server
Press Enter to continue or CTRL-C to exit
- [YES / NO]
YES
> CDR-Stats Installation Menu
=====================================
1) Install All
2) Install CDR-Stats Web Frontend
3) Install CDR-Stats Backend / CDR-Stats-Celery
4) Install MongoDB
0) Quit
(0-4): 1
Enter database settings for Asterisk ...
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES)
Configure Mysql Settings to connect to the Asterisk CDR database ...
Enter Mysql hostname (default: localhost)
localhost
Enter Mysql port (default: 3306)
3306
Enter Mysql Username (default: root)
asterisk
Enter Mysql Password (default: password)
asterisk
Enter Database name (default: asteriskcdrdb)
asteriskcdrdb
We will now add a CD to your CDR database.
We advice you to first backup your database prior
Create a super admin user ...
Username (leave blank to use 'root'):
E-mail address: your-email@server.com
Password:
Password (again):
Superuser created successfully.
No data can be found in your collections, please make sure that the data is working correctly.
sudo service cdr-stats-celeryd stop
mongo
use cdr-stats; db.monthly_analytic.remove({}); db.daily_analytic.remove({}); db.aggregate_world_report.remove({}); db.aggregate_result_cdr_view.remove({}); db.aggregate_hourly_country_report.remove({}); db.cdr_common.remove({});
sudo mysql -p
mysql> use asteriskcdrdb; mysql> update cdr SET import_cdr = 0;
Query OK, 0 rows affected (0.24 sec)
Rows matched: 3 Changed: 0 Warnings: 0
cd /usr/share/cdr-stats
LOCAL_SWITCH_IP = " "
LOCAL_SWITCH_IP = 'localhost'
sudo service cdr-stats-celeryd start
/usr/share/cdr-stats/setting_local.py
PREFIX_TO_IGNORE = "+, 00,000,0000,00000,011,55555,99999"
PREFIX_TO_IGNORE = "+,00,000,0000,00000,011,55555,99999,8,810,9,910"
sudo service cdr-stats-celeryd restart
Source: https://habr.com/ru/post/250195/
All Articles