smsutil: Fix warning
[platform/upstream/ofono.git] / test / hangup-active
1 #!/usr/bin/python
2
3 import sys
4 import dbus
5
6 bus = dbus.SystemBus()
7
8 manager = dbus.Interface(bus.get_object('org.ofono', '/'),
9                                                 'org.ofono.Manager')
10
11 modems = manager.GetModems()
12 path = modems[0][0]
13
14 manager = dbus.Interface(bus.get_object('org.ofono', path),
15                                                 'org.ofono.VoiceCallManager')
16
17 calls = manager.GetCalls()
18
19 for path, properties in calls:
20                 state = properties["State"]
21                 print "[ %s ] %s" % (path, state)
22
23                 if state != "active":
24                         continue
25
26                 call = dbus.Interface(bus.get_object('org.ofono', path),
27                                                 'org.ofono.VoiceCall')
28
29                 call.Hangup()