All of lore.kernel.org
 help / color / mirror / Atom feed
From: Whoopie <whoopie79@gmx.net>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Re: btsco - a few comments and a small .py script
Date: Sun, 21 Aug 2005 14:58:48 +0200	[thread overview]
Message-ID: <43087A88.4030306@gmx.net> (raw)

[-- 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()

                 reply	other threads:[~2005-08-21 12:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43087A88.4030306@gmx.net \
    --to=whoopie79@gmx.net \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.