maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] The One Ring (https://talk.maemo.org/showthread.php?t=41817)

epage 2010-07-23 01:37

Re: [Announce] The One Ring
 
Quote:

Originally Posted by fcrochik (Post 761586)
Now I am curious... Can't you just listen for the "coming" dbus signal:

Code:

    if ( !QDBusConnection::systemBus().connect("com.nokia.csd.Call", "/com/nokia/csd/call",
        "com.nokia.csd.Call", "Coming", this, SLOT(callComing(QDBusObjectPath,QString))
    ) ) return false;

and after checking if the number matches your gv number accept the call with another dbus call?

Code:

dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.Answer
Or is the problem that you are trying to also handle call backs on other "accounts" like skype ?

I thought I had read in some documentation that Coming wasn't enough, you have to check the call status which I haven't had a chance to play with yet.

Though the call API only works with Cell, I was hoping the Coming and Answer calls would work with any CM. Vain hope but it is there. Otherwise unless we can get telepathy automation working I'm fine with at least giving those who work with cell that much

Quote:

Originally Posted by fcrochik (Post 761586)
p.s. I started playing with telepathy following your advice and have already something that works... The next version of mycontacts will be able to start calls and send sms using TOR (and any other telepathy account for that matter). Thanks!

How did you get calls and SMS working with Telepathy? A couple of us have given up on it :) I was planning on posting on the telepathy list some thoughts I had on client automation.

Hotshot 2010-07-23 02:01

Re: [Announce] The One Ring
 
Question about the one ring. If I install is it going to load all my google voice contacts into my address book? I like the idea of being able to choose regular call or google voice call in the dail pa but really dont want all my google voice people in my address book.

epage 2010-07-23 02:03

Re: [Announce] The One Ring
 
Quote:

Originally Posted by Hotshot (Post 761612)
Question about the one ring. If I install is it going to load all my google voice contacts into my address book? I like the idea of being able to choose regular call or google voice call in the dail pa but really dont want all my google voice people in my address book.

I think I put in a flag to disable GVoice Contacts

fcrochik 2010-07-23 02:05

Re: [Announce] The One Ring
 
Quote:

Originally Posted by epage (Post 761594)
I thought I had read in some documentation that Coming wasn't enough, you have to check the call status which I haven't had a chance to play with yet.

Though the call API only works with Cell, I was hoping the Coming and Answer calls would work with any CM. Vain hope but it is there. Otherwise unless we can get telepathy automation working I'm fine with at least giving those who work with cell that much

The coming is enough. That is what I use to manage the ring tone.
I haven't tested but, like you, I think only works for "tel" calls.

Quote:

Originally Posted by epage (Post 761594)
How did you get calls and SMS working with Telepathy? A couple of us have given up on it :) I was planning on posting on the telepathy list some thoughts I had on client automation.

What I accomplished so far is telling telepathy to use a "service" (account: tel, spirit, tor, ...) and start a call to a number or start the "sms" messaging ui for the phone number. It is really nice and seamless...

I know using qt mobility and/or tpsession you can also send a sms directly from your application (not start the messaging ui).

What are you trying to do?

Hotshot 2010-07-23 02:07

Re: [Announce] The One Ring
 
Oh okay if I download it wont load my google voice contacts? Great will be installing soon to test this out im sure it will work great like your other google voice app. Thanks for all your hard work with these apps.

epage 2010-07-23 02:13

Re: [Announce] The One Ring
 
Quote:

Originally Posted by fcrochik (Post 761618)
The coming is enough. That is what I use to manage the ring tone.
I haven't tested but, like you, I think only works for "tel" calls.

But does your ring tone app try to answer? The wiki seems to be down right now but in there is a quote lifted from a discussion saying that a 1s sleep is needed (or listening for Call Status) for answering a call because it is not in the right state.

Quote:

Originally Posted by fcrochik (Post 761618)
What I accomplished so far is telling telepathy to use a "service" (account: tel, spirit, tor, ...) and start a call to a number or start the "sms" messaging ui for the phone number. It is really nice and seamless...

I know using qt mobility and/or tpsession you can also send a sms directly from your application (not start the messaging ui).

What are you trying to do?

Starting a call with a service would be good for implementing the call-out (rather than call-back) approach.

fcrochik 2010-07-23 02:39

Re: [Announce] The One Ring
 
Quote:

Originally Posted by epage (Post 761625)
But does your ring tone app try to answer? The wiki seems to be down right now but in there is a quote lifted from a discussion saying that a 1s sleep is needed (or listening for Call Status) for answering a call because it is not in the right state.

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... :)


Quote:

Originally Posted by epage (Post 761625)
Starting a call with a service would be good for implementing the call-out (rather than call-back) approach.

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.

uvatbc 2010-07-23 05:34

Re: [Announce] The One Ring
 
Quote:

Originally Posted by fcrochik (Post 761646)
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...

fcrochik 2010-07-23 12:01

Re: [Announce] The One Ring
 
Quote:

Originally Posted by uvatbc (Post 761736)
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...

I also saw the telepathy call sample and have to say that could not even get it to compile. Unless you have any need to deal with the stream and/or create your own "I am on a call with X" window (and I am not sure if you can) the process I described is enough to place calls on any "accounts" (I have tried with skype, tel and tor).

fcrochik 2010-07-23 12:28

Re: [Announce] The One Ring
 
epage/uvatbc:
I copied the pieces of the code that I think are needed to http://maemo.crochik.com/qt-development/telepathy

It looks really simple now that I know how it can be done! :)


All times are GMT. The time now is 04:21.

vBulletin® Version 3.8.8