AutoNotification Intercept WhatsApp Incoming Call

Discussion in 'AutoApps' started by MysticGolem, Jul 19, 2017.

  1. MysticGolem

    MysticGolem New Member

    Joined:
    Feb 26, 2016
    Messages:
    19
    Likes Received:
    0
    Greetings,
    I have been looking on the forums and on tutorials on how to use AutoNotification to intercept WhatsApp calls. I have seen a YouTube video on how to intercept an incoming call from the Dialer/Phone app.
    My goal is to intercept a WhatsApp Call (incoming or outgoing) and then pause music.
    I am generally playing music on my phone and when I receive a call from the dialer app I am able to setup a profile and task to recognize this and pause my music.
    I would like to do the same thing from a WhatsApp call please.

    So far what I've done is:
    Create a profile with, Event -> Plugin -> AutoNotification -> Intercept
    I've then selected App -> WhatsApp
    Then placed a checkbox for Get All Fields = True

    Next I would need a Task:
    The task should somehow detect that when I receive a notification from WhatsApp either message or call, the Tasks should parse something to determine the difference. If it is a call notification then Pause music.

    I am guessing we can use anButton1text, see if it equal "Answer", that's one way to determine it is a Call notification from WhatsApp. And then pause music accordingly.



    Is my logic correct, or is there a better way to handle this?

    Can anyone help me out with this please?


    Thanks in advance!
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yes, that seems to be correct :) Is it not working for you?
     
  3. MysticGolem

    MysticGolem New Member

    Joined:
    Feb 26, 2016
    Messages:
    19
    Likes Received:
    0
    Greetings,
    Thank for your prompt reply.
    I was actually looking at if anyone else has done it before and if they can share their logic, or if there is a better method, or built in method.

    I did some testing last night and I sort of got it working. I need more time to test.
    I am able to use AutoNotification to intercept all WhatsApp messages which is fine.
    Then I can look at the %anbutton1text to determine if it says "Answer" which is for an incoming call, or "Hangup" for an outgoing call.
    My initial test seems to work by checking the button text and that will pause my music.

    I then tried to use %antext for an outgoing call it would have "Calling..." but following if statement doesn't trigger. This is weird.
    I have Variable Set, %WhatsAppText to %antext.
    If %WhatsAppText = "Calling..."
    Pause Music

    That bit of code isn't working, the if statement doesn't hold true. I'll do more testing as my tests were done last night around 11 pm and I was really tired. If It can't get the %antext to work I will probably use %anbutton1text instead.

    Also how do I tell AutoNotification to "Answer", or press %anbutton1text? I would like to be able to automatically answer the call after 5 seconds.

    Thanks a lot! I will definitely be supporting another Plugin, in particular AutoNotification. I already have a few others and they are great!


    Keep up the good work.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    MysticGolem likes this.

Share This Page