Install ChanSkype on FreePBX/Trixbox

Submitted by dcbour on June 19, 2007 - 10:29am.

This is my first posting (ever) so please, go easy on me.  I will state up front that this work is based on the input of several people and draws on those resources including the excellent script by Tim Hunt as well as feedback from ChanSkype themselves.

Once again, this is for a FreePBX (confirmed installation on Centos 4.4/4.5 and Trixbox 2.0/2.2 systems)

I've posted in bold the actual text to type.  Hopefully split lines are not a problem.

Begin, by ensuring the necessary packages are available...gcc, qt-devel, kernel-devel, asterisk-devel

yum install gcc qt-devel kernel-devel.i686 asterisk-devel

Next, download and install the Tim Hunt chanskype installation package

wget http://www.timhunt.net/stuff/chanskype/chanskype-trixbox.tgz
tar -zxf chanskype-trixbox.tgz
cd chanskype.trixbox
./install.sh

Once installed, you need to create accounts (aka channels in ChanSkype language...remember the personal license only supports 1, the business license is however many channels you buy

./makeaccount.sh 1

Now, based on the advise from ChanSkype their recommendation is to use RatPoison, a low overhead windows manager.  Tim's script already installed TWM.  The next stage removes TWM and replaces it with RatPoison

yum remove twm
wget http://savannah.nongnu.org/download/ratpoison/ratpoison-1.4.1.tar.gz
tar -zxf ratpoison-1.4.1.tar.gz
cd ratpoison-1.4.1
./configure
make
make install

Next, check to ensure the vncserver service will automatically start.  I've seen this already configured over half the time, but this will simply ensure it.

/usr/sbin/ntsysv

Find vncserver in the list, and mark it for autostart.

Next, the package itself...ChanSkype ... download latest release of chanskype located at ftp://ftp.chanskype.com/download/packages/ ... find the RedHat enterprise version (usually FC3), ie ends with FC3-RHEL4.bin, ie... chanskype-1.2.9-FC3-RHEL4.bin

wget ftp://ftp.chanskype.com/download/packages/chanskype*FC3-RHEL4.bin
chmod +x chanskype*
./chanskype-x.x.x.-FC3-RHEL4.bin

where x.x.x is the release you downloaded.

If it fails (ie, running TrixBox) repeat with 1DOT2 after the command

./chanskype-x.x.x.-FC3-RHEL4.bin 1DOT2

Next, I know...we hate to do them, but I've not found a way to get everything going right so please reboot (yes, one of two I'm going to make you do....instructions on avoiding this welcome...)

reboot

Access vnc for your server using a vnc viewer for each channel / account you installed and log into skype with your account info.  ie my server is 192.168.101.150:1 (first port assigned for skype1 account)  Nothing seems to install at port 0, the vnc default.

If when you log in, you don't see the Skype program visible but instead have a black console window with a series of errors about "pidof not found", use an editor like nano and add the following line to each of the .bash_profile files in each of the skype directories... ie:

nano /home/skype1/.bash_profile

Now add the following line:

export PATH=/sbin/:/usr/sbin/:$PATH

save it (in the case of nano, type a Ctrl-X).  Now restart vncserver by typing:

/etc/init.d/vncserver restart

log in again to the vnc account and see if Skype started...it should be running now.

Now, for each account created, assign user account in Skype.  You can close your VNC session now.

Next, edit /etc/asterisk/skype.conf for number of channels in use (same as the number from makeaccount).

nano /etc/asterisk/skype.conf

Find the line specifying the number of channels and set it accordingly...ie

channels=1

Now open freepbx...create custom trunk...add dial plan as desired...preface any dial with 00+ i.e.

001+nxxnxxxxxx
00+1nxxnxxxxxx

Then under outgoing settings, custom dial string... add:

Local/$OUTNUM$@skype

Using your editor again...add following 3 lines to extensions_custom.conf if you call it via any other contexts (ie, Dundi)

[skype]
exten => _X.,1,Dial(Skype/any/${EXTEN})
exten => _X.,2,Hangup

Remember to save settings as I've so often done by moving away without doing that...

And remember I promised one more reboot...here it is...last one...I promise...

reboot

One of the issues in Skype is it's a gui program taking it's queue from Windows Vista requiring you to validate other programs controlling it.. this is the only real quirk I've come across...albeit until I found this little hack, a real nuisance to say the least.

The next step allows ChanSkype to control it so you don't have to log in every time and "allow" ChanSkype to use Skype.#cd to your account created for skype (repeat for each account)...i.e.:

cd skype1

Now to traverse the rest of the path to allow the authentication process to be automatic in Skype's startup

cd .Skype

Don't miss the period in front of the word Skype as it's a hidden folder..next your login account on skype i.e.:

cd davebour

Edit the config.xml:

nano config.xml

Find the line:

<Authorizations></Authorizations>

Change to:

<Authorizations>chan_skype</Authorizations>

If you purchased a new license, run the registration with your code:

ivregister CS-xxxxxxxxxxxxxxxxxxxxxxxx

Now remember to backup your license file somewhere off this system should something happen.  You get two attempts at running ivregister.

Restart the vncserver once again:

/etc/init.d/vncserver restart

That's it, you should be ready to go. Log into your box, and connect to the asterisk session and check your channels...should show as 1 (or however many you purchased) licensed channels:

/usr/sbin/asterisk -rvx "skype status"

Now go make an outgoing trunk to use the Skype channel(s).  Try a test call.  You should be good.

Since Skype has a little issue in that if the internet drops, it doesn't automatically re-login when the internet becomes available, I created a basic hack script to test if Skype dropped, and by killing (albeit not gracefully - better suggestions welcome) Skype, which is monitored by ChanSkype.  When ChanSkype detects Skype is no longer running, it restarts the program.

Create the following crontab entry:

* * * * * /usr/sbin/skypetracker.sh

now using your favorite editor...

nano /usr/sbin/skypetracker.sh

enter the following

#! /bin/sh
#
/usr/sbin/asterisk -rvx "skype status" |grep "Licensed channels" |awk '{print $3}' >/skypechan
exec < /skypechan
while read SKYPECHAN
do
# if SKYPECHAN < 1, restart vncserver triggering
echo $SKYPECHAN
if [ $SKYPECHAN -lt 1 ]; then
/etc/init.d/vncserver restart
fi
done

Save and finish off by added execute permissions to the file...

chmod +x /usr/sbin/skypetracker.sh

That's it.  You've now got Skype running on your FreePBX/Trixbox with a simple monitor to ensure the channel stays connected in the event Skype loses the connection for whatever reason.

Author: asusmps4
July 29, 2008 - 3:58pm

Mazdaclub
google
уроки вождения Киев

Author: Adriano
November 7, 2007 - 2:05pm

hey, answer please coul the system be installed on windows 2003 server?

Adriano
( Cheap cigarettes )

Author: ipplayer
July 19, 2007 - 8:51pm

Hello,

Can the syste be installed on windows 2003 server?
Do you offer installation and configuration of Asterisk and chanskype? If so, how do you charge?
Thanks a lot.

Mike

Author: AllManKind
June 27, 2007 - 1:31am

Thanks for the great how to

I got Http error 404 not found after i did a ./install.sh

i guess skype has removed that link.

i disable skype.repo and download manually skype
and installation so far so good

thanks

Author: trevisa
September 25, 2007 - 12:39pm

The repo information has changed.
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc

after .../fedora/ there used to have a /3/, that no longer exists.
But, When I do yum install skype, I get missingf dependecies, like below.

Error: Missing Dependency: libQtDBus.so.4 is needed by package skype
Error: Missing Dependency: libQtNetwork.so.4 is needed by package skype
Error: Missing Dependency: libstdc++.so.6(GLIBCXX_3.4.4) is needed by package skype
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package skype
Error: Missing Dependency: libQtCore.so.4 is needed by package skype
Error: Missing Dependency: libsigc-2.0.so.0 is needed by package skype
Error: Missing Dependency: libQtGui.so.4 is needed by package skype
Error: Missing Dependency: qt4-x11 >= 4.2 is needed by package skype

How can I solve it?

Thaks,

Felipe

Author: dcbour
April 10, 2008 - 10:42pm

never figured I'd miss these ..but since they started a couple months after the posting, I never looked back...
If you by chance are following these comments, drop me a line back (via email) at - reverse name and domain - desktopsolutioncenter.ca@dcbour. Lame spam attempt I know but better than name at domain.com as that's too well hacked by the bots today.
D.

Author: cesar2024
July 23, 2008 - 9:14pm

can you help me to install Chanskype on trixbox 2.6.1
because hall the time y use the script CHanskype tell me the kernel devel is not installez but the kernel is install on my trixbox very sorry for my poor english y am french from montreal