* [Bluez-devel] Re: btsco - a few comments and a small .py script
@ 2005-08-21 12:58 Whoopie
0 siblings, 0 replies; only message in thread
From: Whoopie @ 2005-08-21 12:58 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 150 bytes --]
Hi,
great work, Andreas! Thanks!
I did a small modification so that you can also finish the call if the
call is in progress.
Thanks again,
Whoopie
[-- Attachment #2: skype_pickup.py --]
[-- Type: text/x-python, Size: 1455 bytes --]
#! /usr/bin/python
# -*- coding: iso-8859-15 -*-
import dbus, sys
class Api_obj:
def __init__(self):
remote_bus = dbus.SystemBus()
system_service_list = remote_bus.get_service('org.freedesktop.DBus').get_object('/org/freedesktop/DBus', 'org.freedesktop.DBus').ListServices()
skype_api_found = 0
for service in system_service_list:
if service=='com.Skype.API':
skype_api_found = 1
break
if not skype_api_found:
sys.exit('No running API-capable Skype found')
skype_service = remote_bus.get_service('com.Skype.API')
self.skype_api_object = skype_service.get_object('/com/Skype','com.Skype.API')
answer = self.send_message('NAME SkypeApiPythonBluetoothHeadset')
if answer != 'OK':
sys.exit('Could not bind to Skype client')
answer = self.send_message('PROTOCOL 1')
# if answer != 'PROTOCOL 1':
# sys.exit('This test program only supports Skype API protocol version 1')
answer = self.send_message('SEARCH ACTIVECALLS')
answer = answer[6:]
status = self.send_message('GET CALL '+answer+' STATUS')
status = status[15:]
if status == 'INPROGRESS':
answer = self.send_message('SET CALL '+answer+' STATUS FINISHED')
else:
answer = self.send_message('SET CALL '+answer+' STATUS INPROGRESS')
# Client -> Skype
def send_message(self, message):
answer = self.skype_api_object.Invoke(message)
return answer
def main():
api_object = Api_obj()
return 0
if __name__ == "__main__":
main()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-21 12:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-21 12:58 [Bluez-devel] Re: btsco - a few comments and a small .py script Whoopie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.