Thursday, June 11, 2015

How to build OpenVCS (Telepresence) on CentOS64

Use this OpenVCS:
http://code.google.com/p/openvcs/ (redirected to https://code.google.com/p/telepresence/?redir=1, version "last updated December 2014”). This version is said to be tested on CentOS64)

Build/install on VirtualBox

Get CentOS image
http://virtualboxes.org/images/centos/
(use CentOS 6.6 minimal x86_64, which is current version in December 2014)

Build and install according to https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode

OpenSSL is not built, because current version is valid

libogg, libvorbis and libtheora are not built, since they are optional.

libfaac make failed, and ffmpeg cannot be installed without this, so:
Remove line 126 from mpeg4ip.h then build (http://stackoverflow.com/questions/4320226/installing-faac-on-linux-getting-errors)

OpenAL Soft is not built, because it is optional (for 3D audio)

openOffice is optional and not built yet

When using WebRTC from Chrome connection cannot be made due to "WS handshaking not done yet” error, so modify tsip_transport_layer.c in doubango as follows (see https://code.google.com/p/telepresence/issues/detail?id=22)

Line 367:
                case event_accepted:
                case event_connected:
                        {
                                tsip_transport_stream_peer_t* peer;
                                // find peer
                                if((peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))){
                                        // If peer already exists.. do nothing :0
                                        return  0;
                                }
                                else {
                                        TSK_DEBUG_INFO("WebSocket Peer accepted/connected with fd = %d", e->local_fd);
                                        return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
                                }
                        }

Doubango needs SSL to be enabled during built, otherwise, WebRTC will be connected but ended in "not acceptable”, and telepresence log will show "Remote party requesting DTLS but it is not enabled” error (see https://code.google.com/p/doubango/wiki/Building_Source_v2_0)
OpenSSL is pre-installed on CentOS but Doubango needs header files, so install openssl-devel first:
sudo yum install openssl-devel 

Then configure doubango with SSL:
./autogen.sh && ./configure --with-ssl --with-srtp --with-speexdsp --with-ffmpeg
and then build doubango.

SSL certificate (self-signed is OK) needs to be created:
https://code.google.com/p/telepresence/wiki/Configuration_Security
So, set SSL certificate:
ssh-keygen -b 1024 -f root -t dsa
Then point setting at /usr/local/sbin/telepresence.cfg to locations of pem files created above.

Telepresence make will fail with undefined reference at libtinySAK, so edit Makefile, change this LDFLAGS line:
LDFLAGS= -L/opt/openoffice4/sdk/lib
to:
LDFLAGS= -L/opt/openoffice4/sdk/lib -WI,-rpath,/usr/lib -ldl
(see http://sourceforge.net/p/cppunit/bugs/201/)

Remove openssl-devel to prevent problems with dual installation of openssl:
sudo yum remove openssl-devel

Make sure iptables is disabled to allow connections:
sudo /etc/init.d/iptables stop
(To turn off firewall on boot, do this:
chkconfig iptables off)

Edit transport configuration entry at /usr/local/sbin/telepresence.cfg, better add ip address instead of leaving the asterisks because it seems to get 0.0.0.0 as IP address, and uncomment all transport configuration entries (see https://code.google.com/p/telepresence/wiki/Support_Testing_the_system)

Start telepresence (if —config is not specified, it does not seem to use the cfg file provided by “make samples”):
telepresence —config=/usr/local/sbin/telepresence.cfg
Then log data will be shown.

Test using WebRTC. https://code.google.com/p/telepresence/wiki/Support_Testing_the_system). Access http://conf-call.org, go to settings, set the IP address of telepresence, then call.