Use "Phone Ringing" or "Incoming Call" to assign custom ringtone to contact?

1,631 views
Skip to first unread message

dougconsult

unread,
Sep 7, 2010, 1:12:53 PM9/7/10
to Tasker
Skip the Why if you want:

Why I want to do it:
I have am AT&T Captivate and use Touchdown to sync with my Exchange
server. TD does not allow custom ringtones to be assigned to contacts
(future feature). Although it sends the contacts to the default app
for caller ID, MMS, and email notifications, it does not allow direct
editing of contacts using the default app because those changes would
not be synced back to the Exchange server.

What I want to do:
So, I want to use Tasker to assign one ringtone to a group of numbers
and use the default ringtone for any other number. I've tried both
state "Incoming Calls" and the event "Phone Ringing", but neither
seems to work. All calls, even those listed in the context, use the
default ringtone as set in the system settings.

I assume all I need to do is create a new context and add the number
to it, and then create a task (add/media/ringtone). I have not been
able to get that to work. So my questions are:

1. Which context should I use, Incoming Call or Phone Ringing?

2. Does it need to be an exact text match with the caller ID (for
example if the number in the context is (555)555-5555, will a caller
ID number of 555-555-5555 still activate the task?

3. I've noticed you can "Long-Click" and add more numbers that are
separated by a "/". Once I get one number working in a context, can I
enter more than one number in the phone number field for that context,
or do I need to create a Profile for each number I want to use that
ringtone?

4. Is there any other info needed that I've overlooked?

Hope this all makes sense. Thanks for any help!

dougconsult

unread,
Sep 7, 2010, 1:36:59 PM9/7/10
to Tasker
I think I've already found the answer to number 2. By flashing the
%CNUM variable, I see the incoming number is just digits... no
symbols. So (555)555-5555, 555-555-5555, or any other format probably
would not match the profile. All numbers need to be 5555555555. Is
that correct?

Thanks!

Pent

unread,
Sep 7, 2010, 2:35:11 PM9/7/10
to Tasker
> So, I want to use Tasker to assign one ringtone to a group of numbers
> and use the default ringtone for any other number. I've tried both
> state "Incoming Calls" and the event "Phone Ringing", but neither
> seems to work. All calls, even those listed in the context, use the
> default ringtone as set in the system settings.

First try a phone ringing event with no number match to see if it even
works to change the default ringtone mid-call and it has an effect.
I have no idea if that works.

> 2. Does it need to be an exact text match with the caller ID (for
> example if the number in the context is (555)555-5555, will a caller
> ID number of 555-555-5555 still activate the task?

It needs to match following the rules in Pattern Matching in the
userguide.

In the new beta you can specify a contact instead.

> 3. I've noticed you can "Long-Click" and add more numbers that are
> separated by a "/". Once I get one number working in a context, can I
> enter more than one number in the phone number field for that context,
> or do I need to create a Profile for each number I want to use that
> ringtone?

/ means 'or' following the pattern matching rules.

> 4. Is there any other info needed that I've overlooked?

Probably :-)

Pent

dougconsult

unread,
Sep 7, 2010, 3:19:37 PM9/7/10
to Tasker
I finally figured out what it is doing. A phone ringing event does
change the ringtone default just like it's supposed to. But it changes
just the setting... and does NOT affect the current ring. It just
changes the default ringtone setting so all subsequent rings use the
tone specified in Tasker.

So, I guess what I have to do, is figure out how to change the
ringtone based on caller id BEFORE Tasker allows the phone to ring.
Then change it back when the phone disconnects.

And I'll reading the Pattern Matching guide more carefully. :)

On Sep 7, 12:35 pm, Pent <tas...@dinglisch.net> wrote:

>
> First try a phone ringing event with no number match to see if it even
> works to change the default ringtone mid-call and it has an effect.
> I have no idea if that works.
>

> Pent

Pent

unread,
Sep 7, 2010, 3:58:25 PM9/7/10
to Tasker
> So, I guess what I have to do, is figure out how to change the
> ringtone based on caller id BEFORE Tasker allows the phone to ring.
> Then change it back when the phone disconnects.

Tasker gets the event from Android after it's already ringing I think,
I don't
think it's going to work what you want to do, except by silencing the
ringer (Phone / Silence Ringer)
if it's a special contact and just playing something with Tasker's
Music Play until you
get Event Offhook or the Incoming Call state ends, then do Music Stop.

It's on todo list to play ringtones, currently you can only play MP3s,
unless you do
it as a Notify Sound and do Notify Cancel when call ends.

Pent

Larry

unread,
Sep 7, 2010, 4:30:29 PM9/7/10
to Tasker
Wow, coincidentally I was playing with the same feature for a
different purpose - I want to turn on the ringer if I call my kids,
even if they have it on Silent Mode, and I have the same problem that
it does not seem to apply to the current call.

I have set the Incoming Call State to a phone number with the action
being to turn Silent Mode off. When the call comes in I can see it
turning off silent mode in the noitification bar (and then turning
Silent Mode back on when I hang up), but the ringer makes no sound. I
even added a Ringer volume setting after the Silent Off action, but
that made no difference either.

Is there somethinig else that needs to be done to make it apply to the
current call?

I have tried the Incoming Call Event, and get the same result.
Although as it does not turn the Silent mode back on I could always
call twice, but I think I should be able to preserve the Silent Mode
after the call in case I want to use this on my wife's phone.

As an aside, I know Pent said it would be in the new beta, but I am
using 1.08 and it lets me select from my contact list.


Using the
> > Pent- Hide quoted text -
>
> - Show quoted text -

dougconsult

unread,
Sep 7, 2010, 5:35:23 PM9/7/10
to Tasker
Here's my workaround. My default ring tone is just a basic office
phone ring. Using Tasker I created a state for incoming calls and
restricted it to favorite contacts and added a task to start playing
music. I chose a simple chime that almost sounds like it's part of the
ring tone and set it to loop.

Now if a call comes in from a favorite contact, the default ring tone
plays with the chime. I then added two stop music tasks... one for
phone idle and one for phone off hook.

So if a non-favorite number calls, I just hear the default ring tone.
If a favorite calls, I hear the default ringtone with a chime. Not a
perfect solution, but a solution none the less!

Thanks for the help pent!k

dougconsult

unread,
Sep 9, 2010, 3:59:34 PM9/9/10
to Tasker
I'm not sure if this should be posted here or in the beta thread. I
am using the 1.9.0 beta. The configuration above works just fine with
starred contacts. But I get forced closures from Tasker when receiving
calls from numbers not starred.

Here's the debut log showing two calls. The first is from a favorite
contact, but the second is from blocked call when Tasker FC-ed. Any
suggestions?

Thanks!
Message has been deleted

dougconsult

unread,
Sep 9, 2010, 4:30:28 PM9/9/10
to Tasker
Here's the debug log for a blocked call that results in aFC.

9-9-10 ReceiverDynamic: 14.08.25#ReceiverDynamic: onReceive: pID: -
action: android.intent.action.SCREEN_OFF
9-9-10 WakeLockManager: 14.08.25#WakeLockManager: acquired lock for M
autorelease: true warn: true
9-9-10 M: 14.08.25#M: process inbox, startID: 5
9-9-10 M: 14.08.25#M: extra: eventAct:
android.intent.action.SCREEN_OFF
9-9-10 M: 14.08.25#M: extra: eventType: 9996
9-9-10 M: 14.08.25#M: +++ user not present +++
9-9-10 M: 14.08.25#M: running user-absent alarm to refresh time alarm
9-9-10 M: 14.08.25#M: start repeating user-absent updates: 600 secs.
9-9-10 WakeLockManager: 14.08.25#WakeLockManager: release: M
9-9-10 ReceiverDynamic: 14.08.26#ReceiverDynamic: onReceive: pID: 5
action: android.intent.action.PHONE_STATE
9-9-10 WakeLockManager: 14.08.26#WakeLockManager: acquired lock for M
autorelease: true warn: true
9-9-10 ReceiverDynamic: 14.08.26#ReceiverDynamic: onReceive: pID: 10
action: android.intent.action.PHONE_STATE
9-9-10 ReceiverDynamic: 14.08.26#ReceiverDynamic: onReceive: pID: 9
action: android.intent.action.PHONE_STATE
9-9-10 M: 14.08.26#M: process inbox, startID: 6
9-9-10 M: 14.08.26#M: extra: eventAct:
android.intent.action.PHONE_STATE
9-9-10 M: 14.08.26#M: extra: eventConID: 5
9-9-10 M: 14.08.26#M: extra: eventType: 9996
9-9-10 M: 14.08.26#M: extra: eventExt:
Bundle[mParcelledData.dataSize=48]
9-9-10 M: 14.08.26#M: B state: RINGING
9-9-10 M: 14.08.26#M: checkMatchStates: 40: handleChanges: true
handle: Incoming Call
9-9-10 MyContacts: 14.08.27#MyContacts: phoneToData: 0 -> null
9-9-10 MyContacts: 14.08.27#MyContacts: match specC:FAV number 0 found
contact: null
9-9-10 MyContacts: 14.08.27#MyContacts: try match part: C:FAV
9-9-10 MyContacts: 14.08.27#MyContacts: try favourite match
9-9-10 MyContacts: 14.08.27#MyContacts: phoneToData: 0 -> null
9-9-10 MyContacts: 14.08.27#MyContacts: got: null
9-9-10 Mirror: 14.08.58#Mirror:
AudioManager.registerMediaButtonEventReceiver: unavailable
9-9-10 Mirror: 14.08.58#Mirror:
AudioManager.unregisterMediaButtonEventReceiver: unavailable
9-9-10 Mirror: 14.08.58#Mirror: Parameters.getFlashMode: available
9-9-10 Mirror: 14.08.58#Mirror: Parameters.setFlashMode: available
9-9-10 Mirror: 14.08.58#Mirror: android.bluetooth.BluetoothClass:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothClass.getMajorDeviceClass:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothClass.getDeviceClass:
available
9-9-10 Mirror: 14.08.58#Mirror: android.bluetooth.BluetoothDevice:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothDevice.getAddress: available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothDevice.getName: available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothDevice.getBondState:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothDevice.getBluetoothClass:
available
9-9-10 Mirror: 14.08.58#Mirror: android.bluetooth.BluetoothAdapter:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothAdapter.getDefaultAdapter:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothAdapter.getBondedDevices:
available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothAdapter.getName: available
9-9-10 Mirror: 14.08.58#Mirror: BluetoothAdapter.setName: available
9-9-10 Mirror: 14.08.58#Mirror: PowerManager.isScreenOn: available
9-9-10 Mirror: 14.08.59#Mirror: TelephonyManager.getITelephony:
available
9-9-10 Mirror: 14.08.59#Mirror: android.speech.tts.TextToSpeech:
available
9-9-10 Mirror: 14.08.59#Mirror: TextToSpeech.getDefaultEngine:
unavailable
9-9-10 Mirror: 14.08.59#Mirror: TextToSpeech.setEngineByPackageName:
unavailable
9-9-10 Mirror: 14.08.59#Mirror: android.app.WallpaperManager:
available
9-9-10 Mirror: 14.08.59#Mirror: WallpaperManager.getInstance:
available
9-9-10 Mirror: 14.08.59#Mirror:
WallpaperManager.getDesiredMinimumWidth: available
9-9-10 Mirror: 14.08.59#Mirror:
WallpaperManager.getDesiredMinimumHeight: available
9-9-10 Mirror: 14.08.59#Mirror: WallpaperManager.clear: available
9-9-10 Mirror: 14.08.59#Mirror: WallpaperManager.getFastDrawable:
available
9-9-10 Mirror: 14.08.59#Mirror: WallpaperManager.setBitmap: available
9-9-10 Plugins: 14.08.59#Plugins: reload plugin data
9-9-10 Plugins: 14.08.59#Plugins: SL4A (1375)
9-9-10 M: 14.08.59#M: init
9-9-10 M: 14.08.59#M: checkMatchStates: -1: handleChanges: false
handle: Incoming Call
9-9-10 M: 14.08.59#M: needed monitors: TIME
9-9-10 M: 14.08.59#M: need pstate: 0
9-9-10 M: 14.08.59#M: needed monitors: TIME
9-9-10 M: 14.08.59#M: need pstate: 0
9-9-10 M: 14.08.59#M: TIME: monitor re|start
9-9-10 M: 14.08.59#M: set next time: 22.00.00 9-9-10
9-9-10 M: 14.09.00#M: refresh next time: 22.00
9-9-10 M: 14.09.00#M: created
9-9-10 M: 14.09.00#M: process inbox, startID: 6
9-9-10 M: 14.09.00#M: extra: eventAct:
android.intent.action.PHONE_STATE
9-9-10 M: 14.09.00#M: extra: eventConID: 5
9-9-10 M: 14.09.00#M: extra: eventType: 9996
9-9-10 M: 14.09.00#M: extra: eventExt:
Bundle[mParcelledData.dataSize=48]
9-9-10 M: 14.09.00#M: B state: RINGING
9-9-10 M: 14.09.00#M: checkMatchStates: 40: handleChanges: true
handle: Incoming Call
9-9-10 MyContacts: 14.09.00#MyContacts: phoneToData: 0 -> null
9-9-10 MyContacts: 14.09.00#MyContacts: match specC:FAV number 0 found
contact: null
9-9-10 MyContacts: 14.09.00#MyContacts: try match part: C:FAV
9-9-10 MyContacts: 14.09.00#MyContacts: try favourite match
9-9-10 MyContacts: 14.09.00#MyContacts: phoneToData: 0 -> null
9-9-10 MyContacts: 14.09.00#MyContacts: got: null

Pent

unread,
Sep 9, 2010, 4:43:11 PM9/9/10
to Tasker
Thanks, I was pretty suspicious that there were no bugs with contact
names so far :-)

Pent

Adamx

unread,
Mar 3, 2011, 2:32:49 PM3/3/11
to tas...@googlegroups.com
Hmm, this sort of works on my phone (original Droid). I set the Task priority up to 10, and while the music stops as soon as I accept the phone call, if I swipe the "ignore call" then it keeps playing the music for a good 5-10 seconds. Maybe my phone's just too slow. :-/
Reply all
Reply to author
Forward
0 new messages