call received

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

call received

Post by Ankit » 30 Apr 2015 02:12

Hi Martin
Is it possible to determine whether a call is received on SIM 1 or SIM 2 ??

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: call received

Post by Martin » 30 Apr 2015 19:43

Hi,

No, that's probably not possible at the moment since multi-SIM support is almost completely missing in the official API of Android and each manufacturer extends Android in a different way to support multiple SIMs.
You could try to see if the manufacturer of your ROM includes some unofficial information within the intent when a call is received.

To do this, you could use a trigger General Broadcast with Action set to android.intent.action.PHONE_STATE and see if the log shows some kind of a SIM ID.
On Android 5.1 the log would look about like this:

Code: Select all

Trigger 'General Broadcast: on android.intent.action.PHONE_STATE' intent bundle String incoming_number=01234567, String state=RINGING, Integer subscription=1
You could access the subscription information with following script in field Access intent extras of the trigger:
subscriptionId = getInt("subscription", 0);

Android 5.0 and 5.1 show some anomalies in this area and might send wrong subscription IDs (like 2147483647 instead of 1).

Regards,
Martin

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: call received

Post by Ankit » 01 May 2015 02:14

Hi Martin

The log is not showing anything related to the trigger......

01.05.2015 07:41:47.045 [Flow1] Starting to execute flow 'Flow1' with Context{global{global_battery_status_text=Discharging,global_mode=Normal,global_battery_level=77,global_last_display_on=1430443772718,global_screen=on,global_battery_temperature=41.4,global_vibrate=off,global_turnoffscreen=off,global_free_ram=1061,global_trigger_update_clock=1430445960000},local{flow_name=Flow1,triggertime=1430446307042,trigger=Manual}}
01.05.2015 07:41:47.083 [Flow1] Flow ended.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: call received

Post by Martin » 01 May 2015 12:57

Hi,

It looks like you've executed the flow manually. You have to enable the flow containing the trigger 'General Broadcast' and make a real phone call to your device. Otherwise the trigger will be bypassed and the no information will be printed in the log.

Regards,
Martin

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: call received

Post by Ankit » 02 May 2015 15:10

Hi Martin

I enabled the flow and made a real phone call...


02.05.2015 20:37:35.344 [Flow1] Starting to execute flow 'Flow1' with Context{global{global_battery_status_text=Discharging,global_mode=Normal,global_battery_level=64,global_last_display_on=1430578537511,global_screen=on,global_battery_temperature=38.2,global_vibrate=off,global_turnoffscreen=off,global_free_ram=1061,global_trigger_update_clock=1430579220000},local{trigger=General Broadcast: on android.intent.action.PHONE_STATE,data_string=null,scheme=null,action=android.intent.action.PHONE_STATE,flow_name=Flow1,triggertime=1430579255258,type=null,subscriptionId=0}}
02.05.2015 20:37:35.367 [Flow1] Flow ended.
02.05.2015 20:37:38.667 [Flow1] Starting to execute flow 'Flow1' with Context{global{global_battery_status_text=Discharging,global_mode=Normal,global_battery_level=64,global_last_display_on=1430578537511,global_screen=on,global_battery_temperature=38.2,global_vibrate=off,global_turnoffscreen=off,global_free_ram=1061,global_trigger_update_clock=1430579220000},local{trigger=General Broadcast: on android.intent.action.PHONE_STATE,data_string=null,scheme=null,action=android.intent.action.PHONE_STATE,flow_name=Flow1,triggertime=1430579258561,type=null,subscriptionId=0}}
02.05.2015 20:37:38.752 [Flow1] Flow ended.


This is the log

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: call received

Post by Martin » 04 May 2015 18:26

It looks like your device does not provide the subscriptionId so it defaults to the value 0.
It's probably not possible to detect the SIM in this case. Let's try one more thing: enable Debug log in the preferences of Automagic, make the phone call one more time and then use (menu->Manage->Log, menu->Send log) to send the log to me so I can check if your ROM includes any other information in the intent that could be used.

Are you still using the ZenFone 5 with Android 4.4.2 or did you get an update to Android 5.0?

Regards,
Martin

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: call received

Post by Ankit » 05 May 2015 02:12

Hi Martin
I have send the log.
So please check your mail.
Thanks

Locked