zoukankan      html  css  js  c++  java
  • Tasker to auto record incoming or outgoing call

    Tasker to auto record incoming or outgoing call


    most of time, i was thinking of tasker can do the job like callrecorder? if yes, how to do?
    well, after done some homework, i have figured out the method below to share with you guys. via this method, tasker is able to auto record incoming 
    call and outgoing call, unwanted callee and unreached call will be excluded from recording.

    before everything, you should create 1 folder named with english characters, eg. Voice, then create 3 separate folders inside this folder, named it as "Incoming", "Outgoing" and "Temp".

    NB.

    if you are currently using some kind of caller location app, please make sure if it would change the call logs combined phone number and location info with symbol like angle brackets? if yes, tasker would fail to create the new file for outgoing call recording.

    Profile 1: (incoming call)  
    Context 1: Event- Phone- Offhook 
    Context 2: State: Incoming Call 

    Task:  

    Action 1: variable-Variable Set [ Name:%Oncall To:0]  
    Action 2: media-Record Audio [ File: Voice/Incoming/%CNAME_%CDATE_%CTIME  Source: incoming Call/Mic, Code: arm narrowband, format: raw_arm  ]  
    Action 3: alert-Notify [Title:Recording Call Icon:(any icon)]

    PS. you may put action 2 and 3 together as a separate task, then make it as a pop up alert positive button right after action 1, asking if you wanna 
    record.


    Profile 2: (outgoing Temp)

    Context: State: outgoing Call 


    Task: 

    Action 1: task-If, %CONUM !~ XXXXX       # XXXX stands for the phone number which you don't wish to record
    Action 2: variable-Variable Set [ Name:%Oncall To:1]  
    Action 3: media-Record Audio [ File: Voice/Temp/    Source:ouggoing Call/Mic Code: arm narrowband, format: raw_arm  ]    
    Action 4: alert-Notify [Title:Recording Call Icon:(any icon)]

    PS. you may put action 2 and 3 together as a separate task, then make it as a pop up alert positive button right after action 1, asking if you wanna 
    record.


    Profile 3: (stop recording) 

    Context: Event-phone-Phone Idle 

    Task: 

    Action 1: media-Record Audio Stop
    Action 2: alert-Notify Cancel, title: Recording Call
    Action 3: task-If %Oncall ~ 1
    Action 4: 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 %COUNT

    # this step is very important, cause we may know, tasker even sl4a script could not detect if the callee has picked up the phone. if duration is 0, i guess you don't wish to waste storage to record the ringtone, right? this shell command would extract the value of duration for the last phone call 
    you have made.

    Action 5: File--Move [ From: Voice/Temp/.amr  To: Voice/Outgoing/%CONAME_%CODATE_%COTIME.amr  If,  %COUNT > 0 ]        

    # Based on action 4 run result, tasker may detect and exclude the unreached outgoing phone call. so it would not waste storage space at all.

    cause the recording would just start right from the moment while dialing.

    Action 6: task-end if

    Action 7: variable-variable clear, name: %Oncall

    ##  duration counting  via sqlit 3 command

    if we look into the calllogs within android default call database, we will see some significant columns, which are very useful for us to get this job done.

    type: (numberic)

    3: incoming missed call,  2: outgoing call(reached or unreached)  1: incoming call(offhook)

    duration: (seconds)

    order by date desc limit 1: this is to identify and select the last one in record.

  • 相关阅读:
    UVA.10325 The Lottery (组合数学 容斥原理 二进制枚举)
    UVA.11806 Cheerleaders (组合数学 容斥原理 二进制枚举)
    容斥原理、鸽巢原理快速入门
    HDU.1847 Good Luck in CET-4 Everybody! ( 博弈论 SG分析)
    HDU.1850 being a good boy in spring festival (博弈论 尼姆博弈)
    POJ.1067 取石子游戏 (博弈论 威佐夫博弈)
    HDU.2516 取石子游戏 (博弈论 斐波那契博弈)
    HDU.2147 kiki's game (博弈论 PN分析)
    Front Page
    2018-2019 9th BSUIR Open Programming Championship. Semifinal
  • 原文地址:https://www.cnblogs.com/shangdawei/p/4510918.html
Copyright © 2011-2022 走看看