#!/usr/bin/env python import gobject, dbus from dbus.mainloop.glib import DBusGMainLoop from subprocess import call from subprocess import Popen tempfile = "/tmp/espeak.tmp.wav" def handle_call(obj_path, callernumber): if (callernumber != ''): print "%s is calling" % callernumber speak("%s is calling" % callernumber) else: print "caller id not submitted" speak("unknown caller") def speak(msg): call(["/usr/bin/espeak", "-w", tempfile, msg]) call(["/usr/bin/mplayer","-ao","pulse", tempfile]) speak("waiting for incoming calls") DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() bus.add_signal_receiver(handle_call, path='/com/nokia/csd/call', dbus_interface='com.nokia.csd.Call', signal_name='Coming') gobject.MainLoop().run()
[stream] exe = mplayer group = alwayson