Reply
Thread Tools
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#1
Hello,

I need to run a script when answering my phone call. Without using python. The idea is to use QBW or a script in bash / sh.

How I can detect this event? An example please ...
 
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#2
MuhammadAG made a prog for this.. "phone.." something i think it was named. It's in the repos... To make dbus-calls easier to use for scripts like this.
__________________
You like what i do? Donate!

Make your desktop look awesome - use the AwOken Theme with the AwOken Icon Theme.

Add me on twitter @almehdin
Visit the swedish maemo/meego community forums
 
stephano21's Avatar
Posts: 44 | Thanked: 53 times | Joined on Apr 2010 @ amsterdam
#3
Originally Posted by WhiteWolf View Post
Hello,

I need to run a script when answering my phone call. Without using python. The idea is to use QBW or a script in bash / sh.

How I can detect this event? An example please ...
suggest this wiki

http://wiki.maemo.org/Phone_control
 
Posts: 433 | Thanked: 274 times | Joined on Jan 2010
#4
No help to OP, but IIRC "phone-control" doesn't detect an incoming call, so you can't use it in a script as it doesn't actually know if/when there is a call there to answer (though it *does* allow you to answer one if it happens to be present when your run phone-control --answercall).
__________________
n900: "with power comes responsibility".

If you buy a niche, highly modifiable smartphone and proceed to mess it up by blindly screwing around, don't just blame the phone, also blame yourelf.
 

The Following User Says Thank You to Pigro For This Useful Post:
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#5
This might of some help, part of out-call-vibro
Code:
MohammadAG-N900:~# cat /usr/bin/out-call-vibro.sh 
#!/bin/sh


if [ -f /var/run/out-call-vibro/out-call-vibro.pid ]
then
	echo Process is already running...
	exit 1
fi

echo $$ > /var/run/out-call-vibro/out-call-vibro.pid


vibro() {
	if grep -q "Call answered"; then
	    if [ `cat /sys/devices/platform/gpio-switch/proximity/state` = "open" ]; then
	       echo 150 > /sys/class/leds/twl4030:vibrator/brightness
	       gsleep 0.5
	       echo 0 > /sys/class/leds/twl4030:vibrator/brightness
	    fi
	fi
	}

monitor() {
          dbus-monitor --session type='signal',interface='org.freedesktop.Telepathy.Channel.Interface.Group',member='MembersChanged' | while read line ; do vibro ; done
          }

monitor

# End
 

The Following 4 Users Say Thank You to MohammadAG For This Useful Post:
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#6
ahh.. didn't think about that.. then dbus-monitor would solve it
__________________
You like what i do? Donate!

Make your desktop look awesome - use the AwOken Theme with the AwOken Icon Theme.

Add me on twitter @almehdin
Visit the swedish maemo/meego community forums
 
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#7
Thanks.

Tests will realize the code.

Also I have to see how to make a daemon that is pending from starting.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:58.