Showing posts with label FreeSwitch. Show all posts
Showing posts with label FreeSwitch. Show all posts

Tuesday, August 20, 2013

Enabling presence in Freeswitch

Enabling presence in Freeswitch

If we want FreeSWITCH to be able to manage "Peer to Peer" presence, we will enable the presence option in, at least, internal.xml and external.xml profiles. The "manage-presence" parameter only must be set up to true inside internal.xml, for the rest of profiles we will set it up to passive. As a shared database for shared presence we can use "share_presence" (this is a SQLite database that comes with FS installation). We must also add our server dns hostname (or our server public IP) to the "presence-hosts" variable. Our internal.xml file should have this configuration about presence:
<param name="manage-presence" value="true"/>
<param name="send-presence-on-register" value="true"/>
<param name="presence-probe-on-register" value="true"/>
<param name="presence-proto-lookup" value="true"/>
<param name="manage-shared-appearance" value="true"/>
<param name="dbname" value="share_presence"/>
<param name="presence-hosts" value="$${domain}"/>
<param name="force-register-domain" value="$${domain}"/>
<param name="force-register-db-domain" value="$${domain}"/>
Our external.xml file should have this configuration about presence:
<param name="manage-presence" value="passive"/>
<param name="manage-shared-appearance" value="true"/>
 <param name="dbname" value="share_presence"/>
<param name="presence-hosts" value="$${domain}"/>
<param name="force-register-domain" value="$${domain}"/>
<param name="force-register-db-domain" value="$${domain}"/>
With this configuration our FreeSWITCH should be able to manage presence correclty. If you are getting errors and want to debug, for FS to include presence debug in its log, set up the "debug-presence" parameter in the file "/usr/local/freeswitch/conf/autoload_configs/sofia.conf.xml" as follows:
<param name="debug-presence" value="0"/>
You can more information about presence for FS here sofia.conf.xml, and FS presence.

Friday, September 14, 2012

FreeSWITCH Installation

FreeSWITCH Installation 
#############################################
#        FreeSWITCH Installation            #
#############################################

# Install GIT and dependencies
cd /usr/src
yum -y install gcc-c++ gettext-devel expat-devel curl-devel zlib-devel openssl-devel bzip2
yum -y install autoconf automake libtool gcc-c++ ncurses-devel make expat-devel zlib zlib-devel libjpeg-devel
# GIT Install
wget http://git-core.googlecode.com/files/git-1.7.9.5.tar.gz && tar xzvf git-1.7.9.5.tar.gz && cd git-1.7.9.5 && make prefix=/usr/local all && make prefix=/usr/local install
cd ..

# Download Git trunk
git clone git://git.freeswitch.org/freeswitch.git freeswitch-git
cd freeswitch-git
./bootstrap.sh
vim modules.conf // enable xml_curl and disable uncessary modules
./configure
make
make install
make sounds-install
make moh-install
make samples
vim /usr/local/freeswitch/conf/autoload_configs/modules.conf //again enable/disable necessary modules
cd /usr/local/freeswitch/bin/
./freeswitch -nonat

## iSWITCH performance & Optimization ##
mv db/ db_old
mkdir db
mount -t tmpfs tmpfs /usr/local/freeswitch/db
df -h
# to remove ramdisk
umount -lt tmpfs /usr/local/freeswitch/db

#increase ulimits
ulimit -c unlimited;
ulimit -d unlimited;
ulimit -f unlimited;
ulimit -i unlimited;
ulimit -n 999999;
ulimit -q unlimited;
ulimit -u unlimited;
ulimit -v unlimited;
ulimit -x unlimited;
ulimit -s 244;
ulimit -l unlimited;
ulimit -a;

# Freeswitch troubleshooting
#to stop freeswitch
... (three dots on freeswitch console)
#to start freeswitch
cd /usr/local/freeswitch/bin
./freeswitch -nonat