Difference between revisions of "External Recordings Server"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 43: Line 43:
   svn co http://svn.kolmisoft.com/mor/install_script/trunk/ /usr/src/mor
   svn co http://svn.kolmisoft.com/mor/install_script/trunk/ /usr/src/mor


2. Install GNU Compiler Collection:
2. Install GNU Compiler Collection and wget:


   yum -y install gcc
   yum -y install gcc wget


3. Install Wget:


  yum -y install wget
3. Install Apache (change MOR version accordingly in the script):
 
4. Install Apache (change MOR version accordingly in the script):


   /usr/src/mor/x8/gui/apache_install.sh
   /usr/src/mor/x8/gui/apache_install.sh
Line 58: Line 55:
   /etc/init.d/iptables save
   /etc/init.d/iptables save


5. Install MySQL (change MOR version accordingly in the script):
4. Install MySQL (change MOR version accordingly in the script):


   /usr/src/mor/x8/mysql/mysql_install.sh
   /usr/src/mor/x8/mysql/mysql_install.sh


6. Create needed directories and permissions:
5. Create needed directories and permissions:


   mkdir -p /var/log/mor
   mkdir -p /var/log/mor
Line 71: Line 68:
   chmod 777 -R /usr/local/mor/
   chmod 777 -R /usr/local/mor/


7. Install scripts (change MOR version accordingly in the script):
6. Install scripts (change MOR version accordingly in the script):


   cd /usr/src/mor/x8/scripts/
   cd /usr/src/mor/x8/scripts/
Line 87: Line 84:
   chkconfig --level 2345 mor_server_loadstats on
   chkconfig --level 2345 mor_server_loadstats on


8. Install Lame (change MOR version accordingly in the script):
7. Install Lame (change MOR version accordingly in the script):


   /usr/src/mor/x8/helpers/lame_install.sh
   /usr/src/mor/x8/helpers/lame_install.sh


9. Symlink directories:
8. Symlink directories:


   ln -s /usr/local/mor/recordings /var/www/html/recordings
   ln -s /usr/local/mor/recordings /var/www/html/recordings


10. Create configuration files:
9. Create configuration files:


   cd /etc/mor/
   cd /etc/mor/
Line 132: Line 129:
Save file.
Save file.


11. Edit ''/etc/httpd/conf/httpd.conf''
10. Edit ''/etc/httpd/conf/httpd.conf''


Change from:
Change from:
Line 160: Line 157:
       AllowOverride '''All'''
       AllowOverride '''All'''


12. Run:
11. Run:


   chcon -R -h -t httpd_sys_content_t /var/www/html/recordings/
   chcon -R -h -t httpd_sys_content_t /var/www/html/recordings/
   service httpd restart
   service httpd restart


13. Edit ''/etc/selinux/config''
12. Edit ''/etc/selinux/config''


Change from:
Change from:
Line 175: Line 172:
   SELINUX=disabled
   SELINUX=disabled


14. Reboot server:
13. Reboot server:


   reboot
   reboot

Revision as of 13:04, 11 July 2018

Configuration

External Recordings Server allows to convert and store Recordings in external server thus increasing storage space on switch server (Asterisk). It will also reduce load on switch server because wav to mp3 convertion is executed in external server.


NOTE: Configuration applies ONLY for fresh CentOS 6 server.


Configuration in GUI

External Recordings Server can be configured in Recordings -> Settings

Recordings external server.png

Check 'User external Server' checkbox, enter external server IP, SSH port and login username.

NOTE: make sure that servers are configured with SSH keys! Login by password will not work for External Recordings Server.

In SETTINGS -> Billing -> Servers add new server, where

"Hostname for SIP" and "Server IP for SIP" are External Recordings Server IP,

"Type" is "Other",

"GUI" and "DB" are disables (red cross).


Configuration in Database server

In Database Server create MySQL user for External Recordings Server:

 CREATE USER 'mor'@'IP_OF_RECORDINGS_SERVER' IDENTIFIED BY 'mor';
 GRANT ALL PRIVILEGES ON `mor`.* TO 'mor'@'IP_OF_RECORDINGS_SERVER' WITH GRANT OPTION ;


Configuration in External Recordings server

1. Dowload sources:

 yum -y install subversion
 svn co http://svn.kolmisoft.com/mor/install_script/trunk/ /usr/src/mor

2. Install GNU Compiler Collection and wget:

 yum -y install gcc wget


3. Install Apache (change MOR version accordingly in the script):

 /usr/src/mor/x8/gui/apache_install.sh
 /usr/src/mor/x8/gui/apache_uid_fix.sh
 iptables -F
 /etc/init.d/iptables save

4. Install MySQL (change MOR version accordingly in the script):

 /usr/src/mor/x8/mysql/mysql_install.sh

5. Create needed directories and permissions:

 mkdir -p /var/log/mor
 chmod 777 -R /var/log/mor
 mkdir -p /etc/mor/
 mkdir -p /var/lib/asterisk/agi-bin/
 mkdir -p /usr/local/mor/recordings/
 chmod 777 -R /usr/local/mor/

6. Install scripts (change MOR version accordingly in the script):

 cd /usr/src/mor/x8/scripts/
 gcc -Wall -Wunused -g -I/usr/include/mysql mor_record_remote.c -o mor_record_remote -lmysqlclient -lnsl -lm -lz -L/usr/lib/mysql -L/usr/lib64/mysql
 cp -fr mor_record_remote /usr/local/mor
 rm -rf mor_record_control
 gcc -Wall -g -I/usr/include/mysql mor_record_control.c -o mor_record_control -lmysqlclient -lnsl -lm -lz -L/usr/lib/mysql -L/usr/lib64/mysql
 cp -fr mor_record_control /usr/local/mor
 
 gcc -Wall -g -o mor_server_loadstats mor_server_loadstats.c -L/usr/lib/mysql -L/usr/lib64/mysql -lmysqlclient -lpthread
 cp -fr mor_server_loadstats /usr/local/mor/mor_server_loadstats
 cp -fr mor_server_loadstats_service /etc/init.d/mor_server_loadstats
 chmod +x /etc/init.d/mor_server_loadstats
 chkconfig --add mor_server_loadstats
 chkconfig --level 2345 mor_server_loadstats on

7. Install Lame (change MOR version accordingly in the script):

 /usr/src/mor/x8/helpers/lame_install.sh

8. Symlink directories:

 ln -s /usr/local/mor/recordings /var/www/html/recordings

9. Create configuration files:

 cd /etc/mor/

Create file:

 vi system.conf

Enter:

 # database connection settings
 dbhost = Database_server_IP
 dbname = mor
 dbuser = mor
 dbsecret = mor
 dbport = 3306
 
 server_id = unique server ID; same as on GUI

Save file.

 cd /var/lib/asterisk/agi-bin/

Create file:

 vi mor.conf

Enter:

 host = Database_server_IP
 db = mor
 user = mor
 secret = mor
 port = 3306

Save file.

10. Edit /etc/httpd/conf/httpd.conf

Change from:

 <Directory />
     Options FollowSymLinks
     AllowOverride None
 </Directory>

To:

 <Directory />
     Options FollowSymLinks
     AllowOverride All
 </Directory>

And change from:

 # AllowOverride controls what directives may be placed in .htaccess files.
 # It can be "All", "None", or any combination of the keywords:
 #   Options FileInfo AuthConfig Limit
 #
     AllowOverride None

To:

     AllowOverride All

11. Run:

 chcon -R -h -t httpd_sys_content_t /var/www/html/recordings/
 service httpd restart

12. Edit /etc/selinux/config

Change from:

 SELINUX=enforcing

To:

 SELINUX=disabled

13. Reboot server:

 reboot


Troubleshooting

If Recordings are not displayed in GUI check the following log files in both servers:

/var/log/mor/mor_record_file.log
/var/log/mor/record_file.log