2014-03-11 16:39:22 +00:00
|
|
|
#!/usr/bin/python3
|
2010-09-26 14:25:20 +00:00
|
|
|
|
|
|
|
import dbus
|
|
|
|
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
|
|
|
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
|
|
|
'org.ofono.Manager')
|
|
|
|
|
|
|
|
modems = manager.GetModems()
|
|
|
|
|
|
|
|
for path, properties in modems:
|
2014-03-11 16:39:18 +00:00
|
|
|
print("[ %s ]" % (path))
|
2010-09-26 14:25:20 +00:00
|
|
|
|
|
|
|
if "org.ofono.VoiceCallManager" not in properties["Interfaces"]:
|
|
|
|
continue
|
|
|
|
|
|
|
|
mgr = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.VoiceCallManager')
|
|
|
|
|
|
|
|
calls = mgr.GetCalls()
|
|
|
|
|
|
|
|
for path, properties in calls:
|
|
|
|
state = properties["State"]
|
2014-03-11 16:39:18 +00:00
|
|
|
print("[ %s ] %s" % (path, state))
|
2010-09-26 14:25:20 +00:00
|
|
|
|
|
|
|
if state != "incoming":
|
|
|
|
continue
|
|
|
|
|
|
|
|
call = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.VoiceCall')
|
|
|
|
|
|
|
|
call.Answer()
|