Hi Guillaume,
Makefile.am | 3 ++-
test/hangup-call | 28 ++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletions(-)
create mode 100755 test/hangup-call
diff --git a/Makefile.am b/Makefile.am
index 7e8f12c..8cf6920 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -625,7 +625,8 @@ test_scripts = test/backtrace \
test/swap-calls \
test/release-and-answer \
test/hold-and-answer \
- test/hangup-multiparty
+ test/hangup-multiparty \
+ test/hangup-call
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/hangup-call b/test/hangup-call
new file mode 100755
index 0000000..0765919
--- /dev/null
+++ b/test/hangup-call
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+path = modems[0][0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.VoiceCallManager')
+
+calls = manager.GetCalls()
+if (len(calls) == 0):
+ print "No calls available"
+ sys.exit(1)
these are test scripts. So just remove the "no calls" check. I rather
see a D-Bus exception than trying to work around it.
+
+if (len(sys.argv) < 2):
+ print "Usage: %s [ Call Path ]" % (sys.argv[0])
+ sys.exit(1)
+
+call = dbus.Interface(bus.get_object('org.ofono', sys.argv[1]),
+ 'org.ofono.VoiceCall')
+call.Hangup()
Regards
Marcel