Friday 13 January 2006

Prank Callers Revenge Complete

Here is the final part on how I got my modem to automatically answer and drop phone calls from certain numbers that had been troubling me.

My Intel 536EP is famous for not supporting CLI, and slightly famous for the odd Intel engineer saying it does support CLI. No-one in the world has made it work.

Luckily, my sister in law returned my USR 56K external modem on Sunday, so I stick that in ttyS0 and remove the graphics stylus I wasn’t using anyway. This modem gives no problem recognizing CLI.

I decide to write my CLI Dropper in bash, for fun, and get more grief then you could imagine. It sounds easy, a quick stty, echo a few strings to the modem port and then enter a while loop to read back the response. Sadly bash’s bufferred IO reads too much (naturally) but then tries to put back the extra stuff using seek on a pipe. Well! This fails on a tty, and so lots of the output gets lost. It took me quite a while and use of strace to work this out.

Instead now, I use cat to pipe the output of the modem into a bash segment. Because cat is reading from a tty it is unbufferred, but also bash’s seek works, so everything is fine.

cat /dev/ttyS0 | while read line 

So now I just keep a list of banned phone numbers in /etc/clidrop. Banned callers get treated to about 5 seconds of modem noise before getting hung up on. All calls are logged in /var/log/messages, so I can look back and see what went on.

Here is my shell script, complete and tested:

#! /bin/sh

: ${MODEM:=/dev/ttyS0}

# modem on stdout
exec > "$MODEM"
stty igncr 38400 min 1 time 5 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke < $MODEM

send() {
  echo -ne "$*\r"
}

command() {
  send "$*"
  echo ">$*" >&2
  read response
  test "$response" == "$*" && read response
  echo "<$response" >&2
}

checkNumber() {
  echo "Check $1" >&2
  grep "^$1\%CONTENT%quot; /etc/clidrop &> /dev/null
}

# nasty cat hack cos bash "read" can’t unread extra lines from a tty
# but cat doesn’t buffer if it reads from a tty
cat "$MODEM" | (
command "AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0"
command "ATL0M0" # turn of speaker
command "AT#CID=1"

while read -s response
do
  case "$response" in
    "NMBR = "*)
      NUMBER="`expr "$response" : ‘NMBR = \(.*\)’`"
      if checkNumber "$NUMBER"
      then
        logger -t CLIDROP "Drop call from $NUMBER"
        echo "<$response DENIED" >&2
        send ATA
        sleep 5
        send ""
      else
        logger -t CLIDROP "Permit call from $NUMBER"
        echo "<$response PERMITTED" >&2
      fi;;
    *) echo "<$response" >&2;;
  esac
done


My /etc/clidrop file is has these numbers in:
08700500524
01413018000


Why does bash try to seek on input stream after a read? It’s so that it can pretent that it did not read more than it returned, and then any internal or external commands spawned will be able to get stdin from that point. Of course such external commands are not so nice, sed …/q will have slurped more of stdin than it ought to and so some of the remainder won’t be available to the calling bash script; so why is bash trying to be nice? Ah well… it’s what comes of pretending that a collection of commands and bash are a homogenous programming environment like perl.

26 comments:

  1. Hi,
    Can anyone tell me what these annoying calls are all about?
    Im being plagued by 08700500524 & 01413018000.
    The phone hangs up if I answer it and I just get some bullsh*t recorded message when I call the numbers back.
    Would most appreciate any info available
    Regards,
    Andrew Cooke

    ReplyDelete
  2. Been getting the same 08700500524 crap recently as well - usually starts around 2.30 then repeats every 90 mins. My search for the number only returned it was sold by Thus PLC. I have emailed them but had no reply (I’ve also mailed Watchdog :) ) Annoyingly ICSTIS only deal with 09 numbers, so it seems theres not much we can do…

    ReplyDelete
  3. It was good to find this site as we have also been plagued by calls from 08700 500 524 for the last couple of months. We were getting 2 or 3 calls a day which we ignored as we don’t pick up 0870’s we aren’t expecting, especially when they don’t have the manners to leave a message. Finally I got fed up and answered one and found myself talking to a Scottish chap who claimed to be from the RAC who was calling to sell me some kind of insurance. Of course the sale had to be done over the phone so I declined. To try to convince me he said he could give me my membership no to prove he was who he said he was, I told him anybody could hack their system to get my membership no. Anyway I’m going to check with the RAC to see if it’s genuine or not. I’ll add to this if I find out more.

    ReplyDelete
  4. 08700 500 524 is owned by a tele-marketing company, it would appear that http://www.elephant.co.uk/ also use them to irritate customers.

    ReplyDelete
  5. I have also been getting calls from this number, it looks like a ploy to have you only return the call thus clocking up your phone bill at the 0870 rate and lining someones pocket at 2-6p per callback just for the privilidge… beware! These numbers are freely available (http://0870.uk2numbers.co.uk for instance) for as little as £9.99 to ANYONE for less than moral purposes… www.saynoto0870.com

    ReplyDelete
  6. Just started getting these 08700500524 calls. never answer it have bt privacy some us that is!!!

    ReplyDelete
  7. I got, or have been getting calls from 08700500524 all of which say they are Telewest. MOst of the calls are late in the evening, 7-8pm latest. Its been going on a while now, they call and say can i speak to so and so, my mother who is out whenever they call. Could there be any truth to who they say they are? and how do they know peoples names?

    ReplyDelete
  8. I’ve also been getting calls from this number. I agree with the previous poster who suggests that it is a ploy to get us to call back..
    I have caller id so in future I’m not going to take the call..

    ReplyDelete
  9. Cassandra Pearson16 November 2006 at 20:47

    I have been getting calls daily from 08700500524 and rather than answering I decided to google it and what should I find? a long list of people having the same annoyance. Does this mean I’m going to be plagued with it from now on, if so what can I do about it coz frankly its a pain in the arse?

    ReplyDelete
  10. been getting these for a few days, i dont answer my phone to unrecognised numbers, i figure they can leave a message if its good news, but they never do. Oh well it doesnt bother me, every time it goes i get pleasure out of knowing they wont get what they are after. I think someone set me up though is it possible to arrange it with someone elses number as a stupid joke or revenge i wonder?

    ReplyDelete
  11. This number has just been recently callig my landline..they say they are from the cosmetic company AVON!! thing is, nobody in my household has given AVON the house line number…so they must get our details from 3rd parties

    ReplyDelete
  12. how do you get these prank fone calls from 08700500524 to stop? my grandparents have been plagued with calls from this number as past 3 weeks, every day, up to twice a day! with them hanging up, disgraceful!

    ReplyDelete
  13. Dave: to try and stop it, see the notes here:
    http://www.liddicott.com/~sam/?p=24

    ReplyDelete
  14. Re: 0870 0500524 (a late comment)
    According to SAYNOTO0870.COM calls from 0870 0500524 originate from Iresponse Centres Ltd.
    “Call centre contacting for a 3rd party using an autodialer”
    Companies House gives their address as:
    IRESPONSE CENTRES LIMITED
    C/O MCCLURE NAISMITH, NOVA HOUSE
    3 PONTON STREET
    EDINBURGH
    EH3 9QQ

    ReplyDelete
  15. My phoneline is handled through the free Asterisk PBX, using a pci card plugged into a spare PC, and then IP phones in my house…
    I deal with such callers as follows:
    exten => _s/08700500524,1,Answer()
    exten => _s/08700500524,n,NoOp(— ${CALLERID} calling —)
    exten => _s/08700500524,n,Wait(1)
    exten => _s/08700500524,n,Playback(test/pleasewait)
    exten => _s/08700500524,n,Playback(tt-somethingwrong)
    exten => _s/08700500524,n,Playback(tt-monkeysintro)
    exten => _s/08700500524,n,Playback(tt-monkeys)
    exten => _s/08700500524,n,Hangup()
    Which basically plays a few samples of monkeys, and then hangs up on them… I used to have it play the monkeys in a loop to see just how long they would stay on the line for.

    ReplyDelete
  16. 0141-444-0444 - just called them directly and they’ve removed me from their dialler.

    ReplyDelete
  17. What I’d like to know is how can someone respond to this sort of hassle that actually costs the perpetrator money !

    ReplyDelete
  18. Call 0141 444 0444 and they say they will remove your number - let’s hope so

    ReplyDelete
  19. I had a phone call from someone asking to speak with “Eric Martin” I replied this is he and the chap immediately put the phone down. I did 1471 and the 08700 500524 number was logged at 08:45pm on 15/08/07. It would appear to me that whoever this person was that he was simply ringing to obtain confirmation that I was at that number and presumably was obtaining confirmation that I still reside at my London address. This is somewhat worrying why should someone be using the 08700 500524 number for that purpose? Perhaps there is something untoward happening that I am not yet aware of but will find out in the future to my detriment no doubt! By the way, I did not detect any Scottish accent the chap sounded typically English-no accent whatsoever. I state this as some seem to have experienced calls from Edinburgh/Glasgow.

    ReplyDelete
  20. 31.08.07 Solution!!!! I just found their number. They are called “I Response Centres”, Glasgow. Call them on 0141 444 0444 and ask them to remove your number. I just did it and they have said my number will be removed within 24 hours. Let’s see…. full details
    I Response Centres
    5 Drum Mains Pk, Cumbernauld
    Glasgow
    G68 9LD
    0141 444 0444

    ReplyDelete
  21. We have just started to get calls from this number. I did as Steve suggested and asked for my number to be removed. A nice young lady from Scotland said that she would remove it from their database - we shall see.
    Thanks for the info

    ReplyDelete
  22. came back from holiday to find 5 calls from 08700 500524–and because of these and another nuisance 0800 call, the tape filled so friends could not leave messages.
    6 0ct 2007

    ReplyDelete
  23. Michelle Parfitt9 November 2007 at 01:40

    Received a call from 08700500524 asking me if i was a business, to which i replied yes. They then proceeded to ask me if i had a cd player i played on my premises or any electrical equipment that played music, radio or PC etc to which i replied yes.They then went on to say i would need a license to play music to my employees just as we require a license to watch tv. Having never herd of this i requested they forward me information in this respect together with the government guidelines regarding this of 1988 as they so advised me of these.
    Any comments welcome!

    ReplyDelete
  24. I got a call and when I answered the phone it went dead about 20 seconds later. I checked 1471 (last call received) and it was from 08700 500 524, before I had time to do anything the phone rang again and it was from someone offering me a deal to do with my being an Avon agent.
    I think this telemarketing firm are used by numerous companies to do these calls and think the first call tonight was probably the result of automated systems multi-calling numbers on a list of details, the first person who answers gets the telemarketer on the other end of the phone, everyone else gets a ‘hang-up call’ logged on their system.
    Feebee.

    ReplyDelete
  25. Below is a letter I have today sent to Iresponse.
    We’ll see if it stops those calls!
    18th March 2008
    Iresponse Centres Ltd
    5 Drum Mains Park
    Cumbernauld
    Glasgow
    Lanarkshire
    G68 9LD
    Dear Sirs
    “Offer” of Telephone Answering Service (0xxx-xxx xxxx)
    Further to recent telephone calls made from yourselves to the above number, we are now pleased to be able to offer a telephone answering service for calls made by yourselves.
    The costs for receiving your calls and providing someone to answer them are a very reasonable £10.00 per call. This will be invoiced to yourselves fortnightly and is subject to VAT at 17.5%
    Formal acceptance of this offer of a telephone call answering service is not required, as your next call to the above number will be deemed as acceptance of the contract between our two parties.
    Best regards,
    P J Winterbotham

    ReplyDelete
  26. This comment has been removed by a blog administrator.

    ReplyDelete