20 May 2011

Blocking anonymous calls on Nokia N900 (and possibly other Maemo phones)

[Disclaimer: since I need to somehow kick-start this blog, few next posts will contain some stashed tips I collected over time.]

I own a N900, probably the last geek-phone/tablet from Nokia. Recently I got really annoyed by all the telemarketers and (usually unpleasant) salespeople calling me passionately at various times of the day. I discovered a great and simple way to block unwanted calls: pycallblocker.
Unfortunately, the most persistent and useless offers come from anonymous (hidden) numbers. There wasn't a simple way to block these with pycallblocker, so I hacked it to suit my needs.

The only change needed concerns the callblocker-daemon.py file which is located at: /opt/pycallblocker/. I modified handle_call method as follows:
1
 2
 3
 4
 5
 6
 7
 8
 9
10
def handle_call(obj_path, callernumber):
    global blocklist
    if callernumber in blocklist or callernumber == '':
        if callernumber == '' and "Unknown" not in blocklist:
            return
        print 'I have to block %s' %callernumber
        bus = dbus.SystemBus()
        callobject = bus.get_object('com.nokia.csd.Call', obj_path)
        smsiface = dbus.Interface(callobject, 'com.nokia.csd.Call.Instance')
        smsiface.Release()
In third line I enable pycallblocker to capture hidden numbers at all. Next line decides whether to block anonymous call or not.

Last step is to enable the new functionality. Open the PyCallBlocker app and add New number:

Unknown

Launching the GUI should have already restarted the running daemon. All anonymous calls will now be blocked. You can always unblock them by removing the Unkown "number" from the blocking list.



4 comments:

  1. Hello, your way seems easy enouf just having the problem of not knowing how to edit the program, any help would be aprecitated.

    thanks

    ReplyDelete
  2. Hi, you can try a number of ways.
    1. I have SSH daemon installed on my N900 so I just edited it on my desktop and pushed through SSH.
    2. Try installing FileBox (enhanced file manager) so you'd see whole file system tree. Then, just navigate to the /opt/pycallblocker, long-press for contextual menu and select "Edit" to change necessary files. Make sure you have Leafpad or some other power editor, it's easier to work with text files.
    3. Last but not least you can open Terminal app and do the job with "vi" or vim (not installed by default).

    ReplyDelete
  3. I was completely pissed off, as i was receiving so many calls from some guy who was using different numbers every now and then, being a girl and not tech savvy i couldn't figure out what to do about this, ie how to block the calls . Nokia N 900 doesn't have such feature as auto rejection or blocking system so i had gone through all those python and rootsh memo software but i couldn't do any of it.
    And all of frustration went in and i thought of just changing my number or changing my phone instrument to get some other that had black listing number option.
    but eventually i browsed and searched my phone the applications software in which i saw my contacts in purple color software that had some blocking option written in its description i downloaded it, then searched in its settings that had the option of Group: block calls from , i then selected the numbers i had saved in name of unwanted and then went back on settings main screen where on the left it mentions: monitor incoming calls for , clicking on that u select the : auto reject calls and save it..it would say shut down and restart your phone and i did the same.

    and trust me it really worked i checked as i put my another number on its block list and when i called it automatically rejected the call and my number came as busy, on the other hand my n 900 showed call rejected from this number ...wow wow wow..
    am so happy now i was so sad and feeling helpless at the hands of such insane people who ruined my calm for so long unnecessarily.
    wanted to share this with everyone i know it really sucks getting calls from such people.

    ReplyDelete
  4. This is the quality of nokia phones that we can block unwanted calls within the phones setting and this features is not provided by other mobile phone companies Samsung Galaxy Note 6

    .

    ReplyDelete