7 def onCallStatus(sender = "", *args, **kwargs):
9 if (args[1].has_key("peer")):
10 caller = str(args[1]["peer"])
21 bus = dbus.SystemBus()
23 usage_obj = bus.get_object("org.freesmartphone.ousaged", "/org/freesmartphone/Usage")
24 usage_iface = dbus.Interface(usage_obj, "org.freesmartphone.Usage")
25 usage_iface.RequestResource("GSM")
27 gsm_device_obj = bus.get_object("org.freesmartphone.ogsmd", "/org/freesmartphone/GSM/Device")
28 gsm_device_iface = dbus.Interface(gsm_device_obj, "org.freesmartphone.GSM.Device")
29 gsm_call_iface = dbus.Interface(gsm_device_obj, "org.freesmartphone.GSM.Call")
31 print "Set Functionality: full"
32 gsm_device_iface.SetFunctionality("full", True, "")
34 gsm_call_iface.connect_to_signal('CallStatus', onCallStatus)
36 id = gsm_call_iface.Initiate(number, "voice")
39 gsm_call_iface.Release(id)
41 gsm_device_iface.SetFunctionality("minimal", True, "")
42 usage_iface.ReleaseResource("GSM")
44 if __name__ == "__main__":
46 if len(sys.argv) != 2:
47 sys.stderr.write("usage: %s <number>\n")