This question was put to Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him) and he said:
I think that this is a kind of spying and it is not permissible for anyone to spy on anyone else, because we have no right the judge anybody except by what is apparent. If we start spying on people we will have a lot of headaches because of this spying and we will be upset by what we hear and see.
Allaah says (interpretation of the meaning) “And spy not” [al-Hujuraat 49:12] after saying (interpretation of the meaning), “O you who believe! Avoid much suspicion; indeed some suspicions are sins. And spy not” [al-Hujuraat 49:12].
But if the head of the household sees indications of these evil telephone calls, then there is nothing wrong with setting up a recording device without their knowledge, but he realizes that there is something going on, he should not keep quiet and keep listening, rather he should rebuke them straightaway, because if he communities to listen,because he may hear something that will upset him even more. For example, if he comes across a bad telephone conversation, he must rebuke the one who is doing it straight away, and not delay it until the next day; he must put a stop to it from the beginning.
But with regard to mere suspicion based on waswaas (insinuating whispers of the Shaytaan), it is not permitted (for him to set up this device), but if he knows that the matter is serious and that it is actually happening, then it is OK to set up a recorder so as to find out what is going on.