With "incoming call" and the liste number there, I am æble to let the phone ring. So far so good ...
But what can I do that all other (not listed number) calls are immediatley blocked/rejected ... no ringning, no vibration no silent call. I think I should use a condition which devides in 2 action for listed and non listed number. But how can I do it?
I would be very happy for some help.
Best regards
Uli
Block all calls of number, which are not listed
Moderator: Martin
Re: Block all calls of number, which are not listed
When you use trigger Incoming Call, there are several variables created with multiple information about the caller. You can use that trigger to do so on every incoming call, and then use condition Expression to check if incoming_number (variable which contains the number of the caller) is contained or not in your number list. So your code in the condition can be something like this:
Consider you can have more than 3 numbers by following the same structure in the code.
That will return true if it's on the list, and false if it isn't. So then you go false from that, to action like End Call, and there's no need to connect if true as, if I understood correctly, you want those calls to pass through, and so by not connecting it, Automagic does nothing in that case.
Code: Select all
numbers = newList("Number 1", "Number 2", "Number 3");
containsElement(numbers, incoming_number);
That will return true if it's on the list, and false if it isn't. So then you go false from that, to action like End Call, and there's no need to connect if true as, if I understood correctly, you want those calls to pass through, and so by not connecting it, Automagic does nothing in that case.