From 49da0e11bcf74790bf7277dc0af43c1600c5dd69 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 21 May 2009 18:57:44 -0500 Subject: [PATCH] Make voicecall test a bit more generic --- test/test-voicecall | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/test-voicecall b/test/test-voicecall index 2c43058e..a3fb918f 100755 --- a/test/test-voicecall +++ b/test/test-voicecall @@ -4,6 +4,11 @@ import gobject import dbus import dbus.mainloop.glib +import sys + +def hangup_all(): + print "Hanging up" + vcmanager.HangupAll() def print_calls(value): for p in value: @@ -33,6 +38,12 @@ def voicecall_property_changed(name, value): if __name__ == "__main__": global vcmanager + if (len(sys.argv) < 2): + print "Useage: %s " % (sys.argv[0]) + sys.exit(1) + + number = sys.argv[1] + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() @@ -56,7 +67,7 @@ if __name__ == "__main__": voicecalls_property_changed('Calls', properties['Calls']) print "Dialing...." - obj = vcmanager.Dial("444555", "enabled") + obj = vcmanager.Dial(number, "") print "Dialing in progress, got obj: %s" % (obj) call = dbus.Interface(bus.get_object('org.ofono', obj), @@ -69,5 +80,7 @@ if __name__ == "__main__": call.connect_to_signal("PropertyChanged", voicecall_property_changed) + gobject.timeout_add(5000, hangup_all) + mainloop = gobject.MainLoop() mainloop.run()