I'm not very satisfied with phonebook's ringtone assignment: they disappear sporadically and sometimes fail to play (default ringtone is played instead).
Ideally I want an application that do this:
- Replaces usual phone ringtone player and listens for events.
When there is incoming phone call, it starts my script (in Python, for example) that takes phone number, phonebook name, current time, etc as input and provides ringtone name and volume as output, like this:
def incoming_call_ringtone(number, name, etc): if not number.startswith("+375"): return ("ringtone_foreign.ogg", 100) if name == "Mother": return ("ringtone_mother.ogg", 70) if name == None: return ("ringtone_unknown.ogg", 70) if name.startswith("work_"): return ("ringtone_work.ogg", 100) return ("ringtone_default.ogg", 70)
Rings the specified ringtone.
What application should I use? It's OK if it uses other language (or some other approach), but it should have that flexibility.