• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Second missed call in a row.

jd_abramson

Lurker
Mar 30, 2013
6
1
I would like to receive an alert on the second missed call in a row (<30 seconds.) I found this post, however I'm too ignorant to implement it. I've attached the xml export from my phone.

http://androidforums.com/tasker/158...-requesting-help-profiles-23.html#post4627553

#1108

Here's the what I've done.

Created Variable "XCALLS
Profile name "Second Call in a Row"
Context "Missed Call*"
Task "Second Call Alert"
1. Stop If %XCALLS ~ 1
2. if %XCALLS ~ 2
3. Torch set On
4. Wait MS 600
5. Torch set Off
6. Wait MS 600
7. Torch set On
8. Wait MS 600
9. Torch set Off
10. Wait MS 600
11. End If
12. Variables Set Name %XCALLS To 0
 

Attachments

  • secondcallalter.txt
    2.2 KB · Views: 80
Upvote 0
This profile will set off if two different people call you in a short time period, which may work for some. I set my profile up a little different:

Context:
Missed call: Any

1)Write File: File = /sdcard/DCIM/Tasker/MissedCall If = %CNUM doesn't match %LastCaller
2)Read Line: File = DCIM/Tasker/MissedCall To Var = %LastCaller
3)If: %CNUM matches %LastCaller
4)Media Volume: 15
5)Play ringtone
6)Notify: Text = %CNAME %CNUM
7)End If
8)Wait 10min
9)Variable Clear: %LastCaller



All of the "If" stuff can be however you want to be notified on the second missed call in a row from just one person.
 
Upvote 0
So I took another crack at this, seems to be reliable so far. If you use it, please let me know how it works out for you.

Profile: 2 Missed Calls = Notify (230)
Event: Missed Call [ Caller:* ]
Enter: Anon (231)
A1: Load App [ App:phone Data: Exclude From Recent Apps:Off ]
A2: Wait [ MS:1 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A3: Kill App [ App:phone Use Root:On ]
A4: Notify [ Title:DND - Missed Call Text:Missed Call >>> %CNAME - %CNUM Icon:hd_aaa_ext_phone_missed Number:0 Permanent:Off Priority:1 ]
A5: Test [ Type:File Name Data:/storage/sdcard0/Tasker/2callsNotify/%CNUM Store Result In:%Exists Continue Task After Error:On ]
A6: If [ %Exists ! Set ]
A7: Write File [ File:Tasker/2callsNotify/%CNUM Text:%TIMES Append:Off Add Newline:Off ]
A8: Variable Clear [ Name:%CalledWhen Pattern Matching:Off ]
A9: Variable Clear [ Name:%TimeCompare Pattern Matching:Off ]
A10: Else If [ %Exists Is Set ]
A11: Read Line [ File:Tasker/2callsNotify/%CNUM Line:1 To Var:%CalledWhen ]
A12: Variable Set [ Name:%TimeCompare To:%TIMES - 300 Do Maths:On Append:Off ]
A13: If [ %CalledWhen > %TimeCompare ]
A14: Notify Cancel [ Title:DND - Missed Call Warn Not Exist:Off ]
A15: Media Volume [ Level:15 Display:Off Sound:Off ]
A16: Play Ringtone [ Type:Alarm Sound:CyanAlarm Stream:4 ]
A17: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A18: Play Ringtone [ Type:Alarm Sound:CyanAlarm Stream:4 ]
A19: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A20: Play Ringtone [ Type:Alarm Sound:CyanAlarm Stream:4 ]
A21: Notify [ Title:Better Be An Emergency! Text:CALL NOW >>> %CNAME-%CNUM Icon:cust_warning Number:0 Permanent:Off Priority:3 ]
A22: Else If [ %CalledWhen < %TimeCompare ]
A23: Delete File [ File:Tasker/2callsNotify/%CNUM Shred Level:0 Use Root:Off ]
A24: Variable Clear [ Name:%CalledWhen Pattern Matching:Off ]
A25: Variable Clear [ Name:%TimeCompare Pattern Matching:Off ]
A26: End If
A27: Variable Clear [ Name:%Exists Pattern Matching:Off ]
A28: End If
 
Upvote 0
I wanted to share some changes to this solution. One of the issues I had is that this phone is unrooted and I couldn't clear the missed call notification which would hold this profile in a continual state. The result was that subsequent calls would not trigger the task and I would not receive any notification that someone was trying to get a hold of me.

The solution was to set the profile to "Call Incoming. *" and "Variable Value %MODE_MEETING, Matches, 1"

Meeting mode is another profile that is set when the phone is upside down or my calendar has #mute in the description. I only want this task when I'm in a meeting and my phone is muted (in meeting mode).

Thank you for your help KitWasHere
 
Upvote 0
Even a rooted phone cannot clear another apps notifications programmatically. My solution was to quickly open the dialer app which clears out the notification, and then kill the app. If you don't have root and cannot kill apps you could just use the "Go Home" action to send it to the background.

Glad you got it working
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones