6 if (len(sys.argv) < 2):
7 print "Usage: %s [modem] <ussd-string>" % (sys.argv[0])
10 bus = dbus.SystemBus()
12 manager = dbus.Interface(bus.get_object('org.ofono', '/'),
15 modems = manager.GetModems()
17 if (len(sys.argv) == 2):
19 ussdstring = sys.argv[1]
22 ussdstring = sys.argv[2]
24 ussd = dbus.Interface(bus.get_object('org.ofono', path),
25 'org.ofono.SupplementaryServices')
27 properties = ussd.GetProperties()
28 state = properties["State"]
30 print "State: %s" % (state)
35 result = ussd.Initiate(ussdstring, timeout=100)
37 properties = ussd.GetProperties()
38 state = properties["State"]
40 print result[0] + ": " + result[1]
45 print "State: %s" % (state)
47 while state == "user-response":
48 response = raw_input("Enter response: ")
50 result = ussd.Respond(response, timeout=100)
52 properties = ussd.GetProperties()
53 state = properties["State"]
58 print "State: %s" % (state)