[Ekiga-list] Using Dbus



I've been trying to get a perl script to use dbus but I'm having some
problems. I get the timed out or a no reply errors:

org.freedesktop.DBus.Error.TimedOut: Activation of net.ekiga.instance
timed out

org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible
causes include: the remote application did not send a reply, the
message bus security policy blocked the reply, the reply timeout
expired, or the network connection was broken.

The script is pretty much hacked out of the one in the dbus readme
supplied with ekiga:

#####################################

#!/usr/bin/perl -w

use strict;
use Net::DBus;
use Net::DBus::Reactor;

my $bus = Net::DBus->session
    or die "Can't connect to the session D-Bus";

my $service = $bus->get_service("net.ekiga.instance")
    or die "Can't find the Ekiga instance on the D-Bus";

my $object = Net::DBus::RemoteObject->new($service, '/net/ekiga/instance',
    'net.ekiga.calls') or die "Can't get the ekiga instance";

$object->connect_to_signal('StateChanged', sub {
    my ($callid, $state) = @_;
    open my $start, '>', '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.3/show_icon >/dev/null 2>&1';
    open my $stop, '>', '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.3/hide_icon >/dev/null 2>&1';
    print $state;
    if ($state == 4) {
        print $start "RINGTONE";
    } else {
        print $stop "RINGTONE";
    }
    close $start;
    close $stop;
});
#############################

Basically it make my phone ring using its ringtone function.

The actual 'instance' service file doesn't exist in Slackware so I grabbed one from an RPM. Perhaps recent versions don't use
it anymore?

Anyway if anyone could help it would great.

Dave

--
Don't look back, the lemmings are gaining on you.

Attachment: pgpXvB6NInW41.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]