Monday, 26 October 2015

Re: [Ubuntu-phone] Mycroft Skills on Ubuntu Phone

On Mon, Oct 26, 2015 at 11:44 AM, Ted Gould <[email protected]> wrote:
> On Sat, 2015-10-24 at 16:28 -0300, Jonathan D'Orleans wrote:
>
> Dial Call usecase:
> 1. Turn on my phone (or Ubuntu device) and login
> 2. Say: "Mycroft, call my wife"
> 3. Mycroft do a Dial Call to my wife's phone number
>
>
> For both of these cases you'll want to query the addressbook. It is stored
> in EDS and we have a QtOrganizer plugin to access it, you can use either
> API. From there I'd recommend using a URL and dispatching it via URL
> DIspatcher, there is a liburl-dispatcher or you can use the Qt URL API. So
> basically send:
>
> tel://867-5309
>
> Which will open up the dialer and populate it with that number.
>
> Send a SMS usecase:
> 1. Turn on my phone (or Ubuntu device) and login
> 2. Say: "Mycroft, tell Jonathan I'll arrive at 15 o'clock"
> 3. Mycroft Send a SMS to Jonathan's phone number
>
>
> I'm not sure that there is a similar interface for messaging. But if you
> talk to the messaging app developers I don't think it would be super
> difficult to build one.

You can use url dispatcher as ted suggested also for messaging-app:
message:///number&text=message

The only issue I see using url-dispatcher (at least for this specific
use case) is that you will need one additional step to actually
trigger the action. (tap the call or send button after the app is
launched).
We have a dbus API in telephony-service that is not public yet and
subject to changes, but will allow you to place calls and send
messages directly without
any manual step, but I believe your app needs to run unconfined:

dbus-send --print-reply --dest=com.canonical.TelephonyServiceHandler
/com/canonical/TelephonyServiceHandler
com.canonical.TelephonyServiceHandler.SendMessage
array:string:"+12345678" string:"text message"
string:"ofono/ofono/account0"

dbus-send --print-reply --dest=com.canonical.TelephonyServiceHandler
/com/canonical/TelephonyServiceHandler
com.canonical.TelephonyServiceHandler.StartCall string:"+12345678"
string:"ofono/ofono/account0"

You can change account0 by account1 if you wish to perform the action
using the second sim card, for example.

Regards.

--
ubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel