Thread: pycallblocker
View Single Post
Posts: 291 | Thanked: 398 times | Joined on Jan 2011 @ USA
#8
Originally Posted by sneer_69 View Post
I have a problem with pycallblocker. I'm using "call waiting" feature, When I make a phone call and during that call blocked number is calling it's ending my current call and allowing blocked number to call me. I'm in UK in o2. Please help
The solution for your case is to add another function to the callblocker-daemon.py to read the file /var/run/mce/call , which has the word "yes" if the call is active and "no" if it's not, and then change the line below in callblocker-daemon.py accordingly.

callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1') for no

callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/2') for yes

Here's my noob py function to read the file 'var/run/mce/call' and return 1 if call is inactive 2 if it's active. Since this is my first py script modification, i am sure it can be optimized and hope someone in the forum can help.

Code:
def check_callstatus():
	try:
		callfile = open('/var/run/mce/call', 'rb')
		cstat = callfile.readlines()
		callfile.close()
		if cstat[0] == 'yes':
			return 2
	except Exception:
		print "Hmm...wtf"
	return 1
Then you can change the line below in callblocker-daemon.py

from:
callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1')

to:
callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/' + str(check_callstatus()))


Now whenever you're talking on the phone the blacklist callers will go straight to the voicemail box and the missed call alert box won't even show up. So you don't even know if they call you. I hope there will be some way to get rid of missed call alert box when not on the phone.
 

The Following 3 Users Say Thank You to khuong For This Useful Post: