CentOS Asterisk + skype siptosis
Friday, 19. June 2009
Please Note that this is a work in progress.
Please Note. At this time the tutorial does not work
, There seems to be an issue running siptosis as a non-root user. I will be trying to get it to work. You may still download siptosis for free thought
sorry for any inconvenience .
Setting up SipToSis ( Skype to Sip gateway )
I am going to walk you through how to set up asterisk with skype as your incoming and outgoing calls
- Requirements:
- Skype account
- Fresh install of centos 5.3 ( up to date )
- High Speed internet access
- siptosis here
- A sip phone
- This is a work in progress so please check later
The First thing we need to do is disable selinux and your firewall ( I will be working on getting it so we can enable them at a different time ).
Log into your CentOS box as root. then type the command
system-config-securitylevel-tui
Set Security Level to Disabled and SELinux to Disabled ( there are plenty of tutorials that show this so im not going to get to deep )
The next thing to do is add 2 new users ( or how many skype trunks you want )
adduser skype1
adduser skype2
passwd skype1 [ then type a secure password in ]
passwd skype2 [ then type a secure password in ]
After that we install the dependency’s for skype and siptosis
yum install libXv.so.1 qt4 libXScrnSaver java-1.6.0-openjdk
yum groupinstall “X Windows System”
Once you have that we need to change /etc/inittab Change the line Be very carful when doing this you can mess up the system if you missconfigure the /etc/inittab
id:3:initdefault: to id:5:initdefault:
Or you can just download my copy here
reboot your system and when it comes up log in as root again then do the following
su skype1
cd ~
wget http://www.timholum.com/downloads/siptosky+asterisk/.twmrs
vncpasswd [type a secure password]
exitsu skype2
cd ~
wget http://www.timholum.com/downloads/siptosky+asterisk/.twmrs
vncpasswd [type a secure password]
exit
note: you can acheve the same thing by cp /etc/X11/twm/system.twmrc /home/skype1/.twmrc and then adding the line RandomPlacement above the line NoGrabServer
The next thing we want to do is install skype.
cd /tmp && wget http://www.skype.com/go/getskype-linux-centos && rpm -i skype*.rpm
Once Skype is installed its time to install the vncserver needed to run mulitple siptosis with skype. Edit /etc/sysconfig/vncservers to say
VNCSERVERS=”1:skype1 2:skype2″
VNCSERVERARGS[1]=”-geometry 800×600″
VNCSERVERARGS[2]=”-geometry 800×600″
Now start the vncservice and enable it to start on startup
chkconfig vncserver on
service vncserver start
Time to log in to the vnc session. open up a vncviewer on a different pc and point it to the ip address on port 5901 of the server for example 192.168.1.51:5901 if your ip of your server is 192.168.1.51 . Note: the password is going to be the password that you used when you typed vncpasswd for skype1 In the terminal type
skype
Now repeate the step above replacing the 5901 with 5902 and instead of the vncpasswd for skype1 use it from skype2
After we have skype set up on both accounts we need to configure siptosis.
cd /root/
wget http://www.timholum.com/downloads/siptosky+asterisk/siptosis.tar.gz
tar -xzvf siptosis.tar.gz
cp -R siptosis /home/skype1/
cp -R siptosis /home/skype2/
cd /home/skype1/siptosis
cp samples/*.props .
cp samples/*.cfg .
cd /home/skype2/siptosis
cp samples/*.props .
cp samples/*.cfg .
chown -R skype1:skype1 /home/skype1
chown -R skype2:skype2 /home/skype2
Now we have to edit /home/skype1/SkypeToSipAuth.props and change the following
*,sip:echo@proxy01.sipphone.com:5060 to *,sip:777123@127.0.0.1:5060
Then Edit /home/skype1/siptosis.cfg. On line 194 ( on my version at least ) change passwd to a secure password. and then add the line
from_url=”skype” <sip:skype@127.0.0.1:5070>
The whole section around line 194 should look like this
host_port=5070
username=skype
passwd=SecurePassword
from_url=”skype” <sip:skype@127.0.0.1:5070>
Now we have to edit /home/skype2/SkypeToSipAuth.props and change the following
*,sip:echo@proxy01.sipphone.com:5060 to *,sip:777123@127.0.0.1:5060
Then Edit /home/skype2/siptosis.cfg. On line 194 ( on my version at least ) change passwd to a secure password. and then add the line
from_url=”skype” <sip:skype@127.0.0.1:5071>
The whole section around line 194 should look like this
host_port=5071
username=skype
passwd=SecurePassword
from_url=”skype” <sip:skype@127.0.0.1:5071>
Now time to start siptosis and skype on startup. add the following to /home/skype1/.vnc/xstartup and /home/skype1/.vnc/xstartup after the twm &
skype &
sleep 10
cd ~/siptosis
./SipToSis_linux >> ~/siptosis.log
Then restart the vncserver with
service vncserver restart
Now you have to log in to each of the vnc sessions again to port <ip address>:5901 and <ip address>:5902 when you log in you should see a pop up from skype asking if its ok for java4skype to connect. check the “Remember this answer” and click “Yes”. If the popup does not show up in the xterminal that started type cd ~/siptosis && ./SipToSis_linux. if it still does not work you might have forgot to do the chown or something else ( at that point comment at the bottom and I can try to help ). At this point you should have siptosis up and running the next step is to set up asterisk
Setting up Asterisk
Now we need to install some dependency’s
yum -y install kernel-devel kernel-PAE-devel
yum -y install make bison flex gcc-c++ gcc httpd php
yum -y install libogg-devel
yum -y install php-cli php-mysql php-pear php-gd curl
yum -y install sox ncurses-devel openssl-devel mysql-devel
yum -y install gtk2-devel
reboot
Once we have the dependency’s now lets download asterisk and other modules you can download and run a script i modified from ref1 at the bottom.
wget http://www.timholum.com/downloads/siptosky+asterisk/download.compile.asterisk.sh
chmod 777 download.compile.asterisk.sh
./download.compile.asterisk.sh
Note: The script only download’s extracts and does make and make install and in come cases make samples. If this does not work go to /usr/src go into all speex* zaptel* libpri* asterisk-1.4* asterisk-addons* and ./configure && make clean && make && make install if you get any error’s ( which you shouldn’t ) post them as comments and I will try to answer them if I can. Also you might need to install some different kerenl source’s if you are not using the standard kernel ( I had to thats why I added the PAE kernel as well ). If you do and you are having problems with it post the output of uname -a as a comment and I will help you install the correct kernel.
References:
http://www.voip-info.org/wiki/view/Asterisk+Zaptel+Installation
http://www.freepbx.org/support/documentation/howtos/how-to-set-up-a-skype-gateway
http://www.prestonmoore.com/images/centos53pbx.sh