Every so often the phone spammers get a new block of numbers (024 7668
xxxx has just started up). As my home phone is on a SIP service, it's
time to get creative - I fancy building a SIP spam rejecter.
Plan is to run something on a Raspberry Pi to read the CLID. If it's a
normal call do nothing, and the phones here will ring as usual. But if
the number pattern is in a naughty list, answer the call, play SIT and
possibly a voice message, then terminate the call. Just rejecting the
call is no good, because the other phones will still ring as they're
registered with the SIP server individually.
The Raspberry Pi runs Raspian, and I have linphonec v3.12.0 installed
which I can automate with an Expect script.
Essentially I want to check the caller id, and if bad do:
play a wav file (SIT followed by a voice message)
linphonec's help text says I can play a wav file, but I get an error
when I try. Alternatively I can answer the call, then pause the call
which causes 'music on hold' to be played. The help text says I can
define the 'music on hold', but defining a wav file adds that audio to
an internal list of audio clips which seem to be selected at random -
maybe 1 time in 6 it plays my defined wav file.
Am I trying to do the impossible ? I can't see where the other 'music
on hold' clips are defined. Ideally I'd like to be able to select
different wav files for different classes of bad calls, but doing it
with one wav file as 'music on hold' would be OK.
This is what I have at the moment as a first try. Works nicely, but it
seldom plays my desired SIT audio file.