You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

from gi.repository import GLib
import sys
import dbus
import dbus.mainloop.glib
def mw_property_changed(name, value):
if name == 'VoicemailMessageCount':
print("MessageWaiting property: '%s' changed to '%d'" %\
print("MessageWaiting property: '%s' changed to '%s'" %\
if __name__ == "__main__":
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
mw = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
mw.connect_to_signal("PropertyChanged", mw_property_changed)
properties = mw.GetProperties()
print("Voicemail waiting: %s" % (properties['VoicemailWaiting']))
print("Voicemail message count: %d" %\
print("Voicemail mailbox number: %s" %\
mainloop = GLib.MainLoop()