Hi,
the bigger plan is to to vibrate every 5 minutes if there are missed calls and not doing it otherwise.
the (not yet working) solution i came up with:
trigger: incoming call has status missed
command: content query --uri content://call_log/calls --where "new=0"
script: match=matches(stdout, ".*new=1.*")
if match==true:
vibrate
wait 5 minutes
go to command
stdout returns me the right thing but matching doesn't work.
any more elaborate ways to do what i'm trying to achieve?
what do i do wrong?
also did i get it right that when you have missed calls and you turn on the phone app (and see that there was a missed call) new=1 changes to new=0?
thanks
get unanswered calls
Moderator: Martin
Re: get unanswered calls
Hi,
Why do you query for "new=0" but then check for new=1 in the output?
The command probably writes multiple lines, you'd have to turn on DOTALL mode so that the . also matches new line characters. The regex would become "(?s).*new=1.*".
Opening the phone app might be sufficient to clear the new flag. Newer versions of Android (4+) also support a new column is_read.
From the docs:
Regards,
Martin
Why do you query for "new=0" but then check for new=1 in the output?
The command probably writes multiple lines, you'd have to turn on DOTALL mode so that the . also matches new line characters. The regex would become "(?s).*new=1.*".
Opening the phone app might be sufficient to clear the new flag. Newer versions of Android (4+) also support a new column is_read.
From the docs:
You could also use condition Notification on Statusbar displayed to check if the missed calls notification is still showing. Alternatively you could use action Init Variables Call Log with query criteria Newest missed call and then check if variable call_new contains true (condition Expression: call_new).Whether this item has been read or otherwise consumed by the user.
Unlike the NEW field, which requires the user to have acknowledged the existence of the entry, this implies the user has interacted with the entry.
Regards,
Martin
Re: get unanswered calls
because i tried to get "true" returned for new=0 which didn't work either. i wanted to change my post to what i was actually trying to achieve and forgot to change the first value. so this was a typo.Martin wrote: Why do you query for "new=0" but then check for new=1 in the output?
adding (?s) works. will also try all the other stuff. sounds better to me. thanks.