From: Pekka Pessi <pekka.pe...@nokia.com> --- test/answer-calls | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/test/answer-calls b/test/answer-calls index 0deb832..1218c66 100755 --- a/test/answer-calls +++ b/test/answer-calls @@ -4,8 +4,11 @@ import dbus bus = dbus.SystemBus() -manager = dbus.Interface(bus.get_object('org.ofono', '/'), - 'org.ofono.Manager') +def oface(path, name): + obj = bus.get_object('org.ofono', path) + return dbus.Interface(obj, name) + +manager = oface('/', 'org.ofono.Manager') modems = manager.GetModems() @@ -15,8 +18,7 @@ for path, properties in modems: if "org.ofono.VoiceCallManager" not in properties["Interfaces"]: continue - mgr = dbus.Interface(bus.get_object('org.ofono', path), - 'org.ofono.VoiceCallManager') + mgr = oface(path, 'org.ofono.VoiceCallManager') calls = mgr.GetCalls() @@ -24,10 +26,8 @@ for path, properties in modems: state = properties["State"] print "[ %s ] %s" % (path, state) - if state != "incoming": - continue - - call = dbus.Interface(bus.get_object('org.ofono', path), - 'org.ofono.VoiceCall') + if state == "incoming": + oface(path, 'org.ofono.VoiceCall').Answer() + elif state == "waiting": + mgr.HoldAndAnswer() - call.Answer() -- 1.7.1 _______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono