[Telepathy] What am I doing wrong?

Jonas sanoix at gmail.com
Mon Jul 24 07:01:03 PDT 2006


I'm experimenting with D-Bus and Telepathy as I like the concept.. But
I find the documentation a lil confusing.. I have written a piece of
code that refuses to work as it should, can someone help?

When I run it I get this message:

Error: Method "GetMandatoryParameters" with signature "s" on interface
"org.freedesktop.Telepathy.ConnectionManager.gabble" doesn't exist

Here's the code (please reply to my email as I'm not registered on the
mailing list).

---------------------------------------------------------
#define DBUS_API_SUBJECT_TO_CHANGE 1

#include <stdio.h>
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>

#define BUS_NAME        "org.freedesktop.Telepathy.ConnectionManager.gabble"
#define OBJECT_PATH
"/org/freedesktop/Telepathy/ConnectionManager/gabble"

int
main (int argc, char **argv)
{
  DBusGConnection *connection;
  GError *error;
  DBusGProxy *proxy;
  GHashTable *parameters;

  g_type_init ();

  error = NULL;
  connection = dbus_g_bus_get (DBUS_BUS_SESSION,
                               &error);
  if (connection == NULL)
    {
      g_printerr ("Failed to open connection to bus: %s\n",
                  error->message);
      g_error_free (error);
      return 1;
    }

  proxy = dbus_g_proxy_new_for_name (connection,
                                     BUS_NAME,
                                     OBJECT_PATH,
                                     BUS_NAME);

  error = NULL;
  if (!dbus_g_proxy_call (proxy, "GetMandatoryParameters", &error,
                                G_TYPE_STRING, "jabber", G_TYPE_INVALID,
                                DBUS_TYPE_G_STRING_STRING_HASHTABLE,
&parameters, G_TYPE_INVALID))
    {
      /* Just do demonstrate remote exceptions versus regular GError */
      if (error->domain == DBUS_GERROR && error->code ==
DBUS_GERROR_REMOTE_EXCEPTION)
        g_printerr ("Caught remote method exception %s: %s",
                    dbus_g_error_get_name (error),
                    error->message);
      else
        g_printerr ("Error: %s\n", error->message);
      g_error_free (error);
      return 1;
    }

  /* Now we should have the results in 'parameters' */

  g_object_unref (proxy);

  return 0;
}

---------------------------------------------------------


More information about the Telepathy mailing list