×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    52

    Can I retrieve the caller number on receiving an incoming call?

    Hi All,

    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?

    http://discussion.forum.nokia.com/fo...threadid=35457
    As per this discussion, it seems that we will need to do some patchwork in order to achieve the required functionality.

    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?

    Thanks in advance!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144
    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.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    52
    First let me thank you for your reply.

    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.

    ----------------------------------------------

    class RMobileCall;

    RMobileCall::TMobileCallRemotePartyInfoV1 address;

    _LIT(KMessage1,"Calling Number: ");
    CEikonEnv::Static()->InfoWinL(KMessage1,address.iRemoteNumber.iTelNumber);

    ----------------------------------------------

    The output is blank. No calling number displayed.

    Any idea how to use this? Where am I going wrong?

    Thanks!

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    Using logs one can get the caller-id information before the call was answered but not before the phone rings.

    HTH

  5. #5
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    52
    Hi Itomuta!

    As SymbianYucca said,

    "For OS 7.0, you could use logs, but then you only get the number after answering the call, so not really suitable."

    Well i am confused now. Even i was thinking that the call log helps only after answering/hanging a call.

    Please let me know whether the call log would really help me 'to know the calling number before answering or hanging up or missing the phone call'.

    Thanks!

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    It does work, just tested my old application on 6600 and it works like a charm.

    As far as I remember there are no special tricks for this, just use the public API.

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144
    are you excatly sure about this ?

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

    yucca

  8. #8
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    52
    Hi ltomuta!

    Can you give us any code snippet to try or atleast the algorithm/classes used??

    I need to try this out asap.

    It will be a great achievement (First App!!!)

    Thanks!

  9. #9
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    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.

  10. #10
    Regular Contributor
    Join Date
    Sep 2004
    Posts
    52
    void CAnsPhoneCallWatcher::RunL()
    {
    if(iStatus.Int() != KErrNone)
    return;


    switch(iState)
    {
    case EWaiting:
    {

    iLine.NotifyIncomingCall(iStatus, iCallName);
    iState = EAnswering;
    break;
    }
    case EAnswering:
    {
    iLine.GetStatus(iCallStatus);
    if( iCallStatus == RCall::EStatusRinging )
    {
    User::LeaveIfError(iCall.OpenExistingCall(iLine, iCallName));


    iCallLogEngine = CCallLogEngine::NewL(*this, *iCallArray, R_LOG_DIR_IN);

    iLine.NotifyIncomingCall(iStatus, iCallName);
    }
    iState = EAnswering;
    break;
    }
    }
    SetActive();
    }

    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.

  11. #11
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    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

    HTH
    Last edited by ltomuta; 2004-10-29 at 10:15.

  12. #12
    Registered User
    Join Date
    Aug 2004
    Posts
    25
    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

  13. #13
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    Hi,

    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.

    HTH,
    Lucian

  14. #14
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605
    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 .

  15. #15
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    The LogEngine API is available and documented starting with Symbian OS 6.0.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •