Saturday, 25 March 2017

Blocking Anonymous calls in vicidial

Blocking Anonymous calls in vicidial

exten => _X.,1,Set(CALLERID(num)=${CALLERID(num)})
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,GotoIf($["${CALLERID(num)}" = "1000000000"]?who-r-u,s,1)
exten => _X.,4,GotoIf($["${CALLERID(num)}" = ""]?who-r-u,s,1)
exten => _X.,5,GotoIf($["foo${CALLERID(num)}" = "foo"]?who-r-u,s,1)
exten => _X.,6,GotoIf($["${CALLERID(name):0:9}" = "Anonymous"]?who-r-u,s,1)
exten => _X.,7,GotoIf($["${CALLERID(name):0:7}" = "Unknown"]?who-r-u,s,1)
exten => _X.,8,GotoIf($["${CALLERID(num):0:7}" = "Private"]?who-r-u,s,1)
exten => _X.,9,GotoIf($["${CALLERID(name):0:7}" = "Private"]?who-r-u,s,1)
exten => _X.,10,GotoIf($["${CALLERID(num):0:10}" = "Restricted"]?who-r-u,s,1)
exten => _X.,11,GotoIf($["${CALLERID(num):0:4}" = "PSTN"]?who-r-u,s,1)
exten => _X.,12,AGI(agi-DID_route.agi)

[who-r-u]
exten => s,1,Background(privacy-unident)
exten => s,2,Background(vm-rec-name)
exten => s,3,Wait(2)
exten => s,4,Record(/tmp/asterisk-stranger:gsm,5,15)
exten => s,5,Playback(goodbye)
exten => s,6,Hangup


Dwibendu Moharana | www.interbitsolutions.com | BBSR | India | 
Contact :+91-7008220621 | Skype - muntycse


LinkedIn:-https://in.linkedin.com/in/dwibendumoharana

Sunday, 5 March 2017

Vicidial Installation on Centos 6.X and Asterisk 11.X

Steps:-1

yum -y update
reboot

vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0

Step -2

yum install make patch gcc gcc-c++ subversion php php-devel php-gd gd-devel php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel httpd libpcap libpcap-devel libnet ncurses ncurses-devel screen mysql-server mysql-devel ntp kernel* mutt glibc.i686  unzip rdate



yum install gcc gcc-c++ php php-devel php-gd gd-devel php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel httpd libpcap libpcap-devel ncurses ncurses-devel screen sox mysql-server mysql-devel ntp kernel-devel mutt

yum install gcc gcc-c++ wget bison mysql-devel mysql-server php php-mysql php-process php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel php-gd audiofile-devel gtk2-devel subversion nano kernel-devel selinux-policy sqlite-devel openssl-devel libuuid-devel libcurl-devel tzdata

yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron


Step:-3

/etc/init.d/mysqld start
mysql_secure_installation
chkconfig mysqld on


service mysqld stop
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf

vi /etc/my.cnf    ; copy the below config to this file.
[mysql.server]
user = mysql
#basedir = /var/lib

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
datadir = /var/lib/mysql
#tmpdir = /home/mysql_tmp
socket = /var/lib/mysql/mysql.sock
user = mysql
old_passwords = 0
ft_min_word_len = 3
max_connections = 800
max_allowed_packet = 32M
skip-external-locking

log-error = /var/log/mysqld/mysqld.log

query-cache-type = 1
query-cache-size = 32M

long_query_time = 1
#slow_query_log = 1
#slow_query_log_file = /var/log/mysqld/slow-queries.log

tmp_table_size = 128M
table_cache = 1024

join_buffer_size = 1M
key_buffer = 512M
sort_buffer_size = 6M
read_buffer_size = 4M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M

max_tmp_tables = 64

thread_cache_size = 8
thread_concurrency = 8

# If using replication, uncomment log-bin below
#log-bin = mysql-bin

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
#log-error = /var/log/mysqld/mysqld.log
#pid-file = /var/run/mysqld/mysqld.pid


mkdir /var/log/mysqld
mv /var/log/mysqld.log /var/log/mysqld/mysqld.log
touch /var/log/mysqld/slow-queries.log
chown -R mysql:mysql /var/log/mysqld
service mysqld restart



Step:-5

yum install perl-CPAN perl-YAML perl-XML-Parser gcc-c++ make

perl -MCPAN -e shell

install CPAN::Meta::Requirements
install CPAN
reload cpan
install YAML
install MD5
install Digest::MD5
install Digest::SHA1
install readline
install Bundle::CPAN
reload cpan
install DBI
force install DBD::mysql
install Net::Telnet
install Time::HiRes
install Net::Server
install Switch
install Mail::Sendmail
install Unicode::Map
install Jcode
install Spreadsheet::WriteExcel
install OLE::Storage_Lite
install Proc::ProcessTable
install IO::Scalar
install Spreadsheet::ParseExcel
install Curses
install Getopt::Long
install Net::Domain
install Term::ReadKey
install Term::ANSIColor
install Spreadsheet::XLSX
install Spreadsheet::Read
install LWP::UserAgent
install HTML::Entities
install HTML::Strip
install HTML::FormatText
install HTML::TreeBuilder
install Time::Local
install MIME::Decoder
install Mail::POP3Client
install Mail::IMAPClient
install Mail::Message
install IO::Socket::SSL
install MIME::Base64
install MIME::QuotedPrint
install Crypt::Eksblowfish::Bcrypt



Step-6

cd /usr/src
wget http://download.vicidial.com/required-apps/asterisk-perl-0.08.tar.gz
tar -xvzf asterisk-perl-0.08.tar.gz
cd asterisk-perl-0.08
perl Makefile.PL
make all
make install



cd /usr/src
wget http://downloads.sourceforge.net/project/lame/lame/3.98.2/lame-398-2.tar.gz
wget http://download.vicidial.com/required-apps/ttyload-0.5.tar.gz
wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
wget http://download.vicidial.com/required-apps/mtop-0.6.6.tar.gz
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
wget http://download.vicidial.com/required-apps/sipsak-0.9.6-1.tar.gz
wget http://download.vicidial.com/required-apps/pl241src.tar.gz
wget http://sourceforge.net/projects/eaccelerator/files/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.zip


cd /usr/src
tar -xvzf lame-398-2.tar.gz
tar -xvzf ttyload-0.5.tar.gz
tar -xvzf iftop-0.17.tar.gz
tar -xvzf mtop-0.6.6.tar.gz
tar -xvzf mytop-1.6.tar.gz
tar -xvzf sipsak-0.9.6-1.tar.gz
tar -xvzf pl241src.tar.gz
unzip eaccelerator-0.9.6.1.zip

cd /usr/src/lame-398-2
./configure
make
make install

cd /usr/src/ttyload-0.5
make
make install

cd /usr/src/iftop-0.17
./configure
make
make install

cd /usr/src/mtop-0.6.6
perl Makefile.PL
make
make install

cd /usr/src/mytop-1.6
perl Makefile.PL
make
make install

cd /usr/src/sipsak-0.9.6
./configure
make
make install

cd /usr/src/pl241src/src
make
make install
mkdir -p /var/www/html/vicidial/ploticus/
cp pl /var/www/html/vicidial/ploticus/

cd /usr/src/eaccelerator-0.9.6.1

export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install

vi /etc/php.ini


error_reporting  =  E_ALL & ~E_NOTICE
memory_limit = 48M
short_open_tag = On
max_execution_time = 330
max_input_time = 360
post_max_size = 48M
upload_max_filesize = 42M
default_socket_timeout = 360


zend_extension="/usr/lib64/php/modules/eaccelerator.so"
;For CentOS 32-bit: zend_extension="/usr/lib/php/modules/eaccelerator.so"
eaccelerator.shm_size="48"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
php -v


Step:-6
vi /etc/httpd/conf/httpd.conf
change

CustomLog logs/access_log common
to
CustomLog /dev/null common




    Alias /RECORDINGS/ "/var/spool/asterisk/monitorDONE/"

    <Directory "/var/spool/asterisk/monitorDONE">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    <files *.mp3>
    Forcetype application/forcedownload
    </files>
    </Directory>


/etc/init.d/httpd restart

Step-7

mkdir /usr/src/asterisk
cd /usr/src/asterisk

wget http://downloads.digium.com/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

Alt:-https://www.dropbox.com/s/d3471kf6e9yooqt/libpri-1.4-current.tar.gz?dl=0

https://www.dropbox.com/s/suecbzadhgujawj/asterisk-11.22.0-vici.tar.gz?dl=0


tar -xvzf dahdi-linux-complete-current.tar.gz
tar -xvzf libpri-1.4-current.tar.gz

http://www.danjourno.com/asterisk-libjansson-cannot-open-shared/
Dahdi Installation
cd /usr/src/asterisk/
cd dahdi-linux-complete-2.11.+2.11./       --> as  my current dahdi version is 2.11
make all
make install
make config
dahdi_genconf modules

LibPri installation
cd /usr/src/asterisk
cd libpri-1.4.14
make clean
make
make install

cd ../asterisk-11.22.0 (./configure --libdir=/usr/lib64 )
     ./configure(32 bit)
    make menuselect
    make
    make install
    make samples
contrib/scripts/get_mp3_source.sh

Step-8

cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-wav-current.tar.gz

Setting the sounds in place
cd /var/lib/asterisk/sounds
tar -zxf /usr/src/asterisk-core-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-wav-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-wav-current.tar.gz

mkdir /var/lib/asterisk/mohmp3
mkdir /var/lib/asterisk/quiet-mp3
mkdir /var/lib/asterisk/default
cd /var/lib/asterisk
ln -s mohmp3 default
ln -s moh mohmp3
cd mohmp3
tar -zxf /usr/src/asterisk-moh-opsound-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-wav-current.tar.gz
rm -rf CHANGES*
rm -rf LICENSE*
rm -rf CREDITS*
cd /var/lib/asterisk/moh
rm -rf CHANGES*
rm -rf LICENSE*
rm -rf CREDITS*
cd /var/lib/asterisk/sounds
rm -rf CHANGES*
rm -rf LICENSE*
rm -rf CREDITS*
cd /var/lib/asterisk/quiet-mp3


sox ../mohmp3/macroform-cold_day.wav macroform-cold_day.wav vol 0.25
sox ../mohmp3/macroform-cold_day.gsm macroform-cold_day.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-cold_day.ulaw -t ul macroform-cold_day.ulaw vol 0.25
sox ../mohmp3/macroform-robot_dity.wav macroform-robot_dity.wav vol 0.25
sox ../mohmp3/macroform-robot_dity.gsm macroform-robot_dity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-robot_dity.ulaw -t ul macroform-robot_dity.ulaw vol 0.25
sox ../mohmp3/macroform-the_simplicity.wav macroform-the_simplicity.wav vol 0.25
sox ../mohmp3/macroform-the_simplicity.gsm macroform-the_simplicity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-the_simplicity.ulaw -t ul macroform-the_simplicity.ulaw vol 0.25
sox ../mohmp3/reno_project-system.wav reno_project-system.wav vol 0.25
sox ../mohmp3/reno_project-system.gsm reno_project-system.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/reno_project-system.ulaw -t ul reno_project-system.ulaw vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.wav manolo_camp-morning_coffee.wav vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.gsm manolo_camp-morning_coffee.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/manolo_camp-morning_coffee.ulaw -t ul manolo_camp-morning_coffee.ulaw vol 0.25

Step-9


yum -y install subversion
cd /usr/src
mkdir astguiclient
cd astguiclient

svn checkout svn://svn.eflo.net:3690/agc_2-X/trunk
Alt:-https://www.dropbox.com/s/dr5froitk2xited/trunk.tar?dl=0
cd trunk
perl install.pl
**when promots jsut press enter except for below three ptions*
server webroot path or press enter for default[/srv/htdocs]:/var/www/html
Enter asterisk version or press enter for default: [1.4]11.X
Copy sample configuration files to /etc/asterisk/ ? [n]y
........................................................................................................

Step:-10

Creating Vicidial Database
........................................................................................................
 mysql -p   -- if password not set then press enter
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
SET GLOBAL connect_timeout=60;
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
\. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
quit

Step:-11
........................................................................................................
Updating the area codes
........................................................................................................
run the below command at linux terminal as root user
/usr/share/astguiclient/ADMIN_area_code_populate.pl
........................................................................................................
Entering the startup scripts and services in rc.local
........................................................................................................
open the rc.local and paste the below entries
vi /etc/rc.d/rc.local
copy and paste the below details in rc.local
### sybsys local login
touch /var/lock/subsys/local

# OPTIONAL enable ip_relay(for same-machine trunking and blind monitoring)
# /usr/share/astguiclient/ip_relay/relay_control start  2>/dev/null 1>&2

# Disable console blanking and powersaving
/usr/bin/setterm -blank
/usr/bin/setterm -powersave off
/usr/bin/setterm -powerdown

### start up the MySQL server
/etc/init.d/mysqld start

### start up the apache web server
/etc/init.d/httpd start

### roll the Asterisk logs upon reboot
/usr/share/astguiclient/ADMIN_restart_roll_logs.pl

### clear the server-related records from the database
/usr/share/astguiclient/AST_reset_mysql_vars.pl

### load zaptel drivers
modprobe dahdi
modprobe dahdi_dummy
/usr/sbin/dahdi_cfg -vvvvvvvvvvvv

### sleep for 20 seconds before launching Asterisk
sleep 20

### start up asterisk
/usr/share/astguiclient/start_asterisk_boot.pl

save and exit

Step:-11
.......................................................................................................
Installing ip_relay
.......................................................................................................
yum -y install glibc.i686


Step 5: Other Settings

Step:-12
........................................................................................................
Cronjob entries
........................................................................................................
[root@~] crontab -e

copy and paste the below entries and save and exit
for the latest vicidial cron jobs refer docs folder under downloaded vicidial source fi

### recording mixing/compressing/ftping scripts
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
#0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3
2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3

### keepalive script for astguiclient processes
* * * * * /usr/share/astguiclient/ADMIN_keepalive_ALL.pl

### kill Hangup script for Asterisk updaters
* * * * * /usr/share/astguiclient/AST_manager_kill_hung_congested.pl

### updater for voicemail
* * * * * /usr/share/astguiclient/AST_vm_update.pl

### updater for conference validator
* * * * * /usr/share/astguiclient/AST_conf_update.pl

### flush queue DB table every hour for entries older than 1 hour
11 * * * * /usr/share/astguiclient/AST_flush_DBqueue.pl -q

### fix the vicidial_agent_log once every hour and the full day run at night
33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
## uncomment below if using QueueMetrics
#*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check

## uncomment below if using Vtiger
#1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet

### updater for VICIDIAL hopper
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q

### adjust the GMT offset for the leads in the vicidial_list table
1 1,7 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl

## adjust time on the server with ntp
30 * * * * /usr/sbin/ntpdate -u pool.ntp.org 2>/dev/null 1>&2

### VICIDIAL agent time log weekly and daily summary report generation
2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl
22 0 * * * /usr/share/astguiclient/AST_agent_day.pl

### VICIDIAL campaign export scripts (OPTIONAL)
#32 0 * * * /usr/share/astguiclient/AST_VDsales_export.pl
#42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl

### remove old recordings more than 7 days old
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f

### roll logs monthly on high-volume dialing systems
#30 1 1 * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl

### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f
30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | xargs rm -f


save and exit

Step:-13
By default the vicidial db comes with ip 10.10.10.15, run the below command to update to your current server ip and just press enter
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15

........................................................................................................
Updating the music on hold configuration to work with asterisk
.......................................................................................................
vi /etc/asterisk/musiconhold.conf
change the below settings
[old-default]
(to)
[default]
(and)
[old-quiet]
(to)
[quiet]


.......................................................................................................
Reboot after the installation completed
.......................................................................................................
Step:-14
.......................................................................................................
Final Adjustments
.......................................................................................................
It is important to change the externip and localnet values in the sip.conf
The externip needs to be the public ip of your server.
The localnet will consist of the public ip/netmask of your server.

vi /etc/asterisk/sip.conf
externip = 10.66.226.132
localnet=192.168.1.0/255.255.255.0


Step:-15
Run this perl script to update the server_ip fields in the asterisk tables (copy the command as-is)

/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15

Update music on hold configuration

nano /etc/asterisk/musiconhold.conf
;
; Music on Hold -- Sample Configuration
;

[default]
mode=files
directory=/var/lib/asterisk/mohmp3

[quiet]
mode=files
directory=/var/lib/asterisk/quiet-mp3

#include musiconhold-vicidial.conf

* There are other sample configration files in /usr/src/astguiclient/docs/conf_examples/ that you might want to look at and maybe copy from and customize.

Lastly, reboot the machine

reboot
-------------------------------------------------------------------------------------------


Debugging and reference :-


Weblinks Need To Follow:-

http://techgobind.blogspot.in/2012/01/how-to-install-vicidialastguiclient-221.html

http://striker24x7.blogspot.in/2013/04/step-by-step-guide-to-install-vicidial.html

http://asterisk-vicidial.blogspot.in/

Sangoma Downloads:-

wget ftp://ftp.sangoma.com/linux/RPMS/2.6.2.3/wanpipe-util-3.5.4.8-0.i686.rpm

wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz

http://wiki.sangoma.com/wanpipe-linux-asterisk-dahdi

Perl Issue:-


http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,26/func,view/id,54739/

http://www.perlmonks.org/bare/?node_id=1083189

http://www.perlmonks.org/?node_id=1083189

wget http://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/CPAN-Meta-Requirements-2.125.tar.gz

Perl Module Related Things:-
yum install perl-CPAN


tar zxfv CPAN-Meta-Requirements-2.125.tar.gz
cd CPAN-Meta-Requirements-2.125
perl Makefile.PL
make all
make test && sudo make install


NOTE:-If There is a issue on incoming call or asterisk perl integration
cpan -i Asterisk::AGI''





 GRANT all on db.* TO asterisk@localhost IDENTIFIED BY 'asterisk';

perl -MCPAN -e shell

    install MD5

yum install 'perl(CGI)' 'perl(LWP::UserAgent)'

http://www.stableit.ru/2010/12/centos-php-516-eaccelerator-0961.html

/usr/src/eaccelerator-0.9.6.1/ea_store.c: In function 'store_property_access_check':
/usr/src/eaccelerator-0.9.6.1/ea_store.c:683: error: 'zend_property_info' has no member named 'ce'



vi +683 ea_store.c
//return (child_info->ce != from);
make && make install


Kernel issue Solution:-

http://wiki.centos.org/HowTos/I_need_the_Kernel_Source

yum install kernel-xen-devel

https://linuxmoz.com/asterisk-you-do-not-appear-to-have-the-sources-for-kernel-installed/



yum update
Install the kernel headers & kernel devel on CentOS / RHEL:


yum install kernel-devel kernel-headers
Reboot and attempt to rebuild Asterisk / DHADI tools, if it still fails check your kernel version with:


uname -r
And then check the linked kernel source:


cd /lib/modules/`uname -r`
Check the symbolic link with:


ls -l
If the link is broken fix it with:


ln -s /usr/src/kernels/(kernel-source-dir) build
Ubuntu / Debian Install Kernel Source for Asterisk


Dwibendu Moharana | www.interbitsolutions.com | Mohali | India | 
Contact :+91-8147023033 | USA- +1-631-686-8462 | Skype - muntycse


LinkedIn:-https://in.linkedin.com/in/dwibendumoharana

Friday, 17 February 2017

Dahdi E1 Configuration


Step:1

vi /etc/modprobe.d/dahdi.conf
and add
options wct12xp default_linemode=e1

service asterisk stop
service dahdi restart
service asterisk start

Step:2
modprobe wcte43x default_linemode=e1
dahdi_cfg -vv


options wct4xxp default_linemode=e1
options wcte43x default_linemode=e1



modprobe wct4xxp default_linemode=e1
http://kb.digium.com/articles/Configuration/How-to-Install-and-Configure-a-Digium-TE13x-Single-Span-T1-E1-Card


http://kb.digium.com/articles/Configuration/How-to-configure-a-Digium-E1-PRI-card

How to configure a Digium E1 PRI card

Digium Digital Series cards have a variety of configuration options. This KB artcile provides configurations for T1 ISDN PRI. These sample configurations are provided to assist you in familiarizing yourself with the flexibility of editing the configuration files to meet your specific needs. Please make sure to confirm with your Telco or System Administaror the proper line configuration that the needs to match.
Configuring E1 (DAHDI)

Set the driver to E1 mode, Open /etc/modprobe.d/dahdi.conf and add default_linemode=e1 paramther
If you have single span card
options wcte13xp default_linemode=e1
options wcte12xp default_linemode=e1


If you have a dual/Quad/Octal span card:
options wct4xxp default_linemode=e1
Open the system.conf file from the /etc/dahdi directory.
Specify the two letter country code for your loadzone and defaultzone. This will preload tone zone data and specify a default tone zone for your interfaces.
The following is a typical setup for a telco in the UK:
loadzone = uk
defaultzone = uk

Configure the SPAN Map.
For each T1/E1 you are using, you will need to define a span. The SPAN map includes defining the SPAN number, timing, line build out, framing, and coding. Configuration details for each of these items is in this section.

span => <Number>,<Timing>,<Line Build Out>,<Framing>,<Coding>[,Yellow]

The following is a typical setup for a telco in the EU:
span=1,1,0,ccs,hdb3,crc4

Specify the channel definitions.
The format is: <device> = <channel list>

The following is a typical setup for a T1 PRI in the US:
bchan = 1-23
dchan = 24
Specify the echo canceller to be used for each channel.
The format is: echocanceller = <echocanceller name>,<channel(s)>

DAHDI uses modular echo cancellers that are configured per channel. The echo cancellers are compiled and installed as part of the dahdi­ linux package. You can specify the echo canceller to be used for each channel. The default behavior is for there to be no echo canceller on any channel. So, it is very important that you specify one in the system.conf file if you do not have hardware echo cancellers and need echo cancellation.
DAHDI example configuration (/etc/dahdi/system.conf)

span=1,1,0,ccs,hdb3,crc4
bchan=1-15,17-31
dchan=16
echocanceller=mg2,1-15,17-31

# Uncomment the following lines if you have a Dual Span card
#span=2,2,0,ccs,hdb3,crc4
#bchan=32-46,48-62
#dchan=47
#echocanceller=mg2,32-46,48-62

# Uncomment the following lines if you have a Quad Span card
#span=3,3,0,ccs,hdb3,crc4
#bchan=63-77,79-93
#dchan=78
#echocanceller=mg2,63-77,79-93

#span=4,4,0,ccs,hdb3,crc4
#bchan=94-108,110-124
#dchan=109
#echocanceller=mg2,94-108,110-124
# Uncomment the following lines if you have a Octal Span card
#span=4,4,0,ccs,hdb3,crc4
#bchan=94-108,110-124
#dchan=109
#echocanceller=mg2,94-108,110-124

#span=5,5,0,ccs,hdb3,crc4
#bchan=125-139,141-155
#dchan=140
#echocanceller=mg2,125-139,141-155

#span=6,6,0,ccs,hdb3,crc4
#bchan=156-170,172-186
#dchan=171
#echocanceller=mg2,156-170,172-186

#span=7,7,0,ccs,hdb3,crc4
#bchan=187-201,203-217
#dchan=202
#echocanceller=mg2,187-201,203-217

#span=8,8,0,ccs,hdb3,crc4
#bchan=218-232,234-248
#dchan=233
#echocanceller=mg2,218-232,234-248
loadzone = uk
defaultzone = uk

Configuring Card Features (Asterisk)

Begin by opening the system.conf file from the /etc/dahdi directory.
Set Echo Cancellation parameters
echocancel = yes
echocancelwhenbridged=no
Select the Signalling Type
signalling = pri_cpe

There are other signaling types that can be used: pri_cpe for CPE side and pri_net for NET side, If you plan to use NET, please make sure to set the proper timing sources in DAHDI, Usually the NET always provide timing
Select the Switchtype
switchtype = euroisdn

Select the DialPlan context in which your incoming calls will be handled (usually From-PSTN)
context = from-pstn

The context is the an specific section on the Asterisk dialplan that calls will be sent for processing,.See extension.conf  in order to determine which context are available
Configure the channels
The format is: channels => <Number>[-<Number>]
Asterisk Example Configuration





group=0
echocancel = yes
echocancelwhenbridged=no
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
;
; Uncomment the following lines if you have a Dual Span card
;
;channel => 32-46,48-62
;
; Uncomment the following lines if you have a Quad Span card
;
;channel => 63-77,79-93
;channel => 94-108,110-124
; ; Uncomment the following lines if you have a Octal Span card
; ;channel => 125-139,141-155
;channel => 156-170,172-186
;channel => 187-201,203-217
;channel => 218-232,234-248


Dwibendu Moharana | www.interbitsolutions.com | Mohali | India | 
Contact :+91-8147023033| USA- +1-631-686-8462 | Skype - muntycse


LinkedIn:-https://in.linkedin.com/in/dwibendumoharana

Asterisk On Centos


Step:1
yum update -y


Step:2
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config


Step:3
reboot


Step:4
yum install -y make wget openssl-devel ncurses-devel  newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel


Step:5
cd /usr/src/

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
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz

OR

wget http://iindya.com/archive/packages/dahdi-linux-complete-current.tar.gz
wget http://iindya.com/archive/packages/libpri-1.4-current.tar.gz
wget http://iindya.com/archive/packages/asterisk-11-current.tar.gz


Step:6
tar zxvf dahdi-linux-complete*
tar zxvf libpri*
tar zxvf asterisk*


Step:7
cd /usr/src/dahdi-linux-complete*
make && make install && make config


Step:8
cd /usr/src/libpri*
make && make install



Step:9
cd /usr/src/asterisk*

./configure && make menuselect && make && make install

./configure --libdir=/usr/lib64 && make menuselect && make && make install

make clean && make distclean

contrib/scripts/get_mp3_source.sh


make samples

make config

service dahdi start

service asterisk start

asterisk -rvvv

Dwibendu Moharana | www.interbitsolutions.com | Mohali | India | 
Contact :+91-8147023033| USA- +1-631-686-8462 | Skype - muntycse
LinkedIn:-https://in.linkedin.com/in/dwibendumoharana

mysql-too-many-connectionsq-error-in-vicidial-server


Step1

First check the maximum connections allowed.

Step2

Go to Mysql prompt and type the below command:
mysql > show variables like “max_connections”;



You should get following result:

+—————–+——-+

| Variable_name   | Value |

+—————–+——-+

| max_connections | 100   |

+—————–+——-+

Step3

You can change the limit to higher value just by the below command without restarting the mysql ,but this will temporary until next reboot or restart of mysql server.
set global max_connections = 300;



For permanent effect:

Go to the /etc/my.cnf file and add the below lines and restart the mysql service.

max_connections = 200


Dwibendu Moharana | www.interbitsolutions.com | Mohali | India | 
Contact :+91-8147023033| USA- +1-631-686-8462 | Skype - muntycse