Reply
Thread Tools
Posts: 44 | Thanked: 34 times | Joined on May 2010
#1
Im a complete novice here, but out of frustration with a feature that is missing ive managed (with more luck than programming ability) to use the guides to create a script in python to auto answer calls which i built on a windows platform.

Ive tested the script on the N900 and im shocked i managed to get it to work, which for a first attempt only took 3 evenings .

Now if i want to go one further and create a button in the 'settings/phone' menu on the phone so the script can be turned on/off - does something else need to be added to the script? also where is a good place to start building the GUI?

Now im sure that script could do with some more work so please feel free to do your worst

#! /usr/bin/python
import os
import gobject, dbus
import time
from dbus.mainloop.glib import DBusGMainLoop

def handle_call(obj_path, number):
bus = dbus.SystemBus()
callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1')
smsiface = dbus.Interface(callobject, 'com.nokia.csd.Call.Instance')
time.sleep(0.5)
smsiface.Answer()
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_call, path='/com/nokia/csd/call', dbus_interface='com.nokia.csd.Call', signal_name='Coming')
gobject.MainLoop().run()

Last edited by fuel__2001; 2010-11-06 at 09:37.
 

The Following 14 Users Say Thank You to fuel__2001 For This Useful Post:
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#2
Cool, you would probably want to do the following things:

1. Have use GConf to check for auto-answer enabled/disabled
2. Have a very small widget to change the config value in 1
3. Daemonize the python script (for example with http://pypi.python.org/pypi/python-daemon/1.4.5) and make it start automatically on device start.

Happy learning.
__________________
  • Live near Helsinki, Finland & interested in electronics ? Check this out.
  • Want anti-virus/firewall ? Read this (and follow the links, also: use the search, there are way too many threads asking the same questions over and over and over again).
  • I'm experimenting with BitCoins, if you want to tip me send some to: 1CAEy7PYptSasN67TiMYM74ELDVGZS6cCB
 

The Following 2 Users Say Thank You to rambo For This Useful Post:
Posts: 47 | Thanked: 30 times | Joined on Jul 2010 @ BANGALORE
#3
wow! tested working gud,
can u add anything like answering machine
- playing a prerecorded mp3 file on aswering
 

The Following 2 Users Say Thank You to aathava For This Useful Post:
Posts: 44 | Thanked: 34 times | Joined on May 2010
#4
Originally Posted by aathava View Post
wow! tested working gud,
can u add anything like answering machine
- playing a prerecorded mp3 file on aswering
for me to even get this far was very slow, i didnt even realise using an underscore in the filename would cause problems.

im sure adding other things into the script can be done but its well out of my scope ATM.

The next step for me is to make a button and put it into the phones menu. i have no idea how long that will take but considering im learning as i go it could take some time, weeks rather than days.

if someone else wants to help or do the leg work to get this project moving then im more than happy to take a back seat. Im studying for a degree and have a fulltime and partime job as well as family commitments, so my time is very limited.
 

The Following 3 Users Say Thank You to fuel__2001 For This Useful Post:
Posts: 47 | Thanked: 30 times | Joined on Jul 2010 @ BANGALORE
#5
ok, lets collabrate
i would try to make an widget to run this script but to put a button on phone menu, may be some has to help us
 

The Following User Says Thank You to aathava For This Useful Post:
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#6
what do you mean by phone menu? the menu that appears when you tap the title bar when phone app is open?
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
Posts: 47 | Thanked: 30 times | Joined on Jul 2010 @ BANGALORE
#7
no, under settings>phone
or it shall be added in settings>extra
 
Posts: 44 | Thanked: 34 times | Joined on May 2010
#8
Marvellous news. any help would be greatly appreciated

EDIT - just had a rethink thought about where to place the button. In symbian (N95) the auto answer was placed in the profiles. I remember setting a profile up so i would only have to insert my headphones (which was usually when i was driving) and the phone would answer automatically.

any other thoughts about the placement of the button?

Last edited by fuel__2001; 2010-10-28 at 12:34.
 

The Following User Says Thank You to fuel__2001 For This Useful Post:
Posts: 2 | Thanked: 2 times | Joined on Nov 2010
#9
settings > phone

would be a great place and logical. maybe create like a check on/off option. this would be perfect for driving.

or if possible, create a whole new profile (car mode?) that will :

- auto answer calls
- automatically go in to speaker mode
 

The Following User Says Thank You to ramchagol For This Useful Post:
Posts: 44 | Thanked: 34 times | Joined on May 2010
#10
Originally Posted by ramchagol View Post
settings > phone

would be a great place and logical. maybe create like a check on/off option. this would be perfect for driving.

or if possible, create a whole new profile (car mode?) that will :

- auto answer calls
- automatically go in to speaker mode
Its so simple when you no what your doing and a very simple idea for someone who knows what there doing to create - but for me its like being blindfolded and learning as i go.

Its a big learning process. Ive had a play with QT but i found the checkbox widget doesnt look like the hildon based checkbox (perhaps im not using it correctly). So ive got as far as installing ubuntu in a VM, now iv installed scratchbox so i can play with hildon but for some reason it wont let me login. another hurdle to overcome.

I have spoke with the Developer of profilesX as i thought it would be easy just to insert the script into a profile, but it seems an app still has to be built to be able to do this. Creating a profile for driving is really what i would like to see. Just a simple checkbox is all thats needed to begin with.

So unless someone would like to complete the UI it could be a long wait for a finished app. I'm sure people who know what there doing, its just and hours work. I would be very grateful if someone helped out with this.
 
Reply

Thread Tools

 
Forum Jump


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