Interacting with Skype via DBus/GLib

Osmo Antero Maatta osmoma at gmail.com
Sat Dec 25 07:55:34 PST 2010


Re-hello.
Many thanks to both Thomas and Alberto.

Now the Skype interface works very well.

I created a SkypeService object and registered it with
         
dbus_g_object_type_install_info(G_TYPE_FROM_INSTANCE(service_object), 
&dbus_glib_server_object_object_info);
         dbus_g_connection_register_g_object(dbus_conn, 
"/com/Skype/Client", (GObject*)service_object);
calls.

This following XML defines the skype_service_notify_callback(...) method 
and its argumets (it has only one).
See the skype-service-object.xml file.

<?xml version="1.0" encoding="UTF-8" ?>
<node>
<interface name="com.Skype.API.Client">
<method name="Notify">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" 
value="skype_service_notify_callback"/>
<arg type="s" name="message" direction="in"/>
</method>
</interface>
</node>

I converted it to skype-service-object-glue.h with
$ dbus-binding-tool --prefix=server_object --mode=glib-server 
skype-service-object.xml > skype-service-object-glue.h

The SkypeService object is described by skype-service.[hc]

Here is a functional example and test for the Skype - GLib/DBus interface.
http://www.futuredesktop.com/tmp/skype-test.tar.gz

Unpack the files, then compile and link with it
$ ./m.sh

Run
$ ./t1

Study the t1.c  for more information.

Again, thanks for the help and happy holidays :-)

Kindly
   Osmo Antero (Moma)
http://www.futuredesktop.org  (.com)



On 12/25/2010 11:29 AM, Alberto Mardegan wrote:
> On 12/25/2010 11:31 AM, Osmo Antero Maatta wrote:
>> But I have problems with setting the "Notify" signal right for Skype.
>> The example code below (t1.c) never receives notifications from the 
>> Skype.
>
> Yes, because "Notify" is not a signal, but a method:
>
>> method call sender=:1.121 -> dest=:1.124 serial=20
>> path=/com/Skype/Client; interface=com.Skype.API.Client; member=Notify
>> string "CALL 64 XXX"
>
> The py-test1.py program is registering an object, not a proxy. You 
> should not call dbus_g_proxy_new_for_name() in 
> skype_connect_dbus_signals(), but dbus_g_connection_register_g_object().
>
> HTH,
>   Alberto
>



More information about the dbus mailing list