![]() |
[Solved] How to detect phone call - C++ only
I know this was solved here a few times, but I really didn't find, what I need.
We are working on a new application, it has to be in C++ and it has to use Qt (it's not like I complain :3), so I can not use python solution. Our application needs to know when someone calls, when it's received, when it's refused, when call is started from users side and when it ends. And it have to work under Maemo and also under MeeGo. When I wrote "call" I mean "phone call", like in N900. I found that I should use QtDBus, Dbus or telepathy-ring, but I was unable to find any example nor tutorial. So, do anyone know about this? Thanks in advance :) |
Re: How to detect phone call - C++ only
I'm not going to be much help as i'm still at work but...
You need to find the dbus command to identify when the phone is being called. Then look for a C++ Dbus call ( C example here - http://people.collabora.co.uk/~tthur...tle/sand.c.txt ) Translate your dbus call into the code :) (But yes QtDbus will work - you just need to find the dbus commands!) |
Re: How to detect phone call - C++ only
QDBusConnection::systemBus().connect(QString(), "/com/nokia/csd/call", "com.nokia.csd.Call", "Coming", this, SLOT(callEvent(QString,QString)));
|
Re: How to detect phone call - C++ only
Quote:
I have used QT and telepathy-qt4 in my code. My Observer class is derived from the telepathy-qt4 Abstract Observer class. The function of interest is Tp::AbstractClientObserver:: observeChannels, which you need to derive. |
Re: How to detect phone call - C++ only
Yay, thank you very much!
It looks that QtDBus is exactly what we need and looks also simplest. (I guess I was little confused with using dbus commands with QtDBus.) If it won't work, I'll look at the others, but I would like to use simplest solution :3. But I have one more question; do you know some reference, list of dbus commands? I tried Google, found many about SMS, making calls, setting profiles etc., but I also need detect when outgoing call occures and when call (in and also out) ends. Thank you very much for your help :) |
Re: How to detect phone call - C++ only
Take a look at my Recaller sourcecode (even if it is in Python); I listen to most of the commands you're interested in.
You could also use MDbus2 or D-Feet and observe the D-Bus while making some calls, either install locally or do like this. |
Re: How to detect phone call - C++ only
Yay, thank you very much, there is everything we need... I hope :3.
|
Re: How to detect phone call - C++ only
MeeGo isn't using telepathy-ring, so I think you may have to use a different DBus path for it.
|
Re: How to detect phone call - C++ only
Quote:
Code:
dbus-send --print-reply --dest=com.nokia.csd.Call /com org.freedesktop.DBus.Introspectable.Introspect |
Re: How to detect phone call - C++ only
Quote:
|
All times are GMT. The time now is 09:27. |
vBulletin® Version 3.8.8