<commit_before>============================
CentOs 7 Installation
============================

**Install base packages**
::

 yum update
 yum groupinstall "Development tools" -y
 
 #Enable epel and freeswitch repository
 yum install epel-release
 rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
 yum update

**Install Freeswitch**

**1. Install Freeswitch pre-requisite packages**
::

 #Install dependencies for freeswitch
 yum install -y wget git autoconf automake expat-devel yasm gnutls-devel libtiff-devel libX11-devel unixODBC-devel 
 python-devel zlib-devel alsa-lib-devel libogg-devel libvorbis-devel uuid-devel @development-tools gdbm-devel 
 db4-devel libjpeg libjpeg-deve compat-libtermcap ncurses ncurses-devel ntp screen sendmail sendmail-cf gcc-c++
 @development-tools bison bzip2 curl curl-devel dmidecode git make mysql-connector-odbc openssl-devel unixODBC 
 zlib pcre-devel speex-devel sqlite-devel ldns-devel libedit-devel bc e2fsprogs-devel libcurl-devel libxml2-devel 
 libyuv-devel opus-devel libvpx-devel libvpx2* libdb4* libidn-devel unbou-nd devel libuuid-devel lua-devel libsndfile-devel


**2. Download latest freeswitch version**
::
  
  cd /usr/local/src
  git config --global pull.rebase true

  #Clone freeswitch version 1.6.19 from git 
  git clone -b v1.6.19 https://freeswitch.org/stash/scm/fs/freeswitch.git
  cd freeswitch
  ./bootstrap.sh -j


**3. Edit modules.conf**
::

   #Enabling mod_xml_curl, mod_json_cdr, mod_db
    sed -i "s#\#xml_int/mod_xml_curl#xml_int/mod_xml_curl#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#mod_db#mod_db#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#event_handlers/mod_json_cdr#event_handlers/mod_json_cdr#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#applications/mod_voicemail#applications/mod_voicemail#g" /usr/local/src/freeswitch/modules.conf


.. note:: # add a module by removing '#' comment character at the beginning of the line 
          # remove a module by inserting the '#' comment character at the beginning of the line containing the name of 
          the module to be skipped
          

**4. Compile the Source** 
::

  ./configure -C
          
          
**5. Install Freeswitch with sound files** 
::

   make all install cd-sounds-install cd-moh-install
   make && make install
  

**6. Set right time in server** 
::

   ntpdate pool.ntp.org
   systemctl restart ntp
   chkconfig ntp on


**7. Create symbolic links for Freeswitch executables** 
::

   ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/freeswitch
   ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/fs_cli


**ASTPP Install**

**1. Download ASTPP** 
::

   # Download ASTPP 3.6 source from git
     cd /usr/src
     git clone -b v3.6 https://github.com/iNextrix/ASTPP

**2. Change Apache working scenario** 
::
  
    As we are using Nginx from now onwards from ASTPP 3.0, if you are using apache for any applicaion then-
    either have to move it to Nginx and/or remove apache. You can also change default port for apache if want to use-
    it continue and troubleshoot some installation issue if arise.

**3. Install ASTPP pre-requisite packages** 
::
  
    #php7.0 repository
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum install yum-utils
    yum-config-manager --enable remi-php70
    yum update
    
    yum install -y autoconf automake bzip2 cpio curl nginx php-fpm php-mcrypt* unixODBC mysql-connector-odbc curl-devel php 
    php-devel php-common php-cli php-gd php-pear php-mysql php-mbstring sendmail sendmail-cf php-pdo php-pecl-json mysql
    mariadb-server mysql-devel libxml2 libxml2-devel openssl openssl-devel gettext-devel fileutils gcc-c++


**4. Normalize ASTPP** 
::
  
   #Create access & error log files.
   touch /var/log/nginx/astpp_access_log
   touch /var/log/nginx/astpp_error_log
   touch /var/log/nginx/fs_access_log
   touch /var/log/nginx/fs_error_log			
   systemctl restart php-fpm
   service nginx reload


**ASTPP using FreeSWITCH (if you want to use ASTPP with FreeSWITCH)**

**1. Configure freeswitch startup script** 
::

  cp /usr/src/latest/freeswitch/init/freeswitch.centos.init /etc/init.d/freeswitch
  chmod 755 /etc/init.d/freeswitch
  chmod +x /etc/init.d/freeswitch
  chkconfig --add freeswitch
  chkconfig --level 345 freeswitch on
  mkdir /var/run/freeswitch
<commit_msg>[IMP] Added session checkup in status change process<commit_after>============================
CentOs 7 Installation
============================

**Install base packages**
::

 yum update
 yum groupinstall "Development tools" -y
 
 #Enable epel and freeswitch repository
 yum install epel-release
 rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
 yum update

**Install Freeswitch**

**1. Install Freeswitch pre-requisite packages**
::

 #Install dependencies for freeswitch
 yum install -y wget git autoconf automake expat-devel yasm gnutls-devel libtiff-devel libX11-devel unixODBC-devel \ 
 python-devel zlib-devel alsa-lib-devel libogg-devel libvorbis-devel uuid-devel @development-tools gdbm-devel \
 db4-devel libjpeg libjpeg-deve compat-libtermcap ncurses ncurses-devel ntp screen sendmail sendmail-cf gcc-c++ \
 @development-tools bison bzip2 curl curl-devel dmidecode git make mysql-connector-odbc openssl-devel unixODBC \
 zlib pcre-devel speex-devel sqlite-devel ldns-devel libedit-devel bc e2fsprogs-devel libcurl-devel libxml2-devel \
 libyuv-devel opus-devel libvpx-devel libvpx2* libdb4* libidn-devel unbou-nd devel libuuid-devel lua-devel libsndfile-devel


**2. Download latest freeswitch version**
::
  
  cd /usr/local/src
  git config --global pull.rebase true

  #Clone freeswitch version 1.6.19 from git 
  git clone -b v1.6.19 https://freeswitch.org/stash/scm/fs/freeswitch.git
  cd freeswitch
  ./bootstrap.sh -j


**3. Edit modules.conf**
::

   #Enabling mod_xml_curl, mod_json_cdr, mod_db
    sed -i "s#\#xml_int/mod_xml_curl#xml_int/mod_xml_curl#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#mod_db#mod_db#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#event_handlers/mod_json_cdr#event_handlers/mod_json_cdr#g" /usr/local/src/freeswitch/modules.conf
    sed -i "s#\#applications/mod_voicemail#applications/mod_voicemail#g" /usr/local/src/freeswitch/modules.conf


.. note:: # add a module by removing '#' comment character at the beginning of the line 
          # remove a module by inserting the '#' comment character at the beginning of the line containing the name of 
          the module to be skipped
          

**4. Compile the Source** 
::

  ./configure -C
          
          
**5. Install Freeswitch with sound files** 
::

   make all install cd-sounds-install cd-moh-install
   make && make install
  

**6. Set right time in server** 
::

   ntpdate pool.ntp.org
   systemctl restart ntp
   chkconfig ntp on


**7. Create symbolic links for Freeswitch executables** 
::

   ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/freeswitch
   ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/fs_cli


**ASTPP Install**

**1. Download ASTPP** 
::

   # Download ASTPP 3.6 source from git
     cd /usr/src
     git clone -b v3.6 https://github.com/iNextrix/ASTPP

**2. Change Apache working scenario** 
::
  
    As we are using Nginx from now onwards from ASTPP 3.0, if you are using apache for any applicaion then-
    either have to move it to Nginx and/or remove apache. You can also change default port for apache if want to use-
    it continue and troubleshoot some installation issue if arise.

**3. Install ASTPP pre-requisite packages** 
::
  
    #php7.0 repository
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum install yum-utils
    yum-config-manager --enable remi-php70
    yum update
    
    yum install -y autoconf automake bzip2 cpio curl nginx php-fpm php-mcrypt* unixODBC mysql-connector-odbc curl-devel php \ 
    php-devel php-common php-cli php-gd php-pear php-mysql php-mbstring sendmail sendmail-cf php-pdo php-pecl-json mysql \
    mariadb-server mysql-devel libxml2 libxml2-devel openssl openssl-devel gettext-devel fileutils gcc-c++


**4. Normalize ASTPP** 
::
  
   #Create access & error log files.
   touch /var/log/nginx/astpp_access_log
   touch /var/log/nginx/astpp_error_log
   touch /var/log/nginx/fs_access_log
   touch /var/log/nginx/fs_error_log			
   systemctl restart php-fpm
   service nginx reload


**ASTPP using FreeSWITCH (if you want to use ASTPP with FreeSWITCH)**

**1. Configure freeswitch startup script** 
::

  cp /usr/src/latest/freeswitch/init/freeswitch.centos.init /etc/init.d/freeswitch
  chmod 755 /etc/init.d/freeswitch
  chmod +x /etc/init.d/freeswitch
  chkconfig --add freeswitch
  chkconfig --level 345 freeswitch on
  mkdir /var/run/freeswitch

{'fraction_non_alphanumeric': 0.10959360426382411, 'fraction_numerical': 0.011547856984232734, 'mean_word_length': 3.413032827045566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1775877', 'n_tokens_mistral': 3414, 'n_tokens_neox': 3134, 'n_words': 859}