Skypiax Skype Endpoint and Trunk
From FreeSWITCH Wiki
WHAT IS SKYPIAX
This software (Skypiax) uses the Skype API but is not endorsed, certified or otherwise approved in any way by Skype.
Skypiax is an endpoint (channel driver) that uses the Skype client as an interface to the Skype network, and allows incoming and outgoing Skype calls to/from FreeSWITCH (that can be bridged, originated, answered, etc. as in all other endpoints, e.g. sofia/SIP).
Skypiax works in FreeSWITCH (FS) on both Linux and Windows (directly, no Cygwin needed), native at 16khz (Skype client has 16khz audio I/O).
Skypiax works on Asterisk too, converting at 8khz (Asterisk cannot do 16khz), on Linux and Windows (through CygWin).
Think of Skypiax as similar to OpenZAP for analog lines. For each channel you need an interface (a Skype client). So, for example, two concurrent calls would need two channels, and therefore two Skype clients running on your FreeSWITCH server.
If your Skype client(s) have Skype credits, then Skypiax works for SkypeOut calls as well.
On Linux the Skype client can use a lot of CPU if you don't customize your setup. To lower its CPU consumption, you use the Xvfb "fake" X server and (more importantly) the snd-dummy ALSA "fake" sound driver. Scripts are provided for this (mod_skypiax/configs/startskype.sh for Linux, mod_skypiax/configs/startskype.bat for windows), though for a low number of channels it should work just fine with normal X servers and ALSA drivers. For production performances we provide a customized version of snd-dummy and a configuration file for kernel compilation.
On a machine with 3GB ram and a quad core intel Q6600, on both Linux and Windows we had no problem with 20 concurrent calls (load at less than 10%) and room for 20 more, (load begins to increase with more than 30 concurrent calls).
Skypiax is now beta, usable for testing and finding bugs :-).
Skypiax has been contributed to the community by: Giovanni Maruzzelli (gmaruzz at gmail dot com) with lot of help from the core developer's team, and hints, patches, suggestions, bug reports, features requests from the superlative FS community.
Skype Contacts, Messages, Buddy List, etc
Skypiax automatically directs the Skype client instance to agree to a request of being added to the Contact List and to make known its "status" (online, offline, etc), and will add the requester to the Contact List of the Skype client instance.
Skypiax automatically directs the Skype client instance to flag as "Seen" all received messages.
Dialplan, and how to use Skypiax
Dialplan
Like other endpoints it's easy to build up useful dialplans using Skypiax. There are a few simple examples given in the "default.xml" dialplan located in mod_skypiax/configs/
You can use the standard format with the interface name:
skypiax/interface1/echo123
to call "echo123" using the skypiax interface named "interface1"
If you modify your dialplan, you'll be able to call "skype uri"s for terminating calls via the Skype network.
A "Skype URI" is composed by the word 'skype' followed by a slash and a destination: "skype/remote_skypename" or "skype/skypeout_phonenumber"
E.g. "skype/echo123" or "skype/+18007844444".
You can use the "skype uri" of the provided dialplan directly from a SIP softphone, e.g. X-Lite.
And you can call the "2909" extension in the provided dialplan from any kind of phone to be bridged to the Skype Test Call.
Dialplan snippet:
<!-- dial echo123 via skypiax using interface1 interface to go out -->
<extension name="skypiax">
<condition field="destination_number" expression="^2909$">
<action application="bridge" data="skypiax/interface1/echo123"/>
</condition>
</extension>
<!-- dial via SKYPE uri using interface1 interface to go out -->
<extension name="skype_uri">
<condition field="destination_number" expression="^skype/(.*)$">
<action application="bridge" data="skypiax/interface1/$1"/>
</condition>
</extension>
With the provided skypiax.conf.xml all incoming Skype calls will be routed to the "5000" extension, the IVR in default FreeSWITCH installation.
The "ANY" and "RR" interfaces, poor man interface grouping
You can also use the "ANY" or "RR" interfaces
skypiax/ANY/echo123 skypiax/RR/echo123
to call "echo123" using the first available (idle, not in a call) skypiax interface, automatically selected (thx Seven Du).
"ANY" and "RR" are now just aliases, and will choose an available idle interface based on a round robin algorithm (so to distribute calls more fairly between all the available interfaces).
Dialplan snippets:
<!-- dial echo123 via skypiax ANY interface -->
<extension name="skypiax">
<condition field="destination_number" expression="^2908$">
<action application="bridge" data="skypiax/ANY/echo123"/>
</condition>
</extension>
<!-- dial via SKYPE uri with skypiax RR interface-->
<extension name="skype_uri">
<condition field="destination_number" expression="^skype/(.*)$">
<action application="bridge" data="skypiax/RR/$1"/>
</condition>
</extension>
Multiple concurrent incoming calls to the same Skype username
This solution, based on "transfer" the call to another Skype username (running on the same machine) works on both Windows and on Linux. For a Linux-only solution, based on running multiple instances of the same Skype username, see below
Let's say you want to be able to serve multiple concurrent incoming calls to the Skype username "skypiax1" (as in: Alice uses Skype to call the Skype user "skypiax1", concurrently Bob uses Skype to call the Skype user "skypiax1", both Alice and Bob are concurrently served by FS).
You setup multiple skypiax interfaces on FS, as many interfaces as the max number of concurrent incoming calls you want to serve.
Each skypiax interface will have its own Skype client running, each one with its own Skype user login.
Let's say you want to serve a max of 3 concurrent incoming calls, you'll setup three skypiax interface (100 concurrent calls, 100 skypiax interfaces). One of those three interfaces will be logged into the Skype network using the Skype username you want to use to answer all the incoming calls.
So, one interface will be logged into Skype network as "skypiax1". Let's say that the other two interfaces will be logged into the Skype network as "skypiax2" and "skypiax3", but they could be logged as any other Skype username, as long as they are all different and different from "skypiax1" (it's not possible to have more than one Skype client instance using the same Skype username on the same machine, at least on Linux).
When the first incoming call to the Skype username "skypiax1" is received, is served as you would expect by the interface logged as "skypiax1".
If another call for "skypiax1" is incoming while that interface is busy into a call (incoming or outbound), the "skypiax1" interface will *transfer* the incoming call to the first other idle skypiax interface it finds (eg: interface2 or interface3). The calling user will not have to do nothing for this, and this is completely transparent for Windows and Linux users, while MacOSX users will see into their client that the called party is changed from "skypiax1" to, say, "skypiax3", but they too do not have to do nothing.
And so on until all the skypiax interfaces available are busy. At that point, further incoming calls will be rejected until one skypiax interface exit from the call it is into, and will be available to answer.
Basically, you don't have to do anything to be able to answer multiple incoming calls to the same Skype username. Just set up enough interfaces for the maximum concurrent calls you want. Outbound calls will be originated by the Skype username of the interface.
Running multiple instances of the same Skype username on Linux, for BOTH incoming and outbound calls
On Linux, you can run multiple instances of the same Skype username (eg: multiple Skype clients that register with the Skype networks as the same username, eg: 10 instances of the username "Bob").
The trick is to launch the client instances with separate Xservers (as always with multiple clients) AND separate directories for the Skype client's database (eg: by default it resides in the ".Skype" directory in the user's home).
You can find an example configuration file and launch scripts in configs/multiple-instance-same-skype-username/ directory.
API and CLI Commands
Skypiax adds the "sk" and the "skypiax" API/CLI commands, for sending Skype API commands to the Skype client instance related to an interface. Both "sk" and "skypiax" commands can be used through the command line and via API/socket/ESL/whatever.
sk
"sk" commands are intended to be used from the FS command line ("sk remove" and "sk reload" can be useful from Event socket as well).
You begin typing "sk console interface_name" to direct the "current console" to sending messages to interface_name. Starting now on, you can type "sk command_string" and command_string will be sent to the Skype client instance related to interface interface_name.
sk console interface1 sk MESSAGE alice25 Hej Alice, this is a Skype chat message for you!
"sk list" gives the list and status of all the Skypiax interfaces (a star marks the interface from which "RR" - see below - will start hunting an IDLE one).
sk list
We got patches from Muhammad Shahzad and Seven Du for adding and removing interfaces on the fly.
reload
sk reload => this re-reads Skypiax configuration file skypiax.conf.xml and adds ONLY new interfaces it found in conf. All existing interfaces are not touched.
sk reload
remove
sk remove <skype-user> => this remove skypiax interface associated with given Skype user account, if it is idle.
freeswitch@internal> sk remove Bob
sk remove <#interface-numeric-id> => this remove skypiax interface associated with given Skype interface_id, if is idle (remember, you must add the pound sign in front of the interface-numeric-id, # is mandatory).
freeswitch@internal> sk remove #10
sk remove <#interface-name> => this remove skypiax interface associated with given Skype interface_name, if is idle (remember, you must add the pound sign in front of the interface-name, # is mandatory).
freeswitch@internal> sk remove #interface10
skypiax
"sk remove" and "sk reload" (see before) can be useful from API/socket/ESL/whatever as well.
"skypiax" commands are intended to be used by programs (API/socket/ESL/whatever) and have the format: "skypiax interface_name command_string". They send the command_string to the Skype client instance related to interface_name.
skypiax interface2 MESSAGE bob34 Ciao Bob! This is my Skype chat message for you from FS :-)
This allow you to use directly the entire power of the Skype API ( https://developer.skype.com/Docs/ApiDoc ), for eg to send chat messages, interact with the buddy list, etc etc. Typing "console loglevel 9" at the FS command line allows you to see the Skype API answers from the Skype client instance.
Prototyping and a standalone interactive client
So, in short: you bring loglevel to 9 (so you can see the Skype API messages going back and forth), you use "sk" or "skypiax" to send Skype API commands to the Skype client instance.
This way you can prototype extensions to the current mod_skypiax, that can then be implemented in C directly into the mod_skypiax source code.
An interactive command-line client for Linux (standalone, independent of FS-skypiax) is also provided for further ease of prototyping: configs/client.c. You use it giving as argument the Xserver the Skype client instance is connected to, eg:
./client :101
Please, add a Jira or write to the freeswitch mailing lists about the extensions you would like to be integrated into the mod_skypiax code ;-).
Building
Linux
How to build Skypiax on Linux, and which libraries are needed
Crashes and oops have been reported caused by the ALSA driver, if this happens to you, please compile and install alsa_drivers version 1.0.20 ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.20.tar.bz2 that is known not to crash. The section down below, "Production" Performances on Linux solves all problems for the user that got issues.
The only libraries specially needed by Skypiax are in the libX11 package.
If you are on Ubuntu, Debian, or derivative:
apt-get install libX11-dev
if you are on CentOS, RedHat, or derivative:
yum -y install libX11-devel
for other distros, please add here
Then, edit modules.conf and uncomment the mod_skypiax line. Then, "make install" from the FreeSWITCH root directory, as always.
An example of Skypiax and FreeSWITCH installation on CentOS, from scratch
Performance problems and other issues (eg crashes on ALSA drivers) has been reported for Skypiax on CentOS, albeit various users got good success on same CentOS. The section down below, "Production" Performances on Linux solves all problems for the user that got issues on CentOS.
Please have a look at the KERNEL part of '"Production" Performances on Linux' http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk#Kernel_performances_and_problems , without it I was not able to have good performances on a CentOS multiprocessor 64bit.
begin with CentOS-5.2-i386-netinstall.iso (or with the first installation disk)
choose language choose keyboard choose installation method = HTTP default Tcp-Ip configuration HTTP setup: insert the name of the mirror = mi.mirror.garr.it insert the directory name = mirrors/CentOS/5.2/os/i386
At the package selection:
select nothing from the "additional tasks", nothing for "additional repositories" select "customize now" on the bottom select "base system" then de-select dialup Networking support, and leave only "base" checked
After the machine installed,
from setup agent: FIREWALL firewall disabled SElinux disabled
Login to the local console, and reboot it:
shutdown -r now
now login from ssh, edit the repository list of yum, and substitute each $releasever with 5.2
cd /etc/yum.repos.d/ cp CentOS-Base.repo CentOS-Base.repo.backup vi CentOS-Base.repo
the following is cut and paste ready (you can do it all in one scoop)
yum update -y; \ yum install -y subversion autoconf automake libtool gcc-c++ \ ncurses-devel make libX11-devel Xvfb alsa-utils libXv libXScrnSaver\ xorg-x11-fonts* ; \ cd /usr/src ; \ svn co http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch; \ cd freeswitch ; ./bootstrap.sh ; ./configure ; \ make && make install && make hd-sounds-install && make hd-moh-install && make samples; \ cd /tmp ; \ wget http://www.skype.com/go/getskype-linux-centos ; \ yum localinstall --nogpgcheck -y skype-2.0.0.72-centos.i586.rpm ; \ yum update -y ; reboot
after reboot, uncomment mod_skypiax in modules.conf, make install (it will just make install mod_skypiax), and you're good to go!
cd /usr/src/freeswitch vi modules.conf make install
Copy and install the Skype clients configuration directory you previously prepared (see http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk#How_to_prepare_the_configuration_directory_of_Skype_clients_on_Linux for how to prepare it):
cd /root mount /dev/hda5 /mnt cp /mnt/root/skypeconfig2.tgz ./ tar xzf skypeconfig2.tgz chown -R root.root .Skype
Install the skypiax configuration files, edit and execute the script that starts the Skype client instances:
cd /usr/src cd freeswitch/src/mod/endpoints/mod_skypiax/ cd configs/ cp skypiax.conf.xml /usr/local/freeswitch/conf/autoload_configs/ vi /usr/local/freeswitch/conf/autoload_configs/skypiax.conf.xml cp skypiax.X.conf /usr/local/freeswitch/conf/autoload_configs/ cp startskype.sh 2startskype.sh vi 2startskype.sh sh ./2startskype.sh
start FS and load skypiax!
/usr/local/freeswitch/bin/freeswitch load mod_skypiax
thx to Kulwinder Singh (IRC: Daejeo) for how to install Skype client on CentOS!
An example of Skypiax and FreeSWITCH installation on Ubuntu 8.04, from scratch
Crashes and oops have been reported caused by the ALSA driver, if this happens to you, please compile and install alsa_drivers version 1.0.20 ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.20.tar.bz2 that is known not to crash. The section down below, "Production" Performances on Linux solves all problems for the user that got issues.
Install ubuntu 8.04 LTS server (Released April 2008 and maintained until April 2013) with *only* OpenSSH Server. (we used the 64bit edition)
Login at the real keyboard as the user you choose during install
Check the IP address with ifconfig
Logout
Login via ssh as the user you choose during install, become root with "sudo su", and choose a root password. Then, update the OS installation.
sudo su passwd
apt-get update && apt-get -y upgrade apt-get update && apt-get -y dist-upgrade reboot
Login again as root via ssh
apt-get update && apt-get -y dist-upgrade reboot
Now, let's begin the real installation. Starting here, following is cut and paste ready:
apt-get -y install build-essential subversion automake autoconf wget \ libtool libncurses5-dev xvfb libx11-dev libasound2-dev xfs xfonts-100dpi xfonts-75dpi xfonts-scalable ; cd /usr/src svn co http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch cd freeswitch; ./bootstrap.sh ; ./configure make && make install && make hd-sounds-install && make hd-moh-install && make samples
go to have something to drink-eat-read-whatever, it takes time
Uncomment the line "endpoints/mod_skypiax" in modules.conf and make install again (it will make install just mod_skypiax)
vi modules.conf make install
then, test that FS can be started
/usr/local/freeswitch/bin/freeswitch ...
copy the skypiax configuration file
cp src/mod/endpoints/mod_skypiax/configs/skypiax.conf.xml /usr/local/freeswitch/conf/autoload_configs/
optionally, copy the dialplan configuration file that contains the "skypiax" modifications (eg: you can call "sip:skype/remote_skypename__OR__skypeout_phonenumber" for calling via the Skype network from a SIP softphone to remote_skypename or to a phone number via SkypeOut, or you can call the "2908" extension from any phone to be bridged to the Skype Test Call)
cp src/mod/endpoints/mod_skypiax/configs/default.xml /usr/local/freeswitch/conf/dialplan/
now, let's get and install the Skype client
NOTE: Visit this page to find the Linux client for your distro: http://www.skype.com/download/skype/linux/choose/
cd .. apt-get -y install ia32-libs lib32asound2 libc6-i386 lib32gcc1 \ lib32stdc++6 lib32ncurses5 lib32z1 libasound2-plugins wget -c http://www.skype.com/go/getskype-linux-ubuntu-amd64 dpkg -i skype_ubuntu-2.0.0.72-1_amd64.deb
(all the *32 libraries are for 64 bit versions, if you are on 32bit you don't need it, and please choose the 32bit Skype client)
now, let's get the skype configuration directory we prepared on another (desktop) machine
on "How to prepare the configuration directory of Skype clients on Linux", see http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk#How_to_prepare_the_configuration_directory_of_Skype_clients_on_Linux
cp /mnt/root/configskypenew.tgz ./ tar xzf configskypenew.tgz chown root.root .Skype
almost ready!
let's edit the skypiax config
vi /usr/local/freeswitch/conf/autoload_configs/skypiax.conf.xml
let's edit the startskype script
remember to add the removing of all the installed snd-* modules
cp freeswitch/src/mod/endpoints/mod_skypiax/configs/startskype.sh ./ vi startskype.sh
let's copy the Xservers auth config file
cp freeswitch/src/mod/endpoints/mod_skypiax/configs/skypiax.X.conf \ /usr/local/freeswitch/conf/autoload_configs/skypiax.X.conf
start the X servers and the Skype clients
sh ./startskype.sh
this is the situation you want after startskype.sh
root@8-04-srv:~# lsmod | grep snd snd_dummy 22016 0 snd_pcm 99336 1 snd_dummy snd_timer 35080 1 snd_pcm snd 78024 3 snd_dummy,snd_pcm,snd_timer snd_page_alloc 20368 1 snd_pcm soundcore 17568 1 snd root@8-04-srv:~#
Please make sure the user which will be running skype has audio permission and alsa-base is installed
root@8-04-srv:~# adduser SKYPEUSERUNIX audio
root@8-04-srv:~# apt-get install alsa-base linux-sound-base
start FS and load skypiax!
/usr/local/freeswitch/bin/freeswitch load mod_skypiax
Ubuntu 9.10 (Karmic Koala) How To, contributed by Ernad Husremovic
Ernad Husremovic made a nice page describing how to build and operate mod_skypiax on Ubuntu Karmic (9.10):
Windows
How to build Skypiax on Windows, and which tools and files are needed
Skypiax has been designed to work well on windows since the beginning, like FS itself.
Skypiax (mod_skypiax) is automatically built when you build FreeSWITCH on Windows.
You will need the Visual C compiler from Microsoft, commercial version, or the free (as in beer) Visual C Express (requires registration). They both give the same results in our case (eg: no need to buy the commercial version just for Skypiax).
After having downloaded the FS sources from svn or the packaged FS source release, follow the instruction on how to build FS on Windows. Using Visual C (Express or not):
- Open Freeswitch.sln
- Right click the main solution node at the top of the Solution Explorer
- Right click and select Build
Then, download and install the 16khz sounds and music, needed by Skypiax (16khz native, like Skype itself):
- Right click on "Download 16khzsound" and select Build
- Right click on "Download 16khzmusic" and select Build
Test if FS works at all: http://wiki.freeswitch.org/wiki/Installation_Guide#Windows_quick_start
Then, go forward with the configuration of mod_skypiax (see below).
MacOSX
The code is not in trunk so I created a seperate page Skypiax on MacOSX
Configuration and Operation
Linux
Crashes and oops have been reported caused by the ALSA driver, if this happens to you, please compile and install alsa_drivers version 1.0.20 ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.20.tar.bz2 that is known not to crash. The section down below, "Production" Performances on Linux solves all problems for the user that got issues.
How to prepare the configuration directory of Skype clients on Linux
The easy way, using ssh -X and xauth
You will work from a desktop machine connected in ssh with X forwarding and you will use configs/skypiax_auth on the server to force the Skype client to ask you to authorize "skypiax" to connect to it.
Compile skypiax_auth:
$ gcc -Wall -ggdb skypiax_auth.c -o skypiax_auth -lX11
Install xauth on the server machine.
On CentOS
yum install xauth
On Ubuntu/Debian
apt-get install xauth
Then, from a Linux desktop use ssh with X forwarding to login on the server machine as the user that will start the Skype client instances, and start one Skype client instance:
ssh -X server-machine /usr/bin/skype &
The Skype instance will appear on the desktop machine. Do all the config needed:
Set the Skype client to use the "hw:dummy" audio device, to not update, to not make "events", etc etc... Make and receive a couple of test calls. Please note that you (and the remote party) will hear nothing (you're using the snd-dummy "fake" audio driver), that's ok.
When satisfied of the Skype client setup, use skypiax_auth (that simulates FS-skypiax connecting to the Skype client). The Skype client will ask you to be authorized to let "skypiax" connect.
Give the authorization and check the "not ask me again" option.
Close (Quit) the Skype client from the tray icon, so it saves its config.
Then, relaunch the Skype client and use skypiax_auth again, just to be sure it now succeed.
Close (Quit) the Skype client from the tray icon, so it saves its config.
Do the steps for all Skype usernames you will want to use on the server (eg: one Skype username per channel). NB: if you use the same password for all Skype usernames, you can setup just one client and then "clone" it. See below for "Cloning configuration directory on Linux".
first time you use skypiax_auth
$ ./skypiax_auth Skype instance found with id #27263062 RECEIVED==> ERROR 68 RECEIVED==> OK
Give the auth to the Skype client, and tell him not to ask again Then Ctrl-C to exit from skypiax_auth
Close (Quit) the Skype client from the tray icon, so it saves its config. Then, relaunch the Skype client
you use skypiax_auth again
$ ./skypiax_auth Skype instance found with id #27263062 RECEIVED==> OK RECEIVED==> PROTOCOL 6 RECEIVED==> CONNSTATUS ONLINE RECEIVED==> CURRENTUSERHANDLE gmaruzz3 RECEIVED==> USERSTATUS INVISIBLE
The painful way, no xauth
If you don't want/cannot install xauth on the server machine, you will work on a desktop machine and you will use configs/skypiax_auth to force the Skype client to ask you to authorize "skypiax" to connect to it.
Then you will copy the .Skype configuration directory of the user that has launched Skype (eg: /home/maruzz/.Skype if you are maruzz) on the home directory of the user that will start Skype on the server (eg: root).
Compile skypiax_auth:
$ gcc -Wall -ggdb skypiax_auth.c -o skypiax_auth -lX11
Then:
1) on a Linux desktop machine, rmmod all the snd* modules
2) on the desktop machine, modprobe snd-dummy
3) on the desktop machine, logout from your autologin username if any, launch the Skype client and login as the username you'll use on server
4) on the desktop machine, set the desktop client to use the "hw:dummy" audio device, to not update, to not make "events", etc etc... Make and receive a couple of test calls. Please note that you (and the remote party) will hear nothing (you're using the snd-dummy "fake" audio driver), that's ok.
3) on the desktop machine, when satisfied of the Skype client setup, use skypiax_auth (that simulates FS-skypiax connecting to the Skype client). The Skype client will ask you to be authorized to let "skypiax" connect.
4) Give the authorization and check the "not ask me again" option.
5) Close (Quit) the Skype client from the tray icon, so it saves its config.
6) Then, relaunch the Skype client and use skypiax_auth again, just to be sure it now succeed.
7) Close (Quit) the Skype client from the tray icon, so it saves its config.
Do the steps 1-7 for all Skype usernames you will want to use on the server (eg: one Skype username per channel). NB: if you use the same password for all Skype usernames, you can setup just one client and then "clone" it. See below for "Cloning configuration directory on Linux".
When finished with all the Skype usernames: Copy or targzip the .Skype directory and all its content on the home directory of the server user that will launch the Skype client(s).
first time you use skypiax_auth
$ ./skypiax_auth Skype instance found with id #27263062 RECEIVED==> ERROR 68 RECEIVED==> OK
Give the auth to the Skype client, and tell him not to ask again Then Ctrl-C to exit from skypiax_auth
Close (Quit) the Skype client from the tray icon, so it saves its config. Then, relaunch the Skype client
you use skypiax_auth again
$ ./skypiax_auth Skype instance found with id #27263062 RECEIVED==> OK RECEIVED==> PROTOCOL 6 RECEIVED==> CONNSTATUS ONLINE RECEIVED==> CURRENTUSERHANDLE gmaruzz3 RECEIVED==> USERSTATUS INVISIBLE
Cloning configuration directory on Linux
After you have launched the Skype client and logged yourself into the Skype network as "skypiax1", and you have given the auth to be connected by Skypiax, and you setup all the options in the client, exit from the client, right click on the icon and choose "Quit". The Skype client has saved its configuration.
You'll find the subdir "skypiax1" underneath the ~/.Skypiax directory in your home.
If you have registered multiple accounts with Skype ***with the same password*** as the "skypiax1" account, you can just clone the skypiax1 directory and give it the names of the other accounts, and end up as (if you just cloned them, the dates will be closer):
ls -l .Skype/ drwxr-xr-x 5 root root 4096 2009-02-12 22:33 skypiax1 drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax10 drwxr-xr-x 5 root root 4096 2009-02-08 08:30 skypiax11 drwxr-xr-x 5 root root 4096 2009-02-08 08:42 skypiax12 drwxr-xr-x 5 root root 4096 2009-02-08 08:50 skypiax13 drwxr-xr-x 5 root root 4096 2009-02-08 08:48 skypiax14 drwxr-xr-x 5 root root 4096 2009-02-08 09:31 skypiax15 drwxr-xr-x 5 root root 4096 2009-02-08 09:31 skypiax16 drwxr-xr-x 5 root root 4096 2009-02-08 08:53 skypiax17 drwxr-xr-x 5 root root 4096 2009-02-08 08:46 skypiax18 drwxr-xr-x 5 root root 4096 2009-02-08 08:31 skypiax19 drwxr-xr-x 5 root root 4096 2009-02-12 22:33 skypiax2 drwxr-xr-x 5 root root 4096 2009-02-08 09:23 skypiax20 drwxr-xr-x 5 root root 4096 2009-02-12 22:03 skypiax3 drwxr-xr-x 5 root root 4096 2009-02-12 21:10 skypiax4 drwxr-xr-x 5 root root 4096 2009-02-12 21:10 skypiax5 drwxr-xr-x 5 root root 4096 2009-02-12 22:07 skypiax6 drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax7 drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax8 drwxr-xr-x 5 root root 4096 2009-02-08 09:53 skypiax9
Inside each one of the subdirs, you'll find the file "config.xml".
After a while you'll get a grip on the format. Anyway, the most important item are:
<config>
...
...
...
<UI>
...
...
...
<CaptureDevice>4</CaptureDevice>
<RingDevice>4</RingDevice>
<SoundDevice>4</SoundDevice>
</UI>
</config>
Those values determine the audio devices used by the Skype client. You want to use the hw:snd-dummy ALSA device, because it will be really light on your CPU.
So, if you edited the startskype.sh script to rmmod all the snd-* modules from kernel, and then modprobe snd-dummy with the params in the same script, you will edit the config.xml inside the directory of the first 8 interfaces, and put the values at "2".
Next 8 interfaces, values at "4".
Next 8 interfaces, values at "6".
If you are running skypiax not as root make sure to set permissions of snd: chmod -R a+rw /dev/snd
That's it. It works.
Configuration for Running multiple instances of the same Skype username, for BOTH incoming and outbound calls
After you have launched the Skype client and logged yourself into the Skype network as "skypiax1", and you have given the auth to be connected by Skypiax, and you setup all the options in the client, exit from the client, right click on the icon and choose "Quit". The Skype client has saved its configuration.
You'll find the subdir "skypiax1" underneath the ~/.Skypiax directory in your home.
You then create as many directories as the number of instances of "skypiax1" you want to run concurrently. Into each one of them copy the *entire* content of the ~/.Skypiax directory in your home.
eg:
mkdir -p /root/multi/01 mkdir -p /root/multi/02 cp -a /root/.Skypiax/* /root/multi/01/ cp -a /root/.Skypiax/* /root/multi/02/
Don't forget to edit the files in configs/multiple-instances-same-skype-user/ accordingly.
Yay!
Windows
Config files location and script to start Skype client instances
You'll probably build the "Debug" version. So, go and copy src\mod\endpoints\mod_skypiax\configs/skypiax.conf.xml to Debug\conf\autoload_configs. Edit it to reflect your configuration.
Then, go into src\mod\endpoints\mod_skypiax\configs/ and edit startskype.bat to suit your configuration. Remember that startskype.bat needs wait.bat to be in its same directory (wait.bat is in the "configs" dir too).
Eventually, launch the Skype client instances using startskype.bat, then launch FS, and from the FS command line:
load mod_skypiax
The Skype instances will ask you for permission to be connected by Skypiax. Give the auth.
You're all set.
Windows Video How To
Kulwinder Singh contributed this HOW TO: Freeswitch & Skype- OS Microsoft Windows
Part 1 url: http://www.youtube.com/watch?v=ji4IqcerMgM
Part 2 url: http://www.youtube.com/watch?v=1x1biWEJOu4
Running Skypiax on Windows as a Service
I assume you have FS configured and working with mod_skypiax (running from the command line). I mean, first you have to make sure all is working as a "normal non-service application".
The difficult thing is to have the Skype client instances started by a service (FreeSWITCH itself is able to be a Windows Service).
You install FS as service (freeswitch.exe -install servicename), then use the "services" applet to run it under "local system" user, starting manually (not automatically).
Then edit to your like (Skype usernames/passwords AND change the name of the service to be started from AICCU to the name of the FreeSWITCH service - on the last line -) and copy the 2 command files contained in the configs/windows-service/ directory to a known location (eg. C:\).
For creating the service that will starts the Skype client instances and the FreeSWITCH service you just setup, you need to use instsrv and srvany from "Windows Server 2003 Resource Kit Tools": http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
Procedure for creating a service is detailed here: http://support.microsoft.com/kb/137890 (or more shortly here: http://www.sixxs.net/wiki/Configuring_Windows_Vista#.2816.29__Installing_AICCU_Utility_as_a_Service )
You create an (empty) service with those tools, then you follow the procedure steps and as "Parameters"->"Application" you put the string "C:\startskype.cmd"
Then, from the "services" applet in Control Center ->administrative tools, you make sure the service is owned by "local system" and that "Access desktop" is ticked.
Start the service manually from the "services" applet.
Maybe it will appear a "the service wants to access the desktop". Go to "show message" to see what Skype wants, and give some configurations if needed.
After a while, when the FreeSWITCH service will be started by our new "startskype.cmd" service, it will appear "the service wants to access the desktop". Go there and give Skype clients authorization to be connected by FS, forever.
Stop both services from the "Services" applet.
Unfortunately I've found no way to have the Skype instances shutdown when the service is shutdown. So, exit the Skype client instances manually, or reboot.
Restart the service, manually from the "Services" applet.
From another machine, make a Skype call to FS.
If all works as expected, stop both services, make sure (via "services" applet) the FS service will retry three times to start, with a minute pause (just to allow for the Skype clients to start and settle their connection with the network, to be on the safe side).
Make the service to start "automatic" (only the "startskype.cmd" service, not the FreeSWITCH service. The FreeSWITCH service is started by the "startskype.cmd" service.
Reboot the machine, don't log in, make another test call to FS via Skype, and... joy :-)
The trick for me (on Vista) is to use the same "local system" account for both the Skype and the FS services, and *NOT* to use a personal account. Go figure... :-)
Adding and removing interfaces on the fly
We got a patch from Muhammad Shahzad for adding and removing interfaces on the fly. It basically adds two sk commands:
sk reload => this re-reads Skypiax configuration file skypiax.conf.xml and adds ONLY new interfaces it found in conf. All existing interfaces are not touched.
sk remove <skype-user> => this remove skypiax interface associated with given Skype user account, if it is idle.
Performance and Resource Usage
Linux
20 idle skypiax channels:
top - 18:14:26 up 2:02, 2 users, load average: 0.03, 0.08, 0.04 Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.3%sy, 0.0%ni, 99.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 3096688k total, 1835100k used, 1261588k free, 137688k buffers Swap: 248968k total, 0k used, 248968k free, 1020888k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8272 root 20 0 320m 30m 4848 S 0 1.0 0:00.56 freeswitch 7905 root 20 0 58520 27m 10m S 0 0.9 0:03.25 skype 7937 root 20 0 59356 26m 10m S 0 0.9 0:03.01 skype 8093 root 20 0 58524 26m 10m S 0 0.9 0:03.03 skype 7981 root 20 0 58376 26m 10m S 0 0.9 0:02.72 skype 8157 root 20 0 59452 26m 10m S 0 0.9 0:02.49 skype 7889 root 20 0 57888 26m 10m S 0 0.9 0:03.03 skype 8189 root 20 0 58544 26m 10m S 0 0.9 0:02.62 skype 7953 root 20 0 58400 26m 10m S 0 0.9 0:03.27 skype 7997 root 20 0 57988 26m 10m S 1 0.9 0:03.00 skype 8029 root 20 0 58456 26m 10m S 0 0.9 0:02.57 skype 8045 root 20 0 58368 26m 10m S 0 0.9 0:02.70 skype 8077 root 20 0 58444 26m 10m S 0 0.9 0:02.69 skype 8109 root 20 0 59564 26m 10m S 0 0.9 0:02.75 skype 8061 root 20 0 57984 26m 10m S 0 0.9 0:02.67 skype 7921 root 20 0 58388 26m 10m S 0 0.9 0:02.92 skype 7873 root 20 0 58492 26m 10m S 1 0.9 0:03.83 skype 8125 root 20 0 58404 26m 10m S 1 0.9 0:02.89 skype 8013 root 20 0 58460 26m 10m S 0 0.9 0:03.88 skype 8173 root 20 0 58468 26m 10m S 0 0.9 0:02.55 skype 8141 root 20 0 58232 26m 10m S 0 0.9 0:02.88 skype 7884 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.33 Xvfb 8024 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.30 Xvfb 8040 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.32 Xvfb 8072 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.29 Xvfb 7900 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.32 Xvfb 7916 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.32 Xvfb 8120 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb 8152 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.29 Xvfb 8168 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.28 Xvfb 8184 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.28 Xvfb 7868 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb 7932 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.32 Xvfb 7948 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.32 Xvfb 7964 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.33 Xvfb 7992 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb 8008 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.31 Xvfb 8056 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.30 Xvfb ...some more Xvfb
Since this server has 3GB of RAM you can see that each skype process is useing about 30MB, and the Xvfbs are useing about 10MB each.
20 incoming concurrent skype calls listening to moh at 16khz:
top - 18:40:04 up 2:27, 2 users, load average: 0.14, 0.13, 0.06 Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie Cpu(s): 18.6%us, 4.5%sy, 0.0%ni, 76.4%id, 0.0%wa, 0.1%hi, 0.4%si, 0.0%st Mem: 3096688k total, 1858460k used, 1238228k free, 137692k buffers Swap: 248968k total, 0k used, 248968k free, 1023148k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8866 root 20 0 336m 35m 5016 S 9 1.2 0:21.23 freeswitch 8812 root 20 0 84632 28m 10m S 6 0.9 0:14.02 skype 8580 root 20 0 84252 27m 10m S 6 0.9 0:28.19 skype 8713 root 20 0 84716 27m 10m S 6 0.9 0:18.06 skype 8628 root 20 0 84268 27m 10m S 7 0.9 0:24.37 skype 8793 root 20 0 84756 27m 10m S 6 0.9 0:14.24 skype 8664 root 20 0 84140 27m 10m S 6 0.9 0:23.19 skype 8745 root 20 0 84628 27m 10m S 6 0.9 0:16.85 skype 8644 root 20 0 84588 27m 10m S 6 0.9 0:22.81 skype 8697 root 20 0 84516 27m 10m S 6 0.9 0:21.03 skype 8514 root 20 0 83164 27m 10m S 7 0.9 0:29.47 skype 8564 root 20 0 84496 27m 10m S 4 0.9 0:28.65 skype 8681 root 20 0 84632 27m 10m S 6 0.9 0:23.20 skype 8532 root 20 0 83528 27m 10m S 6 0.9 0:28.39 skype 8612 root 20 0 84460 27m 10m S 6 0.9 0:24.70 skype 8729 root 20 0 84368 27m 10m S 8 0.9 0:18.86 skype 8761 root 20 0 84644 27m 10m S 6 0.9 0:16.70 skype 8777 root 20 0 83752 27m 10m S 7 0.9 0:16.19 skype 8596 root 20 0 83692 27m 10m S 7 0.9 0:26.49 skype 8831 root 20 0 83568 27m 10m S 7 0.9 0:13.13 skype 8548 root 20 0 83336 27m 10m S 6 0.9 0:30.67 skype 8575 root 20 0 43636 9.8m 2232 S 0 0.3 0:00.63 Xvfb 8543 root 20 0 43636 9.8m 2232 S 0 0.3 0:00.64 Xvfb 8527 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.65 Xvfb 8591 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.60 Xvfb 8658 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.58 Xvfb 8724 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.64 Xvfb 8740 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.65 Xvfb 8509 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.66 Xvfb 8607 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.61 Xvfb 8623 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.57 Xvfb 8692 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.55 Xvfb 8756 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.55 Xvfb 8772 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.60 Xvfb 8788 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.56 Xvfb 8823 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.59 Xvfb 8639 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.58 Xvfb 8676 root 20 0 43624 9.8m 2232 S 0 0.3 0:00.55 Xvfb ...some more Xvfb
Here we see that the Ram usage hasn't changed but now each skype process is useing about 6% CPU. Which amounts to about 1.5% of this quad core system.
The one below is another ascii screenshot, but using the current svn revision at Feb 10, 2009 (one month later than the screenshot before), taken after one hour run of 19 channels on music on hold, and 1 channel intermittent usage (for testing). 20 concurrent channels on moh.
top - 11:37:20 up 14:59, 3 users, load average: 0.04, 0.06, 0.08 Tasks: 114 total, 1 running, 113 sleeping, 0 stopped, 0 zombie Cpu(s): 12.8%us, 3.1%sy, 0.0%ni, 83.5%id, 0.0%wa, 0.0%hi, 0.6%si, 0.0%st Mem: 3096688k total, 1568860k used, 1527828k free, 135244k buffers Swap: 248968k total, 0k used, 248968k free, 752224k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10473 root 20 0 338m 37m 5264 S 6 1.3 2:43.37 freeswitch 10460 root 20 0 83364 28m 10m S 6 0.9 0:39.05 skype 10316 root 20 0 82844 28m 10m S 6 0.9 2:33.71 skype 10444 root 20 0 83276 27m 10m S 7 0.9 2:26.89 skype 10187 root 20 0 83064 27m 10m S 6 0.9 2:39.78 skype 10364 root 20 0 83308 27m 10m S 6 0.9 2:33.55 skype 10284 root 20 0 83620 27m 10m S 6 0.9 2:39.07 skype 10412 root 20 0 82920 27m 10m S 6 0.9 2:32.86 skype 10300 root 20 0 82792 27m 10m S 6 0.9 2:35.97 skype 10268 root 20 0 83308 27m 10m S 6 0.9 2:37.24 skype 10332 root 20 0 83364 27m 10m S 5 0.9 2:35.97 skype 10171 root 20 0 83164 27m 10m S 5 0.9 2:40.55 skype 10236 root 20 0 83104 27m 10m S 6 0.9 2:38.06 skype 10252 root 20 0 83240 27m 10m S 6 0.9 2:37.91 skype 10428 root 20 0 83124 27m 10m S 6 0.9 2:27.67 skype 10155 root 20 0 83260 27m 10m S 6 0.9 2:43.62 skype 10203 root 20 0 83780 27m 10m S 6 0.9 2:38.93 skype 10396 root 20 0 83300 27m 10m S 6 0.9 2:30.62 skype 10220 root 20 0 83176 27m 10m S 7 0.9 2:45.98 skype 10380 root 20 0 82852 27m 10m S 5 0.9 2:32.23 skype 10348 root 20 0 83356 27m 10m S 6 0.9 2:31.23 skype 10182 root 20 0 41536 9404 2212 S 0 0.3 0:03.33 Xvfb 10166 root 20 0 41536 9392 2200 S 0 0.3 0:03.35 Xvfb 10455 root 20 0 41500 9392 2200 S 0 0.3 0:02.11 Xvfb 10311 root 20 0 41524 9388 2212 S 0 0.3 0:03.24 Xvfb 10231 root 20 0 41512 9376 2212 S 0 0.3 0:03.30 Xvfb 10279 root 20 0 41524 9376 2200 S 0 0.3 0:03.30 Xvfb 10373 root 20 0 41512 9376 2212 S 0 0.3 0:03.20 Xvfb 10343 root 20 0 41512 9372 2200 S 0 0.3 0:03.22 Xvfb 10215 root 20 0 41512 9368 2200 S 0 0.3 0:03.30 Xvfb 10439 root 20 0 41512 9368 2200 S 0 0.3 0:03.20 Xvfb 10295 root 20 0 41512 9364 2200 S 0 0.3 0:03.31 Xvfb 10150 root 20 0 41500 9360 2200 S 0 0.3 0:03.33 Xvfb 10247 root 20 0 41500 9356 2200 S 0 0.3 0:03.27 Xvfb 10263 root 20 0 41500 9356 2200 S 0 0.3 0:03.30 Xvfb 10327 root 20 0 41500 9356 2200 S 0 0.3 0:03.25 Xvfb 10359 root 20 0 41500 9356 2200 S 0 0.3 0:03.22 Xvfb 10407 root 20 0 41500 9356 2200 S 0 0.3 0:03.19 Xvfb 10391 root 20 0 41500 9352 2200 S 0 0.3 0:03.24 Xvfb 10423 root 20 0 41500 9352 2200 S 0 0.3 0:03.20 Xvfb 10198 root 20 0 41464 9320 2200 S 0 0.3 0:03.30 Xvfb 9948 maruzz 20 0 19384 3380 1348 S 0 0.1 0:00.06 bash 4991 klog 20 0 6288 2976 432 S 0 0.1 0:00.09 klogd 10675 root 20 0 68112 2928 2296 S 0 0.1 0:00.11 sshd
"Production" Performances on Linux (and ALSA driver kernel crashes)
Skype Client Memory Leak on CentOS
See below in "Troubleshooting"
ALSA performances and problems
Crashes and oops have been reported caused by the ALSA driver, if this happens to you, please compile and install alsa_drivers version 1.0.20 ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.20.tar.bz2 that is known not to crash.
Note: on CentOS (because they backport features in kernel) you will have to edit alsa-driver-1.0.20/include/adriver.h and comment out line 101 and line 1781, eg, make it like this:
/* other missing types */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) //typedef unsigned int fmode_t; #endif
...
#ifndef bool /* just to be sure */ //typedef _Bool bool; #endif
Then edit alsa-driver-1.0.20/usb/usbcompat.h adding a "#if 0" on line 18, commenting out the following code making it look like this:
#endif /* < 2.6.24 */ #if 0 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
close the commenting out block adding an "#endif" at line 97, making it look like this:
#endif /* < 2.6.21 */ #endif //0
Then:
yum install kernel-devel ./configure --with-redhat=yes --with-debug=verbose \ --with-cards=dummy,usb-audio,hda-intel,hrtimer,rtctimer \ --with-card-options=all make && make install
Note, Ubuntu may have alsa sound drivers installed at /lib/modules/<your kernel version>/ubuntu/sound/..., you may need to remove the dir to allow modprobe search from the default place: /lib/modules/<your kernel verision>/kernel/sound/ (don't forget to rerun /sbin/depmod after removing the old sound directory. Eg: /sbin/depmod -a 2.6.24-24-server).
./configure --with-redhat=no --with-debug=verbose \ --with-cards=dummy,usb-audio,hda-intel,hrtimer,rtctimer \ --with-card-options=all
Also, a customized snd-dummy is provided, that allows for 64 concurrent Skype client instances and that is lighter on interrupts and context switches. Compile it with the alsa drivers version 1.0.20 (previous versions got bug that causes kernel oops).
That's the ALSA driver used by skypiax development.
In mod_skypiax/configs/alsa you can find the dummy.c file that must be copied in sound/drivers/dummy.c of alsa-driver-1.0.20.
In case you still use the ALSA driver of your distribution and you got the machine stuck, as a pre-caution make non-executable in /etc/init.d the files that deal with ALSA, eg: that contains alsactl or amixer, or whatever alsa related.
Particularly the one that try to store the alsa status on shutdown or reboot (eg: alsactl store).
This way at least you can reboot the machine also if the ALSA driver of your distro has crashed or has problems.
Kernel performances and problems
Any Linux machine with any kernel/distro will works with a limited number of concurrent Skypiax channels.
But for various reasons (all related to the Skype client), if you want to have the best possible performances you must use a tickless kernel with 100HZ tick (yes, it's not a typo: one hundred hertz. And yes, seems silly, but tickless kernels do have tick frequency). Ubuntu 8.04 got this kind of kernel out of the box. CentOS do not.
In configs/kernel you can find an example configuration file and a README on how to compile such kernel, especially on CentOS.
Windows
On the same machine as before, Vista Home fully updated, 20 concurrent skypiax calls are reported by "Task Manager" as using 40% of the 4 CPUs.
Adding and removing interfaces on the fly
We got a patch from Muhammad Shahzad for adding and removing interfaces on the fly. It basically adds two sk commands:
sk reload => this re-reads Skypiax configuration file skypiax.conf.xml and adds ONLY new interfaces it found in conf. All existing interfaces are not touched.
sk remove <skype-user> => this remove skypiax interface associated with given Skype user account, if it is idle.
Testing with the "Echo" application
Because the Skype clients have their own AEC (Acoustic Echo Cancellation), if you test Skypiax with the echo() application (press 2 on the demo IVR) you will have a bizarre effect of your voice going up and down in volume "pulsations".
This is caused by the combined AEC of the Skype clients, that "think" the echo() application is the echo generated because you are in an empty room and are using loudspeakers.
On windows AEC can be disabled editing the config.xml file. On Linux, is not possible to disable it (disabling it with the API command has no effect).
So, the test with the echo() application is only good to give you an idea of the latency. If you want to have an idea of the audio quality, use the "delayed echo" at extension 9995 of the default dialplan. Or the echo that is at end of "screaming monkeys" (kindly provided by John Todd, press 5 on the default IVR), but you'll add a transcoding to ulaw 8khz and a round trip to loligo.com servers.
Linux
1) Each standard ALSA dummy sound card can be used by up to 8 Skype instances (while the custom one can serve 64 Skype instance, so in practice it has no limitation and you do not need to do anything special. See: http://wiki.freeswitch.org/wiki/Skypiax_Skype_Endpoint_and_Trunk#ALSA_performances_and_problems), by default Linux kernel has support for up to 8 sound cards. This means with default Linux installation you can not have more then 8 x 8 = 64 Skypiax interfaces. To overcome this limit, you have to recompile Linux kernel with Dynamic device file minor numbers option enabled in ALSA section.
2) If you are using more then 4 dummy sound card instances, make sure you give enough time to snd_dummy kernel driver to initialize all dummy sound card instances. Otherwise, Skype instances will not be able to find or use a free dummy sound card properly and sound issues will occur, such as no or crappy sound. My estimations are 60 seconds for up to 8 dummy sound cards (tested on CentOS 5.3).
3). When creating Skype configuration directory template as described above, also make sure of following, these will ensure you have no trouble while using this configuration directory template for other Skype accounts.
a) Remove all contacts in contact list, even Skype Call Testing Service. b). Disable auto-login, so it won't save password.
4. When you copy configuration directory template to use for a REAL Skype account, after copying execute following commands from inside the new configuration directory,
perl -pi -e 's/<template-username>/<actual-username>/g' profile256.dbb perl -pi -e 's/<template-username>/<actual-username>/g' voicemail256.dbb
Replace <template-username> and <actual-username> with your template Skype username, and real Skype username. Now this REAL Skype user can log in with Skypiax even if its password is completely different then template Skype user.
5. I have already send patch to mod_skypiax.c file that provides commands to dynamically add and remove Skypiax interfaces in a running FS process without effecting any other existing Skypiax interfaces (btw, the patch is now integrated in the mainline code). You can write up a PERL daemon to utilize these commands to create Skype configuration directories (from a template), initialize new Skype instance with any valid Skype username and password and then start calling to/from FS from/to Skype network. You then remove Skype instance and delete its configuration directory and create new ones...!
--Shaheryar S. Sheikh 06:00, 12 June 2009 (UTC)
TO DO
Requests, suggestions, ideas (feel free to add here, but best is to add on Jira - see below 'BUGS and Feature Requests'):
TROUBLESHOOTING
Error and warnings at the starting of Skype clients on Linux
When starting the Skype clients on Linux, on certain distros you can have warnings and errors on the console, like those:
Couldn't open RGB_DB '/usr/share/X11/rgb' error opening security policy file /usr/lib64/xserver/SecurityPolicy
or this:
ALSA lib pcm_dmix.c:1008:(snd_pcm_dmix_open) unable to open slave
or this:
ALSA lib pcm.c:2184:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
Those are completely harmless, and after you are sure your script correctly starts the Skype clients, you can also redirect those outputs to /dev/null, if so you like.
The last ALSA warning can be avoided editing the alsa.con file (/etc/alsa/alsa.conf or /usr/share/alsa/alsa.conf) and commenting out the hdmi lines
Skype Client Memory Leak on CentOS
The Skype client has been reported to memory leaks on CentOS, while seems to behave well on Ubuntu.
NOTE: to solve the problem, download the "static" version of Skype client, untar the directory, and copy the "skype" executable on top of /usr/bin/skype. Voila', no more memory leak (so it's probably a leak with QT on centos?). If you do this step, no need for additional measures.
Please see this bug report on the official Skype Jira: https://developer.skype.com/jira/browse/SCL-388
If this problem bite you on a production system CentOS based, consider to have a cron that periodically unload mod_skypiax from FS, killall Xvfb (automatically will kill the Skype client instances), and restart both Xvfb and Skype client instances.
Also, you can do it one interface at time, removing the interface from FreeSWITCH, killing the Xvfb and Skype client related to that interface, starting again the Xvfb and Skype client related to that interface, reloading all mod_skypiax interfaces (actually it would reload only the newly restarted one). You can do it in a sequence like:
freeswitch@internal> sk remove interface1 [root@server1]# kill the Skype client related to interface1 and the Xvfb that serves it [root@server1]# start the Xvfb and the Skype client instance related to interface1 freeswitch@internal> sk reload
Crash on Ubuntu 9.10 (Karmic Koala), contributed by Ernad Husremovic
The X stack has problems on Karmic.
Ernad Husremovic made a nice page describing how to build and operate mod_skypiax on Ubuntu Karmic (9.10) with a workaround (downgrading the libs):
Linux machine stuck, not able to reboot, Skype clients erratic behavior, or various bizarre problems
It's probably an ALSA driver problem.
See before "Production" Performances on Linux (and ALSA driver kernel crashes) for how to solve it.
If you still want to use the ALSA driver of your distro, as a pre-caution make non-executable in /etc/init.d the files that deal with ALSA, eg: the ones that contains alsactl or amixer, or whatever alsa related.
Particularly the one that try to store the alsa status on shutdown or reboot (eg: alsactl store).
This way at least you can reboot the machine also if the ALSA driver has crashed or has problems.
Sleep from scripting languages add itself as delay
As per Jira report http://jira.freeswitch.org/browse/MODSKYPIAX-29 , if you use the scripting language native sleep() (eg msleep() in javascript or time.slep() in python), the time slept will add itself as delay in the communication.
Until this bug (is a bug, not a feature) is fixed, all users are kindly requested to use session.sleep or session.execute("sleep 10000"), or similar session constructs.
USAGE EXAMPLES (contributed by users)
Blog post of Michael Collins (mercutioviz)
http://telecommusings.blogspot.com/2009/09/kicking-it-off-skype-for-asterisk-yawn.html
FreeSWITCH Testimonial on Idapted.com (by Seven Du)
A system for remote teaching English language, connects US based teachers with China based students: http://wiki.freeswitch.org/wiki/FreeSWITCH_Testimonial_on_Idapted.com
skypiax originator (by DelphiWorld)
This example is a default dialplan extension, to originate call from any SIP/Freeswitch supported Endpoint to Skype Network.
Skype provide a service called speeddial, to assign a speed dial number to a contact.
For example, "Bob" is in my contact list, i right click and i choose to assign a speed dial number and I enter 1.
When I call this originator in FreeSWITCH, i dial 1 and skypiax will call "Bob" directly using the speeddial number in my skype profile
<include>
<extension name="skypiax_originator">
<condition field="destination_number" expression="^(2020)$">
<action application="play_and_get_digits" data="2 5 3 7000 # conference/8000/conf-pin.wav /invalid.wav dest"/>
<action application="set" data="instant_ringback=true"/>
<action application="set" data="ringback=$${us-ring}"/>
<action application="ring_ready" />
<action application="bridge" data="skypiax/ANY/${dest}"/>
</condition>
</extension>
</include>
skypiax based skype trunk (by DelphiWorld)
I installed a debian machine, with 2GB of ram, 3.0GHZ Intel dualcor CPU and 1 LAN wired and 1 wireless interface for skype trunking, for Algeria Telecom technical support.
Algeria Telecom have an Asterisk based call center, so I created a new trunk in Asterisk and let FreeSWITCH register into it.
If any call is coming from Skype network, FreeSWITCH transfer it to the QUEUE (actually i dial 800)
At the moment is used only for testing.
If accepted, I will extend it to more than 20 Skypiax channels with a more powerful server machine.
Kulwinder Singh Windows Video How To
Kulwinder Singh contributed this HOW TO: Freeswitch & Skype- OS Microsoft Windows
Part 1 url: http://www.youtube.com/watch?v=ji4IqcerMgM
Part 2 url: http://www.youtube.com/watch?v=1x1biWEJOu4
How To Report BUGS and Feature Requests
You can file bug reports, hints, suggestions, feature requests, improvements, patches, etc to http://jira.freeswitch.org/browse/MODSKYPIAX open an account there if you don't have it (it's free ;-) ).
That's the best way to give us info on bugs:
1) from the FS CLI: "console loglevel 9" 2) load mod_skypiax 3) reproduce the bug 4) attach the *complete, since beginning* console output as a file attachment to the Jira bug
If the bug reports crashes, core dumps, etc, please first read this guide: http://wiki.freeswitch.org/wiki/Reporting_Bugs then file a Jira with all relevant info to mod_skypiax.
You can also write to the FS users' and developers' mailing lists: http://lists.freeswitch.org/mailman/listinfo
And you can drop in the IRC channels #freeswitch and #freeswitch-dev on irc.freenode.org to ask questions and discuss issues. The original developer of Skypiax is called "gmaruzz" in the IRC channel.
As a last resort, not the preferred way, you can write email to Giovanni Maruzzelli - gmaruzz @ gmail dot com


