View Single Post
Posts: 1,100 | Thanked: 2,797 times | Joined on Apr 2011 @ Netherlands
#6
The code can be literally found on the related wiki page (https://wiki.maemo.org/PyMaemo/Phone...d_SMS_examples)


HTML Code:
import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop
 
def handle_sms(pdu, msgcenter, somestring, sendernumber):
    print 'New message from %s' % sendernumber
 
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_sms, path='/com/nokia/phone/SMS',   dbus_interface='Phone.SMS', signal_name='IncomingSegment')
gobject.MainLoop().run()
I have not tested this, but I used to have a similar script to act on incoming phonecalls.
 

The Following 3 Users Say Thank You to ade For This Useful Post: