View Single Post
Posts: 1,048 | Thanked: 979 times | Joined on Mar 2008 @ SF Bay Area
#698
Originally Posted by fcrochik View Post
I see... I haven't tried to answer the call (at least not after receiving the coming signal). The 1s sleep doesn't sound too bad though...




I am still getting my head around the steps to place the call and was trying to clean the code to find out what I actually need. If you want I can send you the "test application" executable I got to work.

As I can recall you need to:
1. create the account manager
2. wait for the account manager to become ready
3. you will get the list of accounts
4. for the account you want to use you need to wait for it to get ready
5. check if the account "haveConnection"... if not you can't continue
6. wait for the account->connection() to becomeReady
7. then you are almost there
8. to send a sms you just need use (on telepathy-qt4)
Code:
account.data()->ensureTextChat("1212121212"); // phone number
9. to start a call there is a trick - you can't use ensureVoiceCall... It will fail...you have to create the channel request by "hand":
Code:
    QVariantMap request;
    request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".ChannelType"), TELEPATHY_INTERFACE_CHANNEL_TYPE_STREAMED_MEDIA);
    request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandleType"), (uint) Tp::HandleTypeContact);
    request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetID"), "111111111"); // phone number

    return account.data()->ensureChannel(request);
some notes:
  • By the documentation it seems that you could start with the "account" if you know the "objectPath" (skip the account manager part).
  • Because all the calls are async you probably need to "start" the account connection with your application and keep it for the entire life cycle making sure to listen to all the changes on it. Trying to get everything ready every time you need to place a call maybe not worth...
  • EDIT: you may not need to get the connection ready before creating the channels. I did not try this but by reading on my post gave me this idea... I know you need the connection in order to get the list of contacts.

I will post the code for each step as soon as I separate it from all the "other failed testing" attempts.

Let me know if you would like the test app, with it you can already call and text any number using any "account" you are connected to.
I saw this pattern in the various code samples for telepathy, however when it comes to handling StreamedMedia, the only sample I've seen that is reasonably complete is the tp-qt4 "call" sample code. That sample code actually handles the StreamedMedia channels itself using Farsight2 as far as I could understand.
To me, this means that call "handling" terminates with me, and not with the Nokia supplied dialer: rtcomm-call-ui.
And this is where I'm stuck.

You know what? I feel we should have a irc channel so that we stop hijacking this TOR thread with these development / hacking efforts...
__________________
qgvdial: Google Voice client. All downloads
qgvtp: Phone integration for the n900 that dials out and sends texts using qgvdial.
mosquitto: message broker that implements the MQ Telemetry Transport protocol version 3.
qgvnotify: Google voice and contacts notifier for diablo and maemo.

If you want to thank me, click the Thanks button.
If you'd like to thank my applications, vote to move them to extras.