I want to reject incoming calls from certain number.
Logical flow of the application would be:
- receive an incoming call
- get the caller number
- check your database if you want to reject callsfrom this number
- if yes, reject the call
- otherwise let the normal procedure continue
Currently I am facing problems for the initial stage, i.e. notification.
Even if I get notified when I receive an incoming call, I have no information on how to retrieve the caller number. It seems that I CANNOT
retrieve the caller number using Etel APIs. Elsewhere in the forum, it is said that it can be done using Log APIs. Is that really possible?
My question is.. does the incoming call event gets logged even before answering / rejecting the call programmatically? If yes, then *only* the
Log APIs will be of help.
If not, is there any way to retrieve the caller number?
Has anyone implemented such a functionality successfully before? Any pointers / sample code snippet are highly appreciated.
Being a newbie, I am really confused by the comments/suggestions provided by Gurus/Experts here. Can anyone please throw some light on this issue? I am sure there are many people who are trying to achieve the same
functionality. May I expect some comments from Nokia Support on this
sensitive issue?
For OS 6.X phones you can use function defined in ETelBgsm.h header. Works well and easy to make as well.
For OS 7.0, you could use logs, but then you only get the number after answering the call, so not really suitable. So you would need to use function defined in EtelMM.h, Non-public, but seek for Motorola SDK and you might get the right ones that works.
With some never OS 7.0 phones ans well as future OS 8.0 phones, you should use CTelephony class, anyway I haven't figured out yet how to use it to get the number.
I am using Nokia 6600 which has Symbian 7.0v (initial release). It seems that it does not support CTelephony APIs (etel3rdparty.h).
The application spawns on the emulator.. but not on the phone. So, CTelephony APIs are out of question.
I downloaded the ETELMM.H, the original one (3342 lines of code). No documentation at all.
I guess RMobileCall::TMobileCallRemotePartyInfoV1::iRemoteNumber.iTelNumber represents the caller number (remote party). Here is how I am trying to access it. I am calling this in the RunL method, where I am supposed to hangup the call.
Try clearing the whole call database and try what happens. Also try with multiple calls where every second comes from different number.
I remember that when (about a year ago) I was trying this with my 6600, the latest number will only be available in logs after it has been handled. Basically how else would the phone know, where to put the number into (i.e answered, missed etc..)
Today's test was done after a phone "format" so the call database was empty. However, one second (or less) after the first ring my application was in foreground showing the number.
It is possible that under stress conditions this method would fail and is definitely not as fast as when using a dedicated API. I will try to find out what kind of problems were reported on my commercial application that uses this method of retrieving the caller-id.
In above code, i am creating an object of CallLogEngine in RunL() method of CallWatcher class.
CallLogEngine is also extending CActive object to get all events' details. Is it possible to call one cactive object from another objec? In other words, can i call one RunL() method from another RunL() method?
The above code is not working. It simply disconnects phone.
Here is what you should try using CLogFilter, CLogViewRecent and CLogClient:
- create an instance of every above mentioned classes
- set filter’s type to KLogCallEventTypeUid
- ask the log client to notify you on events (CLogClient ::NotifyChange)
- when notified update the view (CLogViewRecent::SetRecentListL) with all new events but filtered with the CLogFilter object
- when the view is updated get the first event and compare its id with the last one you used (the new one should have greater id value)
- use the information available in this CLogEvent object as you see fit
Hi,
@Itomuta
I get the caller's tel number from the logs while the phone is still ringing, but the correct tel number is not always been shown in the logs. Sometimes the current number in the logfiles is the number from the last incoming call. So I have no clue what i am making wrong. But i think that the logs has a non deterministic bahavior.
Why do you want to compare the log entry id with the last one's id?
my code is the following.
// in incoming call ao...
case RCall::EStatusRinging:
iCallActive = ETrue;
iCall.OpenExistingCall(iLine, iName);
iCallerIdMngr->GetLatest();// active object for incoming caller id
iCall.NotifyStatusChange(iStatus, iCallStatus);
break;
}
//ao for caller id
void CCallerIdMngr::RunL(){
if(iStatus == KErrNone){
const CLogEvent& event = iRecentLogView->Event();
iTelNumber.Copy(event.Number());
}
}
I only want to get the correct caller id, but i don't know why sometimes the wrong caller id is shown in the logs while ringing.
Thank for your help,
Horst Sueggel
in my application I used only the log engine to pop up a "dialog" with the name, the phone number and picture of the user... The call handling was done by the user, through normal phone interface. That is why I only used a event notification request, which was pending all the time.
As far a I can tell by looking at your code, if calling iCallerIdMngr->GetLatest() means that only now you request event notification it might be a little too late ...
Anyway, more to the point, I noticed that the log event ids are sequential and growing so if a event has id = N the next one would have id = N+1. Also a new log event might be generated for different reasons so it could happen (and usually it does) that after filtering the latest "new" event is actually the one already handled so I try to prevent this.
Hi, I only want to get a notification whenever there is a call and moveover when there is a missed call.
i.e When My app is running and there is an incoming call>In Most of the cases the call is answered but in a case the call is not answered , i want to show the user that there was a missed call on my application ..
As from your talks It appears that classes CLogFilter, CLogViewRecent and CLogClient can be used .Just a brienf on how to use it ?
Are they compatible with Symbian 6.1 also ?
I have Symbian 7.0 SDK installed but want to use API's whcih shud have backward compatibility also .