[Need Help] Custom Ringtone for Unknown Numbers

YUMYOG

New member
I'm trying to set up a custom ringtone for unknown numbers, but it's also playing for my saved contacts. Any insights on what I might be doing wrong?

Thanks for your help!




8t3vqyvqpf1c1.png
 

hsurB

Well-known member
I am guessing this action changes your phones ringtone. If it was performed it changed it and it stayed like that till now, right? So you would have to make another macro for contacts and action configure ringtone to your standard ringtone
 

MacroDroidDev

Administrator
Staff member
Unfortunately (as suggested) it's too late to do set the ringtone after the call has been received as the ringtone is selected and played by the phone app before it gets changed by MacroDroid.

I'm not sure there is an easy way to do what you want with MacroDroid I'm afraid. You can set ringtones for each specific contact so this would be one way to ensure the ringtone is different for unknown callers, but of course this will take a long time if you have many contacts.
 

Qarboz

Well-known member
T Call incoming [non contact]
A1: stores the ring volume in an int variable (ring)
A2: stores the alarm volume in an int variable (alarm)
A3: set the ring volume to 0
A4: set the alarm volume to the desired level for the noncontact ring
A5: Wait Before Next Action 1 s [may not be necessary].
A6: Repeat actions -> While condition repeat [condition: Phone Ringing]
A6.1: Play [desired ringer] -> choose alarm stream -> select "Block next actions until complete" flag
A6.2: Wait Before Next Action 500 ms
A6.3: End Loop
A7: set the ringer volume with the level stored in the ring variable
A8: sets the alarm volume with the level stored in the alarm variable

Not sure if it works, to try.
Notes:
It is possible that for a moment you may hear the normal ringer.
It is likely that when you answer the call the chosen ringtone continues to ring until the end of the file, I recommend choosing a short ringtone
 

Endercraft

Moderator (& bug finder :D)
It is likely that when you answer the call the chosen ringtone continues to ring until the end of the file, I recommend choosing a short ringtone
You can use the stop current sound option, with maybe call active trigger?
 

RSF

Well-known member
I use the attached macro, which incorporates concepts from both @Qarboz and @Endercraft. I wanted my phone to ring only for people in my Contacts list, and quickly vibrate once for non-contacts...

You'll want to do the following, in addition to importing the macro:
  1. Go into Android settings and set the Ringtone to "None". That way you won't hear both that ringtone and the MacroDroid-initiated sound
  2. Edit the macro's 5th action (the Play/Stop Sound action) to point to whatever ringtone you want to use for Contacts
  3. If desired, create a shortcut for the macro on your home screen, which will toggle on and off ringing for all calls (non-contacts as well as contacts). I use that if I don't want to miss a call from a non-contact (a return call from a e.g. plumber).
  4. If you wanted to hear a different ringtone for non-contacts instead of just a quick vibration, you'd want to add change the Vibrate action (the 11th action) to a similar Play/Stop Sound scheme as used for contacts, or just rework that section to have different If clauses and play a different sound file for non-contacts
Also note: the macro is not supposed to play the sound file if one is already in a call (i.e., someone else calls you while you're already on a call) -- the While loop is supposed to execute only while "In Call" is false. For some reason, this doesn't work, and the sound still plays if a second call comes in while already on a call. That's why there's the "Shake" trigger, to force the sound to stop -- a bit of a hack. It doesn't happen that I get multiple calls at once, so I've just lived with it.
 

Attachments

  • Incoming_call.macro
    13.3 KB · Views: 6
Top