PSU VoIP blog reader Oskar contributed an updated patch for GTalk shared status/invisible in Asterisk 11. You may recall that I hacked this functionality in to Asterisk 1.8. Oskar’s updates work the same way, now part of res_xmpp instead of the deprecated res_jabber. Thanks, Oskar!
Tag Archives: asterisk
Astricon 2012 recap
Time to dust off the blog.
Skype for Asterisk using FreeSWITCH, for hackers
Log in to your system’s command line interface and perform all the steps as root unless otherwise instructed.
If any step results in an error where the command is not found, you may need to install the program using yum (yum install
program name) or build the program from sources on the web. You can find Git at http://git-scm.com/.
git clone git://git.freeswitch.org/freeswitch.git
Refer to the FreeSWITCH installation wiki for installing FS from Git: http://wiki.freeswitch.org/wiki/Installation_Guide to install from Git
cd freeswitch
./bootstrap.sh
./configure
Edit modules.conf and uncomment endpoints/mod_skypopen because we want to build it.
Make sure kernel sources are installed (yum install kernel-devel
on CentOS)
Also make sure there are no sound modules already loaded in the kernel. lsmod | grep snd
If there are any, they should be removed prior to performing the next steps.
cd src/mod/endpoints/mod_skypopen/oss
make clean; make; insmod ./skypopen.ko; mknod /dev/dsp c 14 3
If no errors appear, this verifies that the kernel module installs OK.
Add all the prerequisite components from yum (listed in the wiki for your distro) – for Amazon Linux I added:
yum -y install autoconf automake gcc-c++ git-core libjpeg-devel libtool
make ncurses-devel unixODBC-devel openssl-devel gnutls-devel libogg-devel
libvorbis-devel curl-devel libtiff-devel libjpeg-devel subversion autoconf
automake libtool gcc-c++ ncurses-devel make libX11-devel Xvfb alsa-utils
libXv libXScrnSaver xorg-x11-fonts* alsa-lib libXScrnSaver libtiff-devel
libjpeg-devel kernel-devel git
alsa-lib.i686 fontconfig.i686 freetype.i686 glibc.i686 libgcc.i686
libICE.i686 libSM.i686 libstdc++.i686 libX11.i686 libXau.i686 libxcb.i686
libXcursor.i686 libXext.i686 libXfixes.i686 libXi.i686 libXinerama.i686
libXrandr.i686 libXrender.i686 libXScrnSaver.i686 libXv.i686
yum install xauth
but you should use the list provided in the wiki for your own distro. Refer to http://wiki.freeswitch.org/wiki/Mod_skypopen
Back to freeswitch source dir: cd /usr/local/src/freeswitch
make
make install
mv /usr/local/src/freeswitch/src/mod/endpoints/mod_skypopen/oss/skypopen.ko /usr/local/lib
New – March 2012: the archives at kernel.org/archlinux have been repackaged with “xz”. So first install the xz tool: yum install xz
Then perform the following steps.
cd /
wget "http://mirrors.kernel.org/archlinux/community/os/i686/skype-oss-2.0.0.72-3-i686.pkg.tar.xz"
xzcat skype-oss-2.0.0.72-3-i686.pkg.tar.xz | tar xv
Start and login to Skype as regular user through X. This may be tricky. I use SSH tunneling and on my workstation (Mac) I have X11 available to display X programs. If you want to do it at your server console you’ll need to install X11.org or maybe just use vncserver. There are a few options here. Setting up a way to run X programs = exercise left for the reader.
Log out of Skype after successfully logging in once. The Skype config is in /home/username/.Skype
.
Copy it to /root (so that you have /root/.Skype
). If you just ran Skype as root, the config is already in the right place.
Edit the /root/.Skype/SKYPEUSERNAME/config.xml
file and add the bolded lines in before the Reminders tag at the bottom:
<UI>
<API>
<Authorizations>skypopen</Authorizations>
<BlockedPrograms></BlockedPrograms>
</API>
<Reminders>
<BirthdaysSeen></BirthdaysSeen>
</Reminders>
</UI>
Now start the phony X server, Xvfb: (as root)
/usr/bin/Xvfb :101 -ac -nolisten tcp -screen 0 640x480x8 &
Start Skype as root:
su root -c "/bin/echo 'SKYPEUSERNAME SKYPEPASSWORD'| DISPLAY=:101 skype --pipelogin &"
Skype is now running in the background on the phony X server and should be logged in to your account.
Put the following extremely simplified freeswitch.xml file in place in /usr/local/freeswitch/conf (overwrite what is there):
Simplified Skype-to-Asterisk-via-FreeSWITCH config
Change all occurrences of SKYPEUSERNAME in the XML file with your Skype user name.
Now start Freeswitch:
ulimit -s 240
/usr/local/freeswitch/bin/freeswitch -c
See what scrolls by. The Skypopen module should find your logged in Skype user. Test with “sk list”
Once you see that it is working you can configure the kernel sound driver, the phony X server, skype, and Freeswitch to all start at boot time using rc.local:
Put at the bottom of /etc/rc.local:
# freeswitch
# Skype driver insmod /usr/local/lib/skypopen.ko mknod /dev/dsp c 14 3 # Skype /usr/bin/Xvfb :101 -ac -nolisten tcp -screen 0 640x480x8 & sleep 3 su root -c "/bin/echo 'SKYPEUSERNAME SKYPEPASSWORD'| DISPLAY=:101 /usr/bin/skype --pipelogin &" # Freeswitch main ulimit -s 240 /usr/local/freeswitch/bin/freeswitch -nc ###
Now you have FreeSWITCH connected to Skype and Skype is logged in. It is time to configure Asterisk.
Incoming Skype calls will ring sip:75973@127.0.0.1, so asterisk needs to be listening on 127.0.0.1 (it does by default) and have a route for number 75973. If you write your own Asterisk config files, add some dialplan in extensions.conf to route 75973 to wherever you want. For FreePBX, set up an Inbound Route for DID 75973 and route it where you’d like your incoming Skype calls to go.
Outgoing calls should be sent to num-or-skype-name@127.0.0.1:5050 from Asterisk. If you edit configs by hand, set up extension routing to SIP/${exten}@127.0.0.1:5050 as appropriate or if you use FreePBX, create a Trunk – SIP with host=127.0.0.1 and port 5050 or just create a custom trunk as SIP/$OUTNUM$@127.0.0.1:5050.
If you configured NAT on Asterisk, be sure to exclude 127.0.0.1 from the NAT. (localnet=127.0.0.0/255.0.0.0 in sip.conf or configured through the FreePBX GUI).
Asterisk 10 and SCF
Today’s final session of Astricon was an update on Asterisk 10, Asterisk SCF and DAHDI, the Digium hardware driver.
Astricon update
Before: Monday afternoon, high 70s, beautiful fall colors | After: Wednesday morning, about 30 degrees, several inches of snow! |
To Astricon ’11
There has hardly been a moment to blog in the past few weeks.
Open-source IP telephony and the systems administration dilemma
grep
. The truth is, inability to navigate Linux and the Asterisk command line is crippling.- ability to navigate the Linux filesystem comfortably and know where certain kinds of files typically are (logs are in /var/log, config files are in /etc, executables in /usr/bin and so on)
- ability to use a text editor
- handiness with
find
,grep
- ability to correctly configure a firewall or packet filter such as
iptables
- ability to read syslogs and follow clues to solve a problem
- familiarity with the operating system’s package system (such as
yum
/RPM with CentOS) so that he/she can easily load necessary tools - some familiarity with development tools such as
make
,gcc
,configure
scripts,cvs
andsvn
, and the ability to decipher output they produce - ability to configure user accounts and passwords
- some familiarity with network diagnostic tools like
netstat
andtcpdump
- for FreePBX, familiarity with command-line MySQL for database troubleshooting
- for Asterisk’s mail needs (voicemail or fax to e-mail), ability to configure some mail sender
Is it a tall order? Yes, there is a learning curve. It’s not Windows 7. But, like learning a foreign language, when you go into the foreign land (Linux console) and can speak the language, you are empowered.
Asterisk on Amazon EC2 cloud; Google Voice update
Some quick updates on interesting topics featured on this blog.
A free, open-source SIP-H.323 gateway with video?
Has anyone implemented a video-capable SIP-H.323 gateway using free, open-source software?
If so, please comment.
Asterisk, FreeSWITCH and YATE all have some ability to connect SIP and H.323 endpoints to one another. Asterisk acts as a back-to-back user agent (B2BUA) and the other two act as proxies. All can switch audio calls. Video seems to be another story.
In theory, it should be straightforward. The difficult part is translating the signaling; the media streams are the same. Thus the interworking component (PBX, switch, or proxy) should be able to translate signaling and then proxy the media between the endpoints. If video is just another media stream, why doesn’t it work just the same as an audio-only call?
I’ve tested YATE (built-in modules), Asterisk’s chan_ooh323, a custom chan_ooh323 for Asterisk 1.4 that specifically enables video (but crashes/disconnects, and is definitely not supported unless you buy the unnamed company’s video IVR product, which I haven’t), FreeSWITCH’s mod_h323 and mod_opal. I never really got the FreeSWITCH mods working stably. YATE and Asterisk worked fine in audio mode. Neither would translate video (H.263 protocol, nothing fancy).
Additional reading: RFC 4123, Session Initiation Protocol (SIP)-H.323 Interworking Requirements
Skype gateway with FreeSWITCH’s mod_skypopen
There has been a lot of talk about Skype connectivity in the VoIP blogs lately. Digium announced that they will no longer be selling their Skype channel driver, and this news rekindled interest in free/DIY methods for connecting Skype to Asterisk. Nerd Vittles has a good writeup, specific to the PBX-in-a-Flash/Incredible PBX implementation. His method relies on the SipToSis gateway application (read the SipToSis how-to for more generic setup instructions).
If you are only wanting to receive Skype calls, you can transfer them to your PBX via Tropo developer account, free.
I decided to add Skype to my home PBX last weekend, and chose FreeSWITCH’s mod_skypopen as the connector.
Why?
- The PBX is Asterisk 1.4, and I’m holding steady on this version until 1.8 becomes a bit more stable. Thus, because I want to use Google Voice,
- FreeSWITCH is already in place, on the same machine, as a gateway to Google Voice. It has been working well in this role.
- mod_skypopen requires only the FreeSWITCH module and Skype. No extra connector software is required.
- It works and was easy to install!
Asterisk 1.4 continues to be a rock-solid choice and is supported (security patches will be provided) for another year. For me, the only killer feature that 1.8 provides is Google Voice connectivity. There are bunch of other new features too, but I don’t need them. Stick with that which works, until you need the features or the support is gone.
Back to mod_skypopen. There are basically two ways to install this to FreeSWITCH. The easy way, and the hard way.
Today, the easy way. If you visit the FreeSWITCH wiki page on mod_skypopen, you’ll find some notes on building and installing the module. If you’re running a fairly standard install of FreeSWITCH that utilizes the autoload_configs structure, you can follow through the wiki instructions to build the module and the fake audio driver and then run the Perl installer found in the source directory to automatically build out your configs, configure the Skype client(s) and set up a shell script to get everything going at startup.
If, like me, you have set up FreeSWITCH only to act as a feature gateway for Asterisk, and have aggressively minimized the configuration, you’ll want to avoid the installer script and perform the necessary steps by hand. More on that in the next posting: “the hard way.” (Not really that hard.)