標題: 教程 Siptosis and Asterisk [打印本頁] 作者: ckleea 時間: 2011-4-25 22:27 標題: 教程 Siptosis and Asterisk
本帖最後由 ckleea 於 2011-4-26 10:39 編輯
There are currently 2 ways to integrate skype with asterisk. The end result is to allow in and out call from other skype users to your skype account and even sip to skype (skype to sip/voip)
1. buy skype for asterisk from digium
pro: simple native support from big company; with support
cons: expensive, one channel costs US$66 (http://store.digium.com/productview.php?product_code=1SFA0001); not every asterisk platform support, in particular embedded asterisk. Therefore, IP01 cannot work with skype for asterisk
2. buy siptosis for asterisk from MHSpot.com http://www.mhspot.com/sts/siptosis_skype_trunk_howto.html
pro: inexpensive US$4.99 for siptosis, you can even get the free version to make it work
cons: require a delicate skype terminal i.e. either a PC running windows and skype or using skype for linux; knowledge of linux and software installation in linux.作者: ckleea 時間: 2011-4-25 22:27
本帖最後由 ckleea 於 2011-4-26 10:52 編輯
What is the SipToSis Skype Gateway?
SipToSis (Sip to Skype integration software) is Java software that allows you to make and receive Skype calls from your SIP/VOIP telephone adapter, SIP IP phone or Asterisk/SIP PBX. You can also make and receive SIP calls from Skype. It let's you integrate Skype into your SIP VOIP phone system. Basically a Skype/SIP Bridge/Gateway/Proxy/Adapter/Converter. It has a codec converter to convert SIP RTP audio to compatible Skype PCM audio and Skype PCM audio to SIP RTP audio. It performs SIP signaling and Skype call handling to connect with your SIP adapter, Asterisk Server, SIP PBX or SIP VOIP provider.
SipToSis SIP to Skype Gateway Features:
Call Skype users using mappings/speed dial or use SkypeOut to make PSTN calls from a SIP device
Make SIP calls from another Skype user using a SIP provider or SIP PBX (SkypeCaller-->Skype/SipToSis Host-->SIP)
Skype callers can be directed to the SIP address of your choice
SIP callers can be directed to the Skype user of your choice
SIP to Skype authentication/denial mappings via SIP caller ID and IP blocks
Skype to SIP authentication/denial mappings via incoming Skype User ID
Automatic authorization of new contacts as of version 20110324 - feature must be enabled
SIP DTMF touchtone decoding/encoding via RFC2833, INFO or Inband
Skype DTMF touchtone decoding/encoding via Inband
Connect Asterisk, FreePBX, Elastix, trixbox, PBX-in-a-Flash, 3CX or other SIP PBX to Skype Users
Conference call as of version 20091115 - See FAQ page for compatibility
Callback capability as of version 20091115 - See FAQ page for compatibility
Skype voicemail retrieval via SIP as of version 20091206
Outgoing Skype voicemail support as of version 20091206 - See FAQ page for compatibility
Auto play pre-recorded file(s) to SIP and Skype callers
SIP caller pin authentication and dialing
Skype caller pin authentication and dialing
PCMU (u-law)/PCMA (a-law)/G.711/iLBC included codecs and GSM with additional libs
Codec interface so you can add other codecs
SIP and Skype Hold
SkypeOut dialing rules - customize for your location
SIP outbound dialing rules - customize for your location
STUN support for public IP discovery
Call Time limiting ability
Usage limiting abilities by used time and unique called number count
Can be setup as a multi channel Skype to Asterisk Trunk for multiple simultaneous calls with the stsTrunkBuilder
Multiplatform (Windows/Linux/Mac OS X)
Run everything on a single computer if you wish
Windows users can run it as a service - see Appicus Windows Service Wrapper
SipToSis SIP to Skype Gateway System Requirements:
Skype client - http://www.skype.com/intl/en-us/get-skype/on-your-computer/linux
Sun/Oracle's Java 1.5 or higher (Linux users - Do NOT use openjdk)
SIP/VOIP adapter such as a SPA3102, SIP IP Phone, register with a SIP provider or setup an Asterisk/SIP PBX server
Skype4Java compatible platform
Sufficient bandwidth to support your configuration - Broadband preferred.
Skype compatible sound device
This product uses the Skype API but is not endorsed, certified or otherwise approved in any way by Skype.
SipToSis is GNU GPL Licensed software.作者: ckleea 時間: 2011-4-25 22:27
本帖最後由 ckleea 於 2011-4-26 10:55 編輯
Installation
1. Basic asterisk on linux installation and skype client installation
http://www.mhspot.com/sts/sts_install_centos.html
Here is some info for setting up Linux. I don't get into PBX or ATA details here.
Modify username and folders as needed.
Most instructions are for CentOS, some also apply to other distributions.
Install CentOS 5.4 x64
If you don't choose a GUI option you will have to deal with any missing packages and start x yourself.
Create a user called stsuser
I disabled the firewall for this setup example.
update first
yum update
login as stsuser
mkdir downloads
Install Skype
Download Skype - static version 2.1.0.81 to /home/stsuser/downloads
su (use sudo for Ubuntu)
cd /opt
tar jxvf /home/stsuser/downloads/skype_static-2.1.0.81.tar.bz2
ln -s skype_static-2.1.0.81 skype
ln -s /opt/skype /usr/share/skype
ln -s /opt/skype/skype /usr/bin/skype
On a CentOS Server some additional packages are needed:
yum install libXv
yum install libXScrnSaver
yum groupinstall "X Window System"
yum install alsa-lib
On a Server twm will be used during the configuration process so some changes are needed to make it work:
vi /etc/X11/twm/system.twmrc - add RandomPlacement above NoGrabServer line.
cp /etc/X11/twm/system.twmrc /home/stsuser/.twmrc
chown stsuser:stsuser /home/stsuser/.twmrc
exit
Ubuntu 64 bit distros need 32 bit libraries (file not found error)
Install getlibs-all.deb package from here
cd /opt/skype_static-2.1.0.81
sudo getlibs skype
Setup snd-dummy - required if no sound hardware
su (or sudo)
/sbin/modprobe snd-dummy
gedit (or vi) /etc/rc.local
add /sbin/modprobe snd-dummy before exit 0:
exit
Test that skype works on it's own.
cd /home/stsuser
For a Server, first startx
skype &
Install Sun/Oracle's Java - Do NOT use openjdk
Ubuntu: sudo apt-get install sun-java6-jre
CentOS and Ubuntu can use following procedure:
Download file: jre-6u18-linux-x64.bin to /home/stsuser/downloads from Java (Linux JRE x64 version.)
su - (Don't miss the minus, use sudo on Ubuntu)
cd /opt
/bin/sh /home/stsuser/downloads/jre-6u18-linux-x64.bin
Add stsuser to audio group - Needed for automatic bootup.
su
usermod -a -G audio stsuser
exit
Install SipToSis
Download SipToSis to /home/stsuser/downloads
mkdir /home/stsuser/siptosis
cd /home/stsuser/siptosis
unzip /home/stsuser/downloads/tmp_SipToSis.zip (fix file name as needed)
chmod +x SipToSis_linux
skype &
login or create your skype account.
./SipToSis_linux
accept API request.
At this point you should be able to make echo test from an ATA,Softphone or PBX using the 55 shortcut and the SipToSis contact url.
PBX users should setup SipToSis to register with the PBX before going further.
Single channel users only
chmod +x stsTrunk_linux
gedit (or vi) stsTrunk_linux
runuser=stsuser
scriptpath=/home/stsuser/siptosis
displayMethod=XVFB
Single channel boot setup
su
gedit (or vi) /etc/rc.local
Add following line before exit 0:
su -l stsuser -c "/home/stsuser/siptosis/stsTrunk_linux boot"
Note: if using snd-dummy, make sure modprobe is before siptosis startup command.
exit
Pulseaudio removal
sudo apt-get remove pulseaudio then reboot.
If you didn't have a sound card when installing Ubuntu run:
sudo alsactl init
Patching snd-dummy for more streams:
Ubuntu Procedure
Alsa dummy.c modification:
Get package Driver (alsa-driver) 1.0.22.1 from Alsa Project Download
cd /usr/src
sudo tar jxvf /pathtodownload/alsa-driver-1.0.22.1.tar.bz2
cd /usr/src/alsa-driver-1.0.22.1/alsa-kernel/drivers
Change line 152:
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
to:
static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
cd /usr/src/alsa-driver-1.0.22.1
sudo ./configure
sudo make
sudo make install
reboot
more /proc/asound/version - should show Alsa Driver version 1.0.22.1
This patch also works on 1.0.23/1.0.24 driver except it's line 66 instead.
There is some good info for compiling Alsa here.
Once the new snd-dummy is in place configure all skype clients (Mic/Spkrs/Ring) - set to Dummy, Dummy PCM (hw:1,0) or whatever it ends up as.
2. Setup SipToSis with a SIP Phone/ATA - Configuration
When installing skype to the centos 5 server, I follow the siptosis website instruction. In case you can't find the older skype, you may need to follow this link to install
Precompiled version of Skype 2.2 Beta for Linux requires a slightly newer version, libstdc++.so.6(GLIBCXX_3.4.9). Will install the libstdc++ package from Fedora 10, and make sure that it won't overwrite the one that came with the CentOS.
1. Download, install the GCC Standard C++ Library RPM from the Fedora 10 archive.
If you'd followed instructions given above, and now are trying to upgrade your system to CentOS 5.6, you may encounter the following error:
# yum update
[...]
ERROR with rpm_check_debug vs depsolve:
libstdc++.so.6(GLIBCXX_3.4.9) is needed by (installed) skype-2.2.0.25-2.el5.punkts.i386
libstdc++.so.6(GLIBCXX_3.4.9) is needed by (installed) skype-2.2.0.25-2.el5.punkts.i386
libstdc++.so.6(GLIBCXX_3.4.9) is needed by (installed) skype-2.2.0.25-2.el5.punkts.i386
libstdc++.so.6(GLIBCXX_3.4.9) is needed by (installed) skype-2.2.0.25-2.el5.punkts.i386
Complete!
(1, [u'Please report this error in https://bugzilla.redhat.com/ente ... 5&component=yum])
#
To work around this problem uninstall the libstdc++-4.3.2-7 package, upgrade libstdc++ to the version that comes with CentOS 5.6, and then install the libstdc++-4.3.2-7 package back in place.
For those using siptosis, I think you should not install more than one trunk if you do not have the trunk builder. For me, even I paid for the trunk builder before, when I want to manually create more trunks, I still encounter various problems e.g. port setting.
The trunk builder can help you to create the appropriate files and settings.
In my case, I can now manage to create 11 trunks (migrating back my VM image to the real server)