|
This is a script to automate a few skype webcam workarounds, force skype to actually USE its proxy settings by restricting it to only access localhost(otherwise it just does whatever it wants regardless of the setting you tell it to use), and optionally start skype-call-recorder with skype.
What this script can do: (edit the script and set your options)
- Restrict traffic comming from skype to localhost - this is handy for those cases where you want skype to use a "ssh -D" socks tunnel even when there might be connectivity elsewhere. This enables me to redirect skype to a proxy on my network and thus identify its traffic to my router and elevate its priority accordingly.
- start skype with the "LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so XLIB_SKIP_ARGB_VISUALS=1 skype" so that webcam access works
- Explicitely set webcam resolution - for those cases where skype cant get it right and you cant get your cam working otherwise
- start skype-call-recorder with skype
This script is what i use on Fedora 13 witha cheap noname webcam. and it works for me. As of this writing to get cam working durring a call i have to'
- wait for the other party to start video.
- doublesize the call window
- then start video
- then stop video if it shows a grey screen
- then start video again and it should be working
Sure would be nice if the folks over at skype would make it so we didnt have to do all this stuff to make it work...
My traffic restriction code is based on this article - http://robotics.rtfmnet.com/?p=38
Notes on getting the traffic restriction and redirection working (from the script)
SOME POSSIBLE USE CASES:
- Routing skype traffic to another machine on your network so your router can identify skype traffic by ip(i use a stripped copy of ubuntu in a KVM virtual machine on my bridged ethernet connection(has its own ip on the network - not natted inside the machine)
- You are on a hostile network that blocks skype traffic(some cellular networks) or attempts to eaves-drop on it
- Your provider detects and penalizes skype traffic but not ssh traffic.
Skype will ignore any proxy setting you give it unless you give it NO OTHER CHOICE(ie it cant connect any other way). This section blocks skype from accessing anything other than localhost(127.0.0.1). this is useful if you plan to use "ssh -D" as a localhost socks proxy. from here you can ssh into any other machine and route your skype traffic through that machine over an encrypted tunnel.
The "sg tunneled skype" switches the program's running group to tunneled so iptables can identify it and force the program to only have access to localhost proxy settings for skype should be "localhost" on port <port>. you can use whatever port you want, i chose 25000 since its above the common service port range(1-1024), is easy to remeber and is not likely to be in use by anything else. with this in place you can tunnel your skype traffic using a standard ssh socks proxy or anything like that. dont forget to ssh -D 25000 user@host ideally in screen so accidentally closing the terminal doesnt kill your connection this ONLY WORKS for ssh -D and anything which binds to a port on localhost - it WONT force skype to use its proxy settings for another IP address(unless you change the iptables rules below, but i havent tested it to work with anything other than localhost) To get this going you will need to add the group "tunneled" to your system and add any user account which uses skype and need to use this feature to that group.as of Fedora 13 the commands to do this are: (you'll only need to do this once and it will be permanent across reboots)
sudo groupadd tunneled sudo gpasswd -a <your_user_name> tunneled
then in addition to running this script you need to do something like ssh -D 25000 user@host in a terminal somewhere any time skype is running. I recommend doing this in screen so closing the window doesnt kill your connections
|