November 14th, 2013 by Gia
*Disabled SELinux
[[email protected] ~]# vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=disabled
[[email protected] ~]# reboot (to affect SElinux config)

*Download and install Openfire
[[email protected] ~]# yum -y install wget mysql-server glibc.i686
[[email protected] ~]# wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.8.2
2-1.i386.rpm
[[email protected] ~]# rpm -ivh openfire-3.8.2-1.i386.rpm
Preparing...                ########################################### [100%]
   1:openfire               ########################################### [100%]
[[email protected] ~]# service openfire start
Starting openfire:
[[email protected] bin]# service openfire status
openfire is running
[[email protected] bin]# chkconfig --level 2345 openfire on

*Disabled firewall for temporary :
[[email protected] ~]# service iptables stop
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
[[email protected] ~]# chkconfig --level 2345 iptables off

*Setup MySQL
[[email protected] ~]# service mysqld start
[[email protected] ~]# mysql_secure_installation
[[email protected] ~]# mysqladmin -uroot -p
mysql> create database openfire;
Query OK, 1 row affected (0.06 sec)
mysql> grant all privileges on openfire.* to 'openfire'@'localhost' identified by 'openfirepassword';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
[[email protected] ~]# chkconfig --level 2345 mysqld on

If get error like this (or Openfire can’t start) :

[[email protected] bin]# ./openfire.sh
./openfire.sh: /opt/openfire/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
./openfire.sh: line 165: /opt/openfire/jre/bin/java: Success

Install a glibc.i686 using YUM

[[email protected] ~]# yum -y install glibc.i686
Tags: , , ,
Posted in centOS, Linux | Comments Off on Openfire 3.8.2 on CentOS 6.4 (64bit minimal) – 1
September 15th, 2013 by Gia

Environment :
– CentOS 6.4 (64bit)
– FreeSWITCH 1.5.6b git fb238ed 2013-09-13 15:44:10Z
– FusionPBX 3.3

This error will shown if you using https to access FusionPBX

Freeswitch log :

2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:365 Got error [404] posting to web server [http://127.0.0.1/app/xml_cdr/v_xml_cdr_import.php]
2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:372 Retry will be with url [http://127.0.0.1/app/xml_cdr/v_xml_cdr_import.php]
2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:383 Unable to post to web server, writing to file

Fix it :D

vi /usr/local/freeswitch/conf/autoload_configs/xml_cdr.conf.xml

Change http with https (in url parameter) :

FusionPBX CDR

Don’t forget to reloadxml in fs_cli :D

Tags: ,
Posted in centOS, freeswitch, Linux, VOIP | Comments Off on FusionPBX CDR Apps error
September 5th, 2013 by Gia

Query to generate CSV file :

mysql> SELECT * FROM tablename
INTO OUTFILE '/tmp/csvfile.csv'
FIELDS terminated by ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Error when user don’t have privilege to create file :

mysql>SELECT * FROM tablename
INTO OUTFILE '/tmp/csvfile.csv'
FIELDS terminated by ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
ERROR 1045 (28000): Access denied for user 'demo'@'localhost' (using password: YES)

Add grant to create file (execute using root user or user with grant option) :

mysql> GRANT FILE ON *.* TO 'demo'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql>FLUSH PRIVILEGES;

** GRANT FILE only works with ON *.*

If you want delete, remove or revoke GRANT file :

mysql> REVOKE FILE on *.* FROM 'demo'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql>FLUSH PRIVILEGES;
Tags: ,
Posted in Database, MySQL | Comments Off on Generate CSV from MySQL
May 27th, 2013 by Gia

RB951G-2HND + Huawei E272Environment :

  • RB951G-2HnD
  • RouterOS v6.0
  • Huawei E272

Installation step :

  1. Plug a modem to USB Port
  2. Check a modem in Resources – USB menu from Winbox
    MKT-Huawei02 Read the rest of this entry »
Tags: ,
Posted in Hardware, Mikrotik | Comments Off on MikroTik RB951G-2HND & Huawei E272
May 9th, 2013 by Gia
** add EPEL Repository
[[email protected] /]# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
[[email protected] /]# rpm -ivh epel-release-5-4.noarch.rpm

** freeswitch prerequisites
[[email protected] /]# yum -y install git autoconf automake libtool ncurses-devel libjpeg-devel
[[email protected] /]# yum -y install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel libdb-devel uuid-devel @development-tools

[[email protected] /]# cd /usr/local/src
[[email protected] src]# git clone git://git.freeswitch.org/freeswitch.git
[[email protected] src]# cd freeswitch

[[email protected] freeswitch]# ./configure -prefix=/opt/freeswitch
[[email protected] freeswitch]# make
[[email protected] freeswitch]# make all install cd-sounds-install cd-moh-install

**create init script
[[email protected] freeswitch]# adduser freeswitch -g daemon -d /opt/freeswitch
[[email protected] freeswitch]# chown -R freeswitch:daemon /opt/freeswitch/
[[email protected] freeswitch]# chmod -R o-rwx /opt/freeswitch/
[[email protected] freeswitch]# cp /usr/local/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
[[email protected] freeswitch]# chmod +x /etc/init.d/freeswitch
[[email protected] freeswitch]# chkconfig --level 345 freeswitch on
[[email protected] freeswitch]# vi /etc/init.d/freeswitch

** running freeswitch
[[email protected] /]# service freeswitch start
[[email protected] /]#

Freeswitch init Script sample

Source :
http://wiki.freeswitch.org/wiki/Linux_Quick_Install_Guide
http://wiki.freeswitch.org/wiki/Freeswitch_init

Tags: ,
Posted in centOS, freeswitch, Linux, VOIP | Comments Off on freeswitch on CentOS 5.9
March 26th, 2013 by Gia
[email protected]:~# pveversion -v
pve-manager: 2.3-13 (pve-manager/2.3/7946f1f1)
running kernel: 2.6.32-19-pve
proxmox-ve-2.6.32: 2.3-93
pve-kernel-2.6.32-16-pve: 2.6.32-82
pve-kernel-2.6.32-19-pve: 2.6.32-93
lvm2: 2.02.95-1pve2
clvm: 2.02.95-1pve2
corosync-pve: 1.4.4-4
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.93-2
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.9-1
pve-cluster: 1.0-36
qemu-server: 2.3-18
pve-firmware: 1.0-21
libpve-common-perl: 1.0-49
libpve-access-control: 1.0-26
libpve-storage-perl: 2.3-6
vncterm: 1.0-3
vzctl: 4.0-1pve2
vzprocps: 2.0.11-2
vzquota: 3.1-1
pve-qemu-kvm: 1.4-8
ksm-control-daemon: 1.1-1
[email protected]:~#

Change VMID from 902 to 202
Proxmox 01

  1. Stop/Shutdown a VM.
  2. Login using SSH to Proxmox Machine or using Shell menu in Web Interface.
  3. Read the rest of this entry »

Tags:
Posted in Proxmox | 2 Comments »
February 28th, 2013 by Gia

Environment :

  • CentOS 6.2 64bit
  • Asterisk 1.8.20.1
  • Asterisk machine (VM) behind NAT (Port Forwading)
  • Public IP : 114.13.10.85
  • Asterisk local IP : 10.10.10.1

CLI Log :

[Feb 28 09:28:22] WARNING[13394]: chan_sip.c:3974 retrans_pkt: Retransmission timeout reached on transmission ce69b44af71ba023NjgzZjFiNTY1MDc5MGJhNzA0ZjBjN2RiZjVlMzUzOTc. for seqno 1 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 16576ms with no response
[Feb 28 09:28:35] WARNING[13394]: chan_sip.c:3974 retrans_pkt: Retransmission timeout reached on transmission aa68952b465def6eNjgzZjFiNTY1MDc5MGJhNzA0ZjBjN2RiZjVlMzUzOTc. for seqno 1 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 16575ms with no response

Step to fix problem :

  • Change sip.conf (/etc/asterisk/) configuration, add this line :
localnet = 10.10.10.0/255.255.255.0
externaddr = 114.13.10.85
  • Reload Asterisk configuration
[[email protected] ~]# asterisk -vvvvvr
ivr*CLI> reload
Tags: , ,
Posted in Asterisk, centOS, Linux, VOIP | Comments Off on Asterisk 1.8.20.1 (CentOS 6.2 64bit) behind NAT