Tasker to detect and vibrate once the ougoing call is being answered

I happen to find that for GSM standard phone, call duration would be created into sql database only if the outgoing call is being answered, or after hanging up if it is not being answered.

So i guess this method is meant for CDMA android phone only. cause we could not detect if outgoing call is offhook by the callee via tasker or sl4a.

Java code would be the solution i think, by monitoring the phone state.
 
 
If you are interested, please follow my profile instruction below and run some test, please further advise me if it is working or any issues. many thanks!
 
 
NB.: to run sqlite 3 command, you must make sure your phone has installed the proper sqlite3 file and you must root your phone first to run sqlite3 command.
 
Tips:
download the sqlite3 file via the links below and renane it as "sqlite3" if it is not, then put it under the phone root directory /system/bin folder, and don't forget to modify the permission for the sqlite3 file to be
rwxr-xr-x
 
android 4.0 or earlier:  http://bit.ly/sqlite3
  
 
profile:

context: state-phone-call, type:outgoing
 
task:
 
action 1: script-run shell,
command:
sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "select duration from calls where type <= 2 order by date desc limit 1;"
 
use root checked, store result in %VIBRATING 
 
action 2: alert-vibrate, 200ms, if %VIBRATING  ~   1
 
action 3: task-goto, action number 2, if %VIBRATING    !~   1
 
Action 4: task-stop, if %VIBRATING  ~   1

你可能感兴趣的:(call)