Reply
Thread Tools
coderus's Avatar
Posts: 6,431 | Thanked: 12,683 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#51
Sorry, i have no voicemails option on my operator, i can't test it. But if you give me information about dbus names to fetch status i can make proper daemon.
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following 6 Users Say Thank You to coderus For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#52
Originally Posted by coderus View Post
Sorry, i have no voicemails option on my operator, i can't test it. But if you give me information about dbus names to fetch status i can make proper daemon.
Sorry, I don't know all this terminology, what you mean "dbus names"? Maybe Zeta can provide needed information...

You can use
Code:
dbus-send --system --type=method_call --print-reply --dest=org.ofono /ril_0  org.ofono.MessageWaiting.GetProperties
or this:
Code:
/usr/lib/qt5/bin/qdbus --system org.ofono /ril_0  org.ofono.MessageWaiting.GetProperties
to check if voicemail "true" that mean have voicemail message. But you say your operator not have voicemail option...
 

The Following 4 Users Say Thank You to Schturman For This Useful Post:
coderus's Avatar
Posts: 6,431 | Thanked: 12,683 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#53
I can build fully working application without trying it, don't worry. This info is enough, thanks. Will return here after building application.
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following 7 Users Say Thank You to coderus For This Useful Post:
Posts: 339 | Thanked: 1,622 times | Joined on Oct 2013 @ France
#54
Schturman,

Thanks for the code.

I said I wouldn't work on this today, but you made me think a lot about it, and I got back to it...

I took my work back were I left it before switching to QML. I was doing a trigger in phonebot (which I had running, so only a question of easy way of doing it for me at the time). Making some changes in the notification plugin to add the category, I got (almost) the same results as you, but using only signals, no polling.

Here is the core of the Qt C++ part that does it, using the qofono object of nemo (who does all the work as in the QML patch) :
Code:
// There may be some includes missing, I cleaned this list manually when pasting it here...
#include "qofonomanager.h"
#include "qofonomodem.h"
#include "qofonomessagewaiting.h"


// In the class constructor:
   _ofonoMessageWaiting = new QOfonoMessageWaiting(this);

    QOfonoManager* manager = new QOfonoManager(this);
    QStringList modems = manager->modems();

    if (modems.size() == 0)
    {
        qDebug() << "No modem found";
        return;
    }

    _ofonoMessageWaiting->setModemPath(modems.at(0));

    if (! _ofonoMessageWaiting->isValid())
    {
        qDebug() << "QOfonoMessageWaiting object invalid" << _ofonoMessageWaiting;
        return;
    }

    // This does the work : connecting to a slot in the class, from the signal that qofono sends when there is a change.
    connect(_ofonoMessageWaiting,SIGNAL(voicemailWaitingChanged(bool)), this, SLOT(voicemailWaitingChanged(bool)));

        // To avoid loosing message, the content is checked at init, and not only when changing:
    voicemailWaitingChanged(_ofonoMessageWaiting->voicemailWaiting());

About the way to launch something from a notifications, it goes through DBus, using the following arguments to the notification item:
Code:
                remoteDBusCallServiceName: "org.nemomobile.example"
		remoteDBusCallObjectPath: "/example"
		remoteDBusCallInterface: "org.nemomobile.example"
		remoteDBusCallMethodName: "doSomething"
		remoteDBusCallArguments: [ "argument", 1 ]
This comes from this thread: http://talk.maemo.org/showpost.php?p...1&postcount=43

I have to sniff around DBus to retrieve the DBus service and method that launch the voice call ui, but here is a direction to search (found in /usr/share/lipstick-jolla-home-qt5/lockscreen/OngoingCall.qml) :
Code:
    DBusInterface {
        id: voicecallIf
        destination: "com.jolla.voicecall.ui"
        path: "/"
        iface: "com.jolla.voicecall.ui"
    }
 

The Following 2 Users Say Thank You to Zeta For This Useful Post:
Posts: 339 | Thanked: 1,622 times | Joined on Oct 2013 @ France
#55
Originally Posted by Schturman View Post
You can use
Code:
dbus-send --system --type=method_call --print-reply --dest=org.ofono /ril_0  org.ofono.MessageWaiting.GetProperties
or this:
Code:
/usr/lib/qt5/bin/qdbus --system org.ofono /ril_0  org.ofono.MessageWaiting.GetProperties
to check if voicemail "true" that mean have voicemail message.
That's good, but you can even directly connect to the single boolean that we want with this signal (dump from dbus-monitor):
Code:
signal sender=:1.14 -> dest=(null destination) serial=15125 path=/ril_0; interface=org.ofono.MessageWaiting; member=PropertyChanged
   string "VoicemailWaiting"
   variant       boolean true
That way, you don't have to decipher the whole structure.

This is hidden inside QOfono when you use it from C++ or QML, but it can be directly connected to from python or even C++ if you want to do it with DBus.
 

The Following 4 Users Say Thank You to Zeta For This Useful Post:
coderus's Avatar
Posts: 6,431 | Thanked: 12,683 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#56
Okay, install and test this package: https://dl.dropboxusercontent.com/u/...-1.armv7hl.rpm

After starting icon from launcher should appear notificatoin about launcing watcher
You can enable autostart, start or exit watcher

Check if notifications about new voicemails appearing
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following 3 Users Say Thank You to coderus For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#57
Coderus, "force start" or start from cover not work.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#58
Zeta, like I said I'm not programmer and still not understand from what you wrote hot to implement it to my python script
Can you explain it ? Or write example with my script ?

Also we can use direct link to call to voicemail by pressing on the notification (if we will succeed to implement it) :
Code:
gdbus call -e -d com.jolla.voicecall.ui -o / -m com.jolla.voicecall.ui.dial '+97215154003200'
Where is "+97215154003200" - number of voicemail
 
coderus's Avatar
Posts: 6,431 | Thanked: 12,683 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#59
Originally Posted by Schturman View Post
Coderus, "force start" or start from cover not work.
how did you checked it? and cover is dummy and does NOTHING.
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 
coderus's Avatar
Posts: 6,431 | Thanked: 12,683 times | Joined on Nov 2011 @ Open Mobile Platform, Innopolis, Russia
#60
Sources here: https://github.com/CODeRUS/voicemail-notifications
feel free to do pull requests
__________________
Twitter | Openrepos | GitHub | PayPal.Me
 

The Following User Says Thank You to coderus For This Useful Post:
Reply

Tags
sailfish os, voicemail

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:26.