Sunday, January 25, 2009

SIP client for Windows (using ekiga SIP service)

After long time of crawling the web, I have found a solution to use the ekiga.net SIP service from Windows. Many of my friends use skype, but it is an annoying part of software. So I started using ekiga and ekiga.net as provider.

Microsoft itselfs provides a SIP client (netmeeting). The developer of Ekiga provides a nice howto.

Monday, January 12, 2009

Getting DBUS Messages from Networkmanager (Python)

I had some spare time and so I started playing with DBUS. I was annoyed that after NetworkManager established a connection I always start the same programs like ekiga, pidgin, firefox and evolution. So I wrote a small python program that start software if the NetworkManager singals an open connection via DBUS. The NetworkManager DBUS-API is available. The hardest part was to find the docs.
#!/usr/bin/python
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import dbus
import subprocess

def signal_deviceNowActive(data=None):
  if data is not None and data[dbus.String("State")] == 2 :
    subprocess.Popen("ps -C pidgin    || pidgin &", shell=True)
    subprocess.Popen("ps -C ekiga     || ekiga &", shell=True)
    subprocess.Popen("ps -C evolution || evolution &", shell=True)

print "init loop"

DBusGMainLoop(set_as_default=True)

loop = gobject.MainLoop();

print "init dbus"

dbus.SystemBus().add_signal_receiver(signal_deviceNowActive, signal_name=None, dbus_interface="org.freedesktop.NetworkManager.Connection.Active")

print "start loop"

loop.run() //UPDATE: thanks for your comment