Active Topics

 


Reply
Thread Tools
chemist's Avatar
Administrator | Posts: 1,036 | Thanked: 2,019 times | Joined on Sep 2009 @ Germany
#11
Back to topic please. It doesnt help it to explain yourself like that.

Just read somewhere else that you have 2 different setups for calendar and general alarm. what alarm do you mean? different per clock alarm? Thats what I read from the starting post. Per calendar notification setup would be another idea but that should be filed with the alarm system. Is alarmd handling phone calls? If not this topic should be split into two, one for alarmd and one for the call handler.

Please request a solution move from the collecting brainstorm.

Last edited by chemist; 2010-01-21 at 00:41.
 
Posts: 236 | Thanked: 223 times | Joined on Oct 2009 @ NE UK
#12
I suggested a really impractical brain-dead approach to creating this functionality in: http://talk.maemo.org/showthread.php...340#post456340

Just for fun, I actually tried to do this in an even *less* sensible manner than using python methods to talk to dbus - by executing dbus-monitor from within perl and parsing it's output (after setting the silent profile on the phone.)

Code:
#!/usr/bin/perl

# listen for incoming calls
$dbus_mon_cmd = "/usr/bin/dbus-monitor "
   . "--system \"type='signal',path="
   . "'/com/nokia/csd/call',interface='com.nokia.csd.Call'\"";
# map incoming numbers to ringtones
%tones = (
        # gf number
        '077XXXXXX' => '/home/user/MyDocs/.sounds/harp.wav',
        # boss's number
        '01XXXXXXX' => '/home/user/MyDocs/.sounds/parp.wav',
        'default' => '/home/user/MyDocs/.sounds/mystery.wav',
);

# play a file in media player via dbus.
sub pf($) {
        ($f) = @_;
        $pf_cmd = "dbus-send --print-reply "
 . "--dest=com.nokia.mediaplayer "
 . "/com/nokia/mediaplayer com.nokia.mediaplayer"
 . ".mime_open string:\"file:///$f\"";
        system("$pf_cmd &");
}

# start listening on dbus
open(DBUS, "$dbus_mon_cmd|") or die "couldn't read output from dbus-monitor: $!";

$debug=0;

while(<DBUS>) {
        print if($debug);

        # find the incoming number. 
        if(/string\s"(\d*)"/) {
                $num = $1;
                print "$num is calling..\n";
                if($num =~ /^\d+$/ and ($tones{$num})) {
                        # play corresponding tone
                        pf($tones{$num});
                } else {
                        pf($tones{'default'});
                }

        }
}
This doesn't work, I'm sorry to say, because the phone app seems to block media player, even in silent profile. So the configured tone plays, but only after I answered the phone or hung up (haha).

If there's some way of getting around this (a more direct way of playing the ringtone, or removing the phone app's block, ...) and a way of stopping the file playing when you answer, hang up, or lose the call, then it might work.

N.B. I'm not suggesting this as a viable actual solution! It's just for fun..


My preferred non-braindead, non-hacky solution would be for Nokia to open up the phone UI(!) (maybe the contacts infrastructure - I don't know about their status) and/or provide a simple, clean, and extensively documented framework to use the underlying API.


If this were done, I don't think it would take very long for this functionality to arrive.
 
Posts: 179 | Thanked: 99 times | Joined on Feb 2010 @ Yorkshire, UK
#13
I just got the N900 and can't believe this function is missing. For me it is work related. I can set various ringtones for mates etc. And ignore them when at work, but if the missus rings me I know it is slightly more serious or important and can answer just by ring tone. Vice versa, at weekends if the boss calls I can ignore it (unless 'on call') A glowing error not to have it.

I come from HTC phones that have had this for years as standard and It should be added.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#14
Here is my idea:

We should write a daemon which intercepts the phone calls, and BEFORE the ringtone starts, it would rewrite the config file which stores which audio file should be played.
Then after the call is received, it would rewrite the config to its original value.

I would really like to make it work, but I don't have a clue about Linux development (yet).
(I come from the .NET camp, so I'm pretty new to all this. However, if anyone could give me some pointers on the subject in PM, I would be grateful.)
 

The Following 2 Users Say Thank You to Venemo For This Useful Post:
Posts: 228 | Thanked: 145 times | Joined on Dec 2009
#15
 
Posts: 1,179 | Thanked: 770 times | Joined on Nov 2009
#16
Originally Posted by twigleaf1976 View Post
I just got the N900 and can't believe this function is missing. For me it is work related. I can set various ringtones for mates etc. And ignore them when at work, but if the missus rings me I know it is slightly more serious or important and can answer just by ring tone. Vice versa, at weekends if the boss calls I can ignore it (unless 'on call') A glowing error not to have it.

I come from HTC phones that have had this for years as standard and It should be added.
Lol Nokia phones have had it for 10 years now. What Nokia were thinking when they left this out only goodness knows.
 
Posts: 47 | Thanked: 19 times | Joined on Jan 2010
#17
groups and group specific ringtones, caller specific ringtones are present in nokia phones for years now. i am not sure why nokia missed this key feature. also creating different profiles is also not present which is another miss. is there any way we can request nokia to provide them in pr1.2
 
Posts: 104 | Thanked: 60 times | Joined on Dec 2009 @ London
#18
Originally Posted by Venemo View Post
Here is my idea:

We should write a daemon which intercepts the phone calls, and BEFORE the ringtone starts, it would rewrite the config file which stores which audio file should be played.
Then after the call is received, it would rewrite the config to its original value.
I agree that sounds like the best way to do it. Would be nice to then have a plugin for Contacts which configured the daemon and told it the path to the new ringtone.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#19
Originally Posted by qw3rty View Post
I agree that sounds like the best way to do it. Would be nice to then have a plugin for Contacts which configured the daemon and told it the path to the new ringtone.
Yeah. It was a nice idea.
I've done some research, and found out the location of the .ini file in question. It is "/home/user/.profiled/custom.ini". (My ringtone is "Stargate Atlantis Outro.mp3", and there was no other file containing the text "Stargate". Without the quotation marks, of course.)
I re-wrote the value in the config file but the ringtone didn't change. Then, I rebooted the device and it finally changed.
Obviously, the device only reads the setting when it starts. (And also, I think the Settings application restarts the process responsible for it, however, I didn't try to find out which process it is. I think it would probably mess up with the phone functionality if the daemon restated that process while receiving a call.)

Later I found out that actually the device converts the selected ringtone to a mono .wav file. (And it also does that quite buggyly. )
Look at "/home/user/.local/share/sounds".

So, a work-around would be the followig:
The same daemon described in my above post, but instead of manipulating the config, it should also convert the personal ringtones to .wav, and then simply rename the files before the phone application plays them.

Last edited by Venemo; 2010-03-06 at 00:55. Reason: Some clarifications
 

The Following User Says Thank You to Venemo For This Useful Post:
Posts: 323 | Thanked: 76 times | Joined on Jan 2010
#20
is there any update on this devel?
 
Reply


 
Forum Jump


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