Reply
Thread Tools
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#1
I have had this idea for some time now.

What i want to do is:
Having a do not disturb function (like silent mode)
When getting a call the phone auto picks up, but plays a recording you made that goes something like this "I'm sleeping right now, if you have to get a hold of me press 1, else leave a message or hang up, what you say from this call being intercepted has been recorded and your number is also noted down, i will call you back as soon as i have time.

So the task list would be when in this mode:
auto pick up call
start recording call (like recaller), and name file like recaller makes
play the recorded message (like normal voicemail)
- If caller inputs "1" (or what ever is setup) then:
keep recording until call is taken or rejected by you
play ringtone & vibrate if set (simulate normal call)
wait for your input (pickup call/reject call)
when you pickup or reject call then keep or stop recording (setting for this mode)

What do you guys think, can this be done?, can you help me achieve it, it would be so cool to have.

EDIT: For N900 so far.

Last edited by dr_frost_dk; 2011-12-30 at 11:55.
 

The Following 4 Users Say Thank You to dr_frost_dk For This Useful Post:
Posts: 1,096 | Thanked: 760 times | Joined on Dec 2008
#2
seems totally possible, but I dont think anyone has done it yet.

you can set autoanswer with AT commands

recaller source code is available I think, maybe you can put in a switch for playing audio into phone call...or you can see how it is picking up the coming call csd dbus signal and do what you want with it then.
 
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#3
Yes it should be possible, i just need some help with catch signals and such, like the dbus commands.

I have never seen or heard of such a system on the local source (mobile phone) but in the case of i just have to reach this person even tho the person is sleeping or occupied in any other situation.
 
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#4
I can't remember the pages of where i can find all the dbus scripts. i would really like to take a stab at making this, of course it will probably be scripts first
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#5
Originally Posted by dr_frost_dk View Post
I can't remember the pages of where i can find all the dbus scripts.
I only know this one
http://wiki.maemo.org/Phone_control
(incl.exactly what you need).
But if there are more, I would also like to know the (all) dbus-commands.


BTW: Nice idea.
I had some times earlier a program on my symbian phone with similar functionality, Can not remember the name and exact functions, but at least it had an internal answering machine with possibility of user spoken greeting and SMS answering.
--edit
Just for the records: the name of the application is MobieGenie (E65).
I even found the sis file, but disassembling will not help you, or?

Last edited by peterleinchen; 2011-12-30 at 19:09.
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 147 | Thanked: 150 times | Joined on Aug 2010 @ Finland
#6
This you've probably already read, but just in case you haven't:
http://talk.maemo.org/showthread.php?t=30757

EDIT:
Someone was faster & better
 

The Following User Says Thank You to Aonsaithya For This Useful Post:
Posts: 1,096 | Thanked: 760 times | Joined on Dec 2008
#7
you probably are thinking of here:

http://wiki.maemo.org/Phone_control

here is recaller source

http://maemo.org/packages/source/vie...aller/2.1.0-5/

here is the part of recaller that sets up the hook for incoming calls

Code:
#[SIGNAL] com.nokia.csd.Call.Coming  /com/nokia/csd/call  :1.17
    #( op'/com/nokia/csd/call/1', "0313520331" )
    self.bus.add_signal_receiver(self.callInfoFrom,
                            dbus_interface=None,
                            signal_name="Coming",
                            bus_name="com.nokia.csd",
                            path="/com/nokia/csd/call",
                            )
here is the part where it records the phone call:

Code:
def start_PhoneRecording(self):
      self.startTime =  time.strftime("%Y%m%d_%H%M%S")
      self.startTimeToDisplay =  time.strftime("%H:%M:%S")
      if self.caller == None:
        self.fileName = os.path.join(self.folder,"Rec_%s.%s" % (self.startTime,self.fileformat.lower()))
      else:
        self.fileName = os.path.join(self.folder,"Rec_%s_%s.%s" % (self.caller,self.startTime,self.fileformat.lower()))  
      self.fileName = os.path.join(self.folder,"CurrentlyRecording.%s" % self.fileformat.lower())
      print "Self.source="+self.source 
      print "self.fileName="+self.fileName 
      print "Launcher config is:"
      print self.get_launcher()
      #self.gsterr = ""
      self.recorder = gst.parse_launch ( self.get_launcher())
      #print "parse_error:"+str(self.gsterr)
      if self.recorder == None:
        print "Launch failure!"
        return
      # else:
        # print "launch state"
        # print self.recorder.get_state(1)
      bus = self.recorder.get_bus()
      # need to connect to sync message handler so we get the sink to be
      # embedded at the right time and not have a temporary new window
      bus.enable_sync_message_emission()
      bus.add_signal_watch()
      bus.connect("sync-message::element", self.on_sync_message)
      bus.connect("message", self.on_message)
      self.recorder.set_state(gst.STATE_PLAYING)
      #success, state, pending = self.recorder.get_state(1)
      #if state != gst.STATE_PLAYING:
      #  self.log("ERROR: Failed to start recording in gstreamer!")
      #  return
      self.draw_e_on()
      self.isStopped = False
      if self.reminders:
        self.timer = gobject.timeout_add_seconds(30, self.recordingreminder_cb)      
      # print "phonerecording!"

you could search around in the forum other gstreamer commands to perhaps achieve other things with modified recaller(look around line 332 at the generated gstreamer command.

the hardest part with what you propose is probably getting and parsing the dtmf tone from the audio stream.
 

The Following 2 Users Say Thank You to quipper8 For This Useful Post:
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#8
Nice Thanks fellow maemo users, now i really have something to get started on
 

The Following User Says Thank You to dr_frost_dk For This Useful Post:
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#9
Finally have some time to try this out.
And so far so good.

Code:
#! /bin/sh

dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"
dbus-monitor --system type='signal',interface='com.nokia.csd.Call',member='Coming' | while grep -q 'object path "/com/nokia/csd/call/1"'
do
sleep 1
echo Answering Call
dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.Answer
sleep 1
echo muting Microphone
dbus-send --type=method_call --dest=org.maemo.Playback.Manager /org/maemo/Playback/Manager org.maemo.Playback.Manager.RequestMute boolean:true
done
This when running puts N900 in silent mode, answers call after 1 second when receiving call, and 1 second after that it mutes the microphone (who knows what's going on at my end , not cool to just call me and spy on me )

Now next thing i have been fiddling with but with no success is playing an audio file that caller can only hear, in my end i would be able to hear everything from caller (also needs to record from call pickup).
Last but not least if keytone 1 is pressed from callers side then it needs to play audio file that i can hear (ringtone).

Now it might be that i need to go with python, but so far it works nice as a Script.
Attached Files
File Type: txt N900 auto answer system.sh.txt (598 Bytes, 83 views)

Last edited by dr_frost_dk; 2012-01-08 at 23:19.
 

The Following 4 Users Say Thank You to dr_frost_dk For This Useful Post:
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#10
Anybody have any idea on how to archive the last few things.

Im thinking about ver 1.0 being simple just having:

Set silent mode
Answer call 1 second after receiving call
Turn microphone off 1 second after (no need to hear snore or anything else)
---- the above so far has been achieved ----
Play message to caller
- Im busy right now, your call has been logged and will call you back
- when i can, or if it is urgent press 1 to get a hold of me
wait for input (20 sek)
if no input end call
if input play "ringtone" to alert me that a urgent call is coming through.

So far im having trouble getting any audio in either direction because of phone function of course muting all other audio (songs, videos etc)

Do i need to begin reading up on python again so i can make it there, or do any of you have some way of getting the audio things to work, and also receiving a keytone (like 1) to goto next steps
 

The Following 2 Users Say Thank You to dr_frost_dk For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 09:42.