View Single Post
Posts: 479 | Thanked: 1,284 times | Joined on Jan 2012 @ Enschede, The Netherlands
#19
I'm trying to listen for a call from a specific phone number to act upon. It seems almost trivial to make in QtQuick, analogous to how PhoneHook handles it:

QML:
Code:
DBusInterface {
    id:              activeCall
    service:         'org.nemomobile.voicecall'
    path:            '/calls/active'
    iface:           'org.nemomobile.voicecall.VoiceCall'
    signalsEnabled:  true

    function lineIdChanged() {
        console.log("Got: " + activeCall.getProperty("lineId"));
    }
}
Yet, this doesn't work. Possibly because that path doesn't exist until an call becomes active. I have a work around, by first listening for a active call, then rebinding the VoiceCall interface from above:

Code:
DBusInterface {
    service:         'org.nemomobile.voicecall'
    path:            '/'
    iface:           'org.nemomobile.voicecall.VoiceCallManager'
    signalsEnabled:  true

    function activeVoiceCallChanged() {
        activeCall.path = "/calls/active";
        if (activeCall.getProperty("isIncoming")) {
        …
        }
    }
}
The magic here is in the activeCall.path = "/calls/active";.

But this method is ugly, and isn't reliable because it seems the (correct) lineId isn't always immediately available when an incoming call arrives.

So, is this a bug in the DBusInterface plug-in, or am I missing something?
 

The Following 4 Users Say Thank You to Fuzzillogic For This Useful Post: