[Asterisk-Users] Skype gateway

trixter aka Bret McDanel trixter at 0xdecafbad.com
Wed Jul 5 03:44:31 MST 2006


On Wed, 2006-07-05 at 12:18 +0200, Patrick wrote:
> I read the page about the Skype API at 
> https://developer.skype.com/Docs/ApiDoc/Using_the_Skype_API_on_Linux
> Not being a programmer, I wonder if it's possible to use the API and the
> examples at the end of the page to come up with some way to interface
> Asterisk and Skype. Possible at all? Anyone tried that yet?


Its not an API as most people think of the term, it technically is an
API however ...  What the skype API lets you do is remote control the
skype GUI.  This means that you *must* have a sound card and a GUI for
the skype client to run.

You can use the X virtual frame buffer to get around no GUI.  It
pretends to be an X server, but requires no video hardware, its all in
memory.  

You can also remap the sound calls (skype uses OSS so remap open/close,
read/write and ioctl to /dev/dsp which isnt that hard to do, I have code
that does this already).  This gives you a device which you can
send/receive audio in a known format (the ioctl sets the sample rate,
bits per second, number of channels, etc - and the program would know
what those settings are).  

By doing all that you could interface skype fairly easily using dbus
(how the skype gui is accessed in X).  This however does add a real cost
to doing skype, further you are limited to whatever the skype client
lets you do, such as 1 channel or whatever.

Now if you want to have a skype library that speaks the skype protocol
that could happen, but it wont be easy.  Skype uses a very weak, but
still present encryption scheme on  the binary (XOR with a fixed pattern
on some but not all sections).  It is decrypted in memory, and they do
checks to see if a debugger is being used, if it is it refuses to run.
People have documented how to disable this (which becuase it also
verifies the checksum of the binary, you have to do it after loading the
file).  Gotta wonder why they went to so much effort to obfuscate the
binary.

Once you get access to the internals of the program you could
potentially figure out how it communicates, look into the crypto
routines and see how its dealing with keys and the like.  And once you
have mapped all that out and mapped out the protocol, and think you have
a working library, you get to start all over becuase ebay/paypal/skype
decided to change it on you and possibly sue you since that is a
violation of their TOS to do (that is also potentially a felony in the
US per 18 USC 1030 - the hacking statute, it wont be an automatic one
becuase of the elements required but it could be fairly easily).

In short, you gotta ask yourself, if they dont want to play nice with
others is it really worth it for someone to try to play with them and
constantly play catch up?

Skype also uses wideband codecs, something asterisk has problems with,
so you would lose the "better sounding audio" that skype offers if you
run it through an asterisk box.


-- 
Trixter http://www.0xdecafbad.com     Bret McDanel
Belfast IE +44 28 9099 6461    DE +49 801 777 555 3402
Utrecht NL +31 306 553058      US WA +1 360 207 0479
US NY +1 516 687 5200          FreeWorldDialup: 635378
http://www.trxtel.com the VoIP provider that pays you!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060705/2ed54ace/attachment.pgp


More information about the asterisk-users mailing list