Reply
Thread Tools
Posts: 669 | Thanked: 433 times | Joined on May 2010
#1
i created a small script that allows you to answer calls by getting the device near your ear (using proximity sensor).
if the sensor is closed when the script is run (like if there's a call while the device is in the pocket) it will not answer but wait for an open state and only then it will answer on close state.

To use this feature you will have to set 2 dbus events invokes in "/etc/dbus-scripts.d/dbus-scripts-settings":

[scripts path]/incomingcall.sh * * com.nokia.mce.signal sig_call_state_ind ringing normal
[scripts path]/callend.sh * * com.nokia.mce.signal sig_call_state_ind none normal

Set the scripts to with execute permissions.

When a call comes, the incomingcall.sh is called, calling to the ProximityAnswerScan script.
When the call terminates, the callend.sh script is called which causes the ProximityAnswerScan to end.

After using it for some time now - it seems to be very comfortable way to answer calls - even when sometimes the device is not responsive when the call arrives.


Hope you'll like it too.
Attached Files
File Type: zip ProximityAnswer.zip (767 Bytes, 145 views)

Last edited by impeham; 2012-03-01 at 18:49.
 

The Following 11 Users Say Thank You to impeham For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#2
how do you install these? by executing those 2 command lines above?
 

The Following User Says Thank You to droll For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#3
f__k thats COOL. needs to be made into an app IMHO

edit: and ported to the N9
 

The Following User Says Thank You to F2thaK For This Useful Post:
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#4
Installed, now let's try...
EDIT:
something needs to be killed, cause i don't feel like rebooting...
EDIT2:
ok, it's still not working. Here is what i did
1) placed the folder ProximityAnswer with 3 files in it in /home/user/
2) created a file /etc/dbus-scripts.d/dbus-scripts-settings (i have dbus pakage installed, but i have only karam's dbus-scripts-settings-by-karam file, that's why i created a new one)
3) then i pasted these lines into that file:
Code:
/home/user/ProximityAnswer/incomingcall.sh * * com.nokia.mce.signal sig_call_state_ind ringing normal
/home/user/ProximityAnswer/callend.sh * * com.nokia.mce.signal sig_call_state_ind none normal
4) then run this
Code:
chmod 777 /home/user/ProximityAnswer/for-each-script
and for some reason also this
Code:
chmod +rwx /home/user/ProximityAnswer/for-each-script
5) rebooted
6) called myself, but when i put the phone near the ear, i can see the screen is black, but the ringtone is still playing, and the call isn't getting answered.
Please, can you please point where and what i did wrong
__________________
Reps are just one click away: Extras | Extras-Testing | Extras-Devel | My-Maemo | CSSU |
Transform your lock screen into a weather forecast Thanks button ================>

Last edited by Alfred; 2011-11-18 at 10:16.
 

The Following User Says Thank You to Alfred For This Useful Post:
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#5
Didn't quite get you...
Isn't "/etc/dbus-scripts.d/dbus-scripts-settings" a file? How can i have those scripts in there?
Sorry, i don't understand
__________________
Reps are just one click away: Extras | Extras-Testing | Extras-Devel | My-Maemo | CSSU |
Transform your lock screen into a weather forecast Thanks button ================>
 

The Following User Says Thank You to Alfred For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#6
hey sorry my instructions are wrong, try this:




1. extract files in attached zip into "/home/user/MyDocs/proxyanswer"
2. in file "/etc/dbus-scripts.d/dbus-scripts-settings"

add
Code:
/home/user/MyDocs/proxyanswer/incomingcall.sh * * com.nokia.mce.signal sig_call_state_ind ringing normal
/home/user/MyDocs/proxyanswer/callend.sh * * com.nokia.mce.signal sig_call_state_ind none normal

------------

BTW, anyone know if this would work on N9?
Im not sure if dbus-scripts/-settings etc installs...

Last edited by F2thaK; 2011-11-18 at 11:30.
 

The Following User Says Thank You to F2thaK For This Useful Post:
Posts: 151 | Thanked: 93 times | Joined on Sep 2009 @ sofia, bulgaria
#7
Very nice idea. Was not working for me, so I touch it here and there in order to make it work.
All credits goes to impehan, thanks for the great tool.

create file: /etc/dbus-scripts.d/dbus-scripts-answer_on_proximity
Code:
/home/user/bin/ProximityAnswerScan * * com.nokia.mce.signal sig_call_state_ind ringing normal
put ProximityAnswerScan in /home/user/bin and make it executable:
Code:
chmod +x  /home/user/bin/ProximityAnswerScan
restart dbus-script
Code:
/etc/init.d/dbus-script restart
That is all.
Attached Files
File Type: zip proximityanswerscan.zip (348 Bytes, 139 views)

Last edited by lidow; 2011-11-18 at 12:46. Reason: missing attachment
 

The Following 3 Users Say Thank You to lidow For This Useful Post:
Posts: 669 | Thanked: 433 times | Joined on May 2010
#8
a few remarks i forgot to add:
all scripts must be set to have execute permissions of course.
"ProximityAnswerScan" and "callend.sh" scripts are using the path:
"/home/user/smart/flags/" to create and delete a flag file "proximityanswerscan", so you need to create this folder with write permissions or set the scripts to point to some other location of your choosing.
 

The Following 2 Users Say Thank You to impeham For This Useful Post:
Posts: 101 | Thanked: 91 times | Joined on Feb 2010 @ Dallas TX
#9
It works fine for me, thx impeham and lidow!

is there anyway to do the same with to answer a call with hard press camera button or double click power button or something like that? im wondering cause very often I get a call and the screen stays black for a long while and sometimes I even miss the call before the screen comes back from black.

thx both for a great idea
 

The Following User Says Thank You to Dr.Marcial For This Useful Post:
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#10
Why not put the temp flag file in /tmp?
__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.
 
Reply

Tags
incoming calls, nokia n900


 
Forum Jump


All times are GMT. The time now is 21:00.