maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Auto answer (https://talk.maemo.org/showthread.php?t=64444)

fuel__2001 2010-10-27 09:46

Auto answer
 
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 :rolleyes:.

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 ;)

Quote:

#! /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()

rambo 2010-10-27 19:17

Re: Auto answer
 
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.

aathava 2010-10-28 05:00

Re: Auto answer
 
wow! tested working gud,
can u add anything like answering machine
- playing a prerecorded mp3 file on aswering

fuel__2001 2010-10-28 09:48

Re: Auto answer
 
Quote:

Originally Posted by aathava (Post 854655)
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.

aathava 2010-10-28 10:43

Re: Auto answer
 
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

ossipena 2010-10-28 10:50

Re: Auto answer
 
what do you mean by phone menu? the menu that appears when you tap the title bar when phone app is open?

aathava 2010-10-28 10:58

Re: Auto answer
 
no, under settings>phone
or it shall be added in settings>extra

fuel__2001 2010-10-28 11:03

Re: Auto answer
 
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?

ramchagol 2010-11-15 19:06

Re: Auto answer
 
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

fuel__2001 2010-11-18 09:27

Re: Auto answer
 
Quote:

Originally Posted by ramchagol (Post 874325)
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 :rolleyes: 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.


All times are GMT. The time now is 07:35.

vBulletin® Version 3.8.8