##Google Analz## ##Microsoft## ##Googel## Swanand: December 2017

Wednesday 13 December 2017

Email Configuration in Vicidial




Configuration setup as followed

 1. Installed following perl Cpan modules

cpan
install LWP::UserAgent
install HTML::Entities
install HTML::Strip
install HTML::FormatText
install HTML::TreeBuilder
install Switch
install Time::Local
install MIME::Decoder
install Mail::POP3Client
install Mail::IMAPClient
install Mail::Message
install IO::Socket::SSL
install MIME::Base64
quit

2. Enabled allow emails in System Settings
3. Enabled Modify Email Accounts option in Admin interface Options
4. Added Email group inside Inbound Menu
5. Added IMAP Email Account inside Admin->Email Accounts
6. Enabled Allow Emails in Campaign Settings
7. Added /usr/share/astguiclient/AST_inbound_email_parser.pl in cronttab -e
8. sendemail service working fine

After following these many steps i am unable to receive any emails.

Wednesday 6 December 2017

Fusionpbx v4 Freeswitch v1.6 CentOS v7 Install Guide

Fusionpbx is a full featured mult-tenant GUI for Freeswitch.  This guide covers the installation of Fusionpbx and Freeswitch® with MariaDB and Apache on CentOS v7.

Tested on:

CentOS v7
Freeswitch v1.6
FusionPBX v4
MariaDB v5.5

Assumptions:

Console text mode (multi-user.target)
Installation done as root user (#)

Install Prerequisites

Ensure all required packages are installed.
yum install epel-release
yum update
yum install git nano httpd mariadb-server php php-common php-pdo php-soap php-xml php-xmlrpc php-mysql php-cli php-imap php-mcrypt mysql-connector-odbc memcached ghostscript libtiff-devel libtiff-tools at

Disable Selinux

Check status
sestatus
If not disabled, set SELINUX=disabled in /etc/selinux/config.  Requires reboot for changes to take effect.
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

Timezone

## FIND YOUR TIMEZONE
tzselect

## SET TIMEZONE EXAMPLE
timedatectl set-timezone America/Vancouver

## CHECK TIMEZONE
​timedatectl status

Reboot

To ensure the changes/additions are at their default states.
reboot

Install

Freeswitch

rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
yum install freeswitch-config-vanilla freeswitch-sounds* freeswitch-lang* freeswitch-lua freeswitch-xml-cdr

Database

systemctl start mariadb
mysql
From mysql prompt >
CREATE DATABASE freeswitch;
GRANT ALL PRIVILEGES ON freeswitch.* TO fusionpbx@localhost IDENTIFIED BY 'somepassword';
flush privileges;
\q

ODBC

nano /etc/odbc.ini
[freeswitch]
Driver   = MySQL
SERVER   = 127.0.0.1
PORT     = 3306
DATABASE = freeswitch
OPTION  = 67108864
Socket   = /var/lib/mysql/mysql.sock
threading=0
MaxLongVarcharSize=65536

[fusionpbx]
Driver   = MySQL
SERVER   = 127.0.0.1
PORT     = 3306
DATABASE = fusionpbx
OPTION  = 67108864
Socket   = /var/lib/mysql/mysql.sock
threading=0
 
Test odbc driver
odbcinst -s -q
 
Test odbc connection
isql -v freeswitch fusionpbx somepassword 

quit

Download Fusionpbx

There are fixes and enhancements in our fork so that it will install properly on MySQL.  The developer appears to have addressed them now, so if you want the latest updates you can install from https://github.com/fusionpbx/fusionpbx
Make sure the "." is included at the end of the git clone command.  That tells git to clone into the current directory instead of creating a /fusionpbx subdirectory.
cd /var/www/html
git clone -b 4.2 https://github.com/powerpbx/fusionpbx.git .

Copy conf Directory

mv /etc/freeswitch /etc/freeswitch.orig
mkdir /etc/freeswitch
cp -R /var/www/html/resources/templates/conf/* /etc/freeswitch

Apache config

# Add user freeswitch to group apache to avoid problems with /var/lib/php/sessions directory 
usermod -a -G apache freeswitch

# Set http server to run as same user/group as Freeswitch
sed -i "s/User apache/User freeswitch/" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group daemon/" /etc/httpd/conf/httpd.conf

# Set webserver to obey any .htaccess files in /var/www/html and subdirs 
sed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/2' /etc/httpd/conf/httpd.conf

Set ownership and permissions

# Ownership
chown -R freeswitch.daemon /etc/freeswitch /var/lib/freeswitch \
/var/log/freeswitch /usr/share/freeswitch /var/www/html

# Directory permissions to 770 (u=rwx,g=rwx,o='')
find /etc/freeswitch -type d -exec chmod 770 {} \;
find /var/lib/freeswitch -type d -exec chmod 770 {} \;
find /var/log/freeswitch -type d -exec chmod 770 {} \;
find /usr/share/freeswitch -type d -exec chmod 770 {} \;
find /var/www/html -type d -exec chmod 770 {} \;

# File permissions to 664 (u=rw,g=rw,o=r)
find /etc/freeswitch -type f -exec chmod 664 {} \;
find /var/lib/freeswitch -type f -exec chmod 664 {} \;
find /var/log/freeswitch -type f -exec chmod 664 {} \;
find /usr/share/freeswitch -type f -exec chmod 664 {} \;
find /var/www/html -type f -exec chmod 664 {} \;

Systemd config

nano /etc/systemd/system/freeswitch.service
[Unit]
Description=FreeSWITCH
Wants=network-online.target
After=syslog.target network-online.target
After=mariadb.service httpd.service

[Service]
Type=forking
User=freeswitch
ExecStartPre=/usr/bin/mkdir -m 0750 -p /run/freeswitch
ExecStartPre=/usr/bin/chown freeswitch:daemon /run/freeswitch
WorkingDirectory=/run/freeswitch
PIDFile=/run/freeswitch/freeswitch.pid
EnvironmentFile=-/etc/sysconfig/freeswitch
ExecStart=/usr/bin/freeswitch -ncwait -nonat $FREESWITCH_PARAMS
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
 
Create the $FREESWITCH_PARAMS file for extra parameters.  If freeswitch was installed from RPM this will probably already exist.

nano /etc/sysconfig/freeswitch
## Type:                string
## Default:             ""
## Config:              ""
## ServiceRestart:      freeswitch
#
# if not empty: parameters for freeswitch
#
FREESWITCH_PARAMS=""

Enable services

systemctl daemon-reload
systemctl enable mariadb
systemctl enable httpd
systemctl enable freeswitch
systemctl enable memcached
systemctl restart freeswitch
Fix fs_cli
If fs_cli command does not work with freeswitch running change the following config line.
nano /etc/freeswitch/autoload_configs/event_socket.conf.xml
<param name="listen-ip" value="127.0.0.1"/>
systemctl restart freeswitch
 
Reboot and browse to the public IP address of the server
 http://xx.xx.xx.xx
to complete the install using the following:
Username: superadmin (or whatever you want)
Password: somepassword (use whatever you want)
Database Name: fusionpbx
Database Username: fusionpbx
Database Password: somepassword
Create Database Options: check "Create the database"
Create Database Username: root
Create Database Password : (leave blank unless you have already added a root password)
Post install tasks are mandatory.

Post Install

Lock down the database server

mysql_secure_installation
systemctl restart mariadb
Answer Y to everything.

Enable freeswitch database connection

This sets Freeswitch to use mysql instead of sqlite.
nano /etc/freeswitch/autoload_configs/switch.conf.xml
<param name="core-db-dsn" value="freeswitch:fusionpbx:somepassword" /> 
systemctl restart freeswitch

Change Voicemail to Email app configuration

nano +119 /etc/freeswitch/autoload_configs/switch.conf.xml
<param name="mailer-app" value="/usr/bin/php /var/www/html/secure/v_mailto.php"/>
                <param name="mailer-app-args" value="-t"/>
systemctl restart freeswitch

Configure firewall

firewall-cmd --permanent --zone=public --add-service={http,https}
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/tcp
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udp
firewall-cmd --permanent --zone=public --add-port=16384-32768/udp
firewall-cmd --reload



Asterisk Freepbx on CentOS (CentOS v7, Asterisk v14, Freepbx v14)

This covers the installation of Asterisk v13 or v14 and FreePBX v14 GUI from source on CentOS v7.

Tested on

CentOS v7 x64
Asterisk v13 and v14
FreePBX v14

Assumptions

Console text mode (multi-user.target)
Installation done as root user (#)

Prerequisites

Ensure a basic server install with initial dependencies to start with.
yum -y update && yum -y groupinstall core && yum -y groupinstall base && yum -y install epel-release
yum -y install automake gcc gcc-c++ ncurses-devel openssl-devel libxml2-devel unixODBC-devel libcurl-devel libogg-devel libvorbis-devel speex-devel spandsp-devel freetds-devel net-snmp-devel iksemel-devel corosynclib-devel newt-devel popt-devel libtool-ltdl-devel lua-devel sqlite-devel radiusclient-ng-devel portaudio-devel neon-devel libical-devel openldap-devel gmime-devel mysql-devel bluez-libs-devel jack-audio-connection-kit-devel gsm-devel libedit-devel libuuid-devel jansson-devel libsrtp-devel git subversion libxslt-devel kernel-devel audiofile-devel gtk2-devel libtiff-devel libtermcap-devel ilbc-devel python-devel bison tftp-server httpd sox tzdata mysql-connector-odbc mariadb mariadb-server fail2ban jwhois xmlstarlet ghostscript libtiff-tools patch e2fsprogs mpg123 lame gstreamer mongodb-server

PHP

Install repository and replace any existing PHP packages.
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install yum-plugin-replace 
yum replace php --replace-with php56u

 Install PHP v5.6
 
yum -y install php56u php56u-mysqlnd php56u-process php56u-pear php56u-mbstring php56u-xml php56u-gd php56u-curl

Node.js
 
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs

ODBC
 
cat >> /etc/odbc.ini << EOF
[MySQL-asteriskcdrdb]
Description = MariaDB connection to 'asteriskcdrdb' database
driver = MySQL
server = localhost
database = asteriskcdrdb
Port = 3306
Socket = /var/lib/mysql/mysql.sock
option = 3
Charset=utf8
  
EOF

Miscellaneous
 
yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
yum install ffmpeg

Set Timezone

## FIND YOUR TIMEZONE
tzselect
## SET TIMEZONE EXAMPLE
timedatectl set-timezone America/Vancouver
​timedatectl status

Install

DAHDI

Only required if using a physical server and installing telecom hardware.  At this time, versions newer than 2.10.2 (2.11.0 and 2.11.1) do not install correctly.
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.10.2+2.10.2.tar.gz
tar zxvf dahdi-linux-complete-2.10*
cd /usr/src/dahdi-linux-complete-2.10*/
make all && make install && make config
systemctl restart dahdi
If make all fails try reboot and run apt install linux-headers*

Asterisk

To install Asterisk v14, set VERSION=14 .  To switch versions, it is best to run  rm -rf /usr/lib64/asterisk/modules first.
# Select Asterisk VERSION=14 or
VERSION=13
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-${VERSION}-current.tar.gz
tar zxvf asterisk-${VERSION}-current.tar.gz
cd /usr/src/asterisk-${VERSION}*/
make distclean

Install additional dependencies
 
cd /usr/src/asterisk-${VERSION}*/
./contrib/scripts/install_prereq install

Configure
 
cd /usr/src/asterisk-${VERSION}*/
./configure --libdir=/usr/lib64 --with-pjproject-bundled

To view results type nano -v config.log.

Set compile options
cd /usr/src/asterisk-${VERSION}*/
make menuselect

# Select additional compile options or leave at default and save.
# To add/change compile options afterwards just run make menuselect and make && make install again.
Create Asterisk User, compile, install and set preliminary ownership.
adduser asterisk -s /sbin/nologin -c "Asterisk User"
make && make install && chown -R asterisk. /var/lib/asterisk

Freepbx

systemctl restart mariadb
cd /usr/src
git clone -b release/14.0 --single-branch https://github.com/freepbx/framework.git freepbx
cd /usr/src/freepbx
./start_asterisk start

./install -n

If you get a Could not determine Asterisk version error, modify the following line:
nano +266  installlib/installcommand.class.php
$lastline = exec("runuser" . $answers['user'] . ' -s /bin/bash -c "cd ~/ && asterisk -rx \'core show version\' | grep ^Asterisk 2>&1"', $tmpout, $ret);

Module install
fwconsole ma upgrade framework core voicemail sipsettings infoservices \
featurecodeadmin logfiles callrecording cdr dashboard music conferences
fwconsole chown
fwconsole reload

Additional modules can be installed via GUI > Admin > Module Admin.
Optionally, install all modules (not recommended).  You will most likely need to run the following commands twice.
fwconsole ma installall
fwconsole chown
fwconsole reload

Set Freepbx to start on boot
cat > /etc/systemd/system/freepbx.service << EOF​
[Unit]
Description=Freepbx
After=mariadb.service
 
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start
ExecStop=/usr/sbin/fwconsole stop
 
[Install]
WantedBy=multi-user.target

EOF
systemctl enable freepbx

Post-install tasks

Lock down the database server.
mysql_secure_installation
Answer Y to everything.
Change apache web server settings.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
sed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/2' /etc/httpd/conf/httpd.conf

Make sure database and web server are set to start on boot.
systemctl enable mariadb
systemctl enable httpd
Finally, reboot for all changes to take effect
reboot

Optional

Log File Rotation

If this is not done the log files will keep growing indefinitely.
nano /etc/logrotate.d/asterisk
/var/spool/mail/asterisk
/var/log/asterisk/*log
/var/log/asterisk/full
/var/log/asterisk/dtmf
/var/log/asterisk/freepbx_dbug
/var/log/asterisk/fail2ban {
        weekly
        missingok
        rotate 4
        #compress
        notifempty
        sharedscripts
        create 0640 asterisk asterisk
        postrotate
        /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null || true
        endscript
        su root root
}

Firewall

systemctl enable firewalld
systemctl restart firewalld
firewall-cmd --permanent --zone=public --add-service={http,https}
firewall-cmd --permanent --zone=public --add-port=5060-5061/tcp
firewall-cmd --permanent --zone=public --add-port=5060-5061/udp
firewall-cmd --permanent --zone=public --add-port=10000-20000/udp
firewall-cmd --reload

TFTP

If you plan to use hardware SIP phones you will probably want to set up TFTP.
yum -y install tftp-server
nano /etc/xinetd.d/tftp
change server_args = -s /var/lib/tftpboot
to server_args = -s /tftpboot
change disable=yes
to disable=no
mkdir /tftpboot
chmod 777 /tftpboot
systemctl restart xinetd
firewall-cmd --permanent --zone=public --add-port=69/udp
firewall-cmd --reload

Test ODBC

odbcinst -s -q
Use username & password in /etc/asterisk/res_odbc_additional.conf to test connectivity to the DB via ODBC.
isql -v MySQL-asteriskcdrdb someusername somepassword
Test asterisk ODBC access
asterisk -vvvr
CLI> odbc show

Misc. settings

Set php memory_limit = 256M .
sed -i 's/memory_limit = .*/memory_limit = 256M/g' /etc/php.ini

 




<--break->

Featured post

Vicidial With WebRTC

Vicidial With WebRTC VICIDial is well known open source call center software. It has been in use by many small to large scaled con...