Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dial telephone numbers #229

Open
OnkelBruno opened this issue Mar 9, 2023 · 6 comments
Open

Dial telephone numbers #229

OnkelBruno opened this issue Mar 9, 2023 · 6 comments

Comments

@OnkelBruno
Copy link

Hi all,

thank you very much for that really great assistant! I've installed everything, and it runs like a charm.

But just one question - this feature would make Sepia even more great:

Can somebody please tell me how to create a new command for calling a number from my contact book on my Android phone?
I've tried already sth like
android.intent.action.CALL -d tel: +49blahblah for just dialing one number - this doesnt work. Is there any possibility to trigger sephia to recognise the contact from contact book and dial the number?

I am using Sepia with the Android App, the Assist-Server, MaryTTS and STT are running on my server and are reachable through OpenVPN/Https-Proxy.

Thank you´!

@fquirin
Copy link
Contributor

fquirin commented Mar 9, 2023

Hi @OnkelBruno :-)

One thing you can definitely do is use android.intent.action.DIAL via the Teach-UI command Execute platform specific actions. This will not automatically start the call, but open the dialer with a given number (the same thing is possible with simple web URLs tel://...). The JSON version of the intent looks like this:

{
    "value": {
        "type": "androidActivity",
        "data": {
            "action": "android.intent.action.DIAL",
            "url": "tel:+99932168"
        }
    }
}

Here is a screenshot of the Teach-UI field "Android Intent (androidActivity, androidBroadcast)" - Type "processed":

image

The same thing should theoretically work for android.intent.action.CALL, but the app is currently not able to request android.permission.CALL_PHONE, so you should get an error message if you try this intent.

Using the contact picker is more complicated and would probably need a specific Android plugin/extra code to handle the process. Maybe there is a "picker" intent that supports a name as data field, but I'm not sure 🤔.

In general Android Intent handling has become a lot more complicated since Android 11, because you need to specify most things in the app manifest before you submit your app and certain permissions make it really hard to get Google's Play Store approval :-/.

@OnkelBruno
Copy link
Author

Hi Florian,

thank you very much for your quick response. I've tested it and it works really good.
As I am new to Intends in Android: Is there a way to place permissions inside the manifest-file for Sepia?

And: has maybe somebody already found out, how to pick contacts from the local adress book for dialing?

Thank you very much!

@fquirin
Copy link
Contributor

fquirin commented Mar 10, 2023

As I am new to Intends in Android: Is there a way to place permissions inside the manifest-file for Sepia?

Unfortunately this can only be done before building the Android app. Maybe I could quickly build an APK file for testing that you can side-load if you're really interested in experimenting with the CALL intent ^^.

In general I'm very conservative with permissions, because every entry in the manifest file means more requirements and checks by Google before the app can be released via the Play Store :-/. I do agree though, that this feature is quite useful for a voice assistant ^^.

And: has maybe somebody already found out, how to pick contacts from the local adress book for dialing?

From what I've seen so far the Android procedure is likely:
Show the contact picker -> retrieve user selection -> parse contact object for phone number -> trigger call intent. I could be wrong though.
To fully automate commands like "call Jim" (without teach-UI) one probably has to make a copy for all contacts and keep that in sync with the phone. There seem to be ways to send SQL-like search queries to the contacts API, but I've no idea how that works yet (the tutorial is pretty long ^^).

From time to time I think about implementing contact lists in SEPIA, but there are usually things with higher priority right now 😅.

@OnkelBruno
Copy link
Author

Thank you, Florian.

Sure I am interessted in using the CALL intent. But my biggest goal is to use Sepia as an fully useable assistant. (Google Assistant or Alexa aren't a option since I'm concious of them spying on people)

As mentioned, I am new to those intends and also not very experienced in programming (I'm an Unix/Windows-Admin).

I don't want to steal your time, but sure, if you want to, send me the APK for sideloading - anyways, I don't install any app directly from Play Store for privacy reasons :)

I've done a bit research. Maybe this can help you (although I'm aware that Sepia is spare-time-project for you and therefore I can't place any feature requests :) - but maybe this could improve the app):

  • The App "Dicio" can do do calls from phone adressbook - maybe a hint (although voice recognition there is really bad)
  • I've used Sepia as standard assistant app. Tried with devices (those have a button for speak recognition): Bose Soundlink Mini II:
    not working, the speaker gets in a kind of loop - only disconnecting BT helps
    Bose Headset QuietComfort 35 Wireless II: Works fine
    Pioneer Car Stereo Unit SPH-20DABAN: Launches Sepia, then interrupts Sepia.

Just my experiences, maybe they can be interessting for you :)

@fquirin
Copy link
Contributor

fquirin commented Mar 18, 2023

Hi @OnkelBruno ,

sorry, I'm currently deep down in the speech-recognition rabbit hole 🕳️🐇 to improve the STT server and haven't really had time to look at the app yet. I've noticed though, that the app is missing the code to actually request new permission, even if I add it to the manifest :-/. This is new in Android 13 and I'll probably have to make more changes to implement some kind of permission manager 😒.

I've done a bit research. Maybe this can help you (although I'm aware that Sepia is spare-time-project for you and therefore I can't place any feature requests :) - but maybe this could improve the app):

Thanks for the summary, I'm always interested in hardware and features feedback! I noticed as well that Bluetooth can be a problem and these remote buttons act weird sometimes :-|. I don't know if I can really fix this since it should in theory be handled by Android itself, but I'll keep it in mind. I do have a Bose Soundlink II as well, so maybe I can do some testing again 🙂.

Btw, thanks a lot for your generous donation! 🤩😃

@fquirin
Copy link
Contributor

fquirin commented Apr 20, 2023

A little update 🙂:
I just realized that there is probably enough cross-platform support for the Contact Picker API for a while now. Never really looked into that but will do this now to find out if its useful 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants