×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Not able to read Missed Calls?

    hi all,

    I am not able to read the missed calls, i just want to read the missed call log but i am getting empty string.

    I am using CLogClient, CLogViewRecent and CLogFilter.

    #include <logwrap.h>
    #include <e32test.h>
    #include "MissedCallHandler.h"



    Here is my class.

    CLogViewer* CLogViewer::NewL()
    {
    CLogViewer* logViewer=new(ELeave) CLogViewer();
    CleanupStack::PushL(logViewer);
    logViewer->ConstructL();
    CleanupStack::Pop();
    return logViewer;
    }

    CLogViewer::CLogViewer() : CLogActive(0),iEventNum(0)
    {
    ConstructL();
    }

    void CLogViewer::ConstructL()
    {
    User::LeaveIfError(iFs.Connect());
    iLogClient = CLogClient::NewL(iFs,CActive::EPriorityStandard);
    iRecentLog = CLogViewRecent::NewL(*iLogClient,CActive::EPriorityStandard);
    iLogFilter = CLogFilter::NewL();
    iLogFilter->SetDirection(_L("R_LOG_DIR_MISSED"));
    }

    CLogViewer::~CLogViewer()
    {
    delete iLogFilter;
    delete iRecentLog;
    delete iLogClient;
    iFs.Close();
    }

    void CLogViewer:oRunL()
    {
    //LOG_WRITE("CLogViewer:oRunL()");
    //DumpLog();
    DumpEventL();
    if (iState == 0)
    {
    iState = 1;
    if (iRecentLog->FirstL(iStatus))
    {
    SetActive();
    }
    }
    else if(iRecentLog->NextL(iStatus))
    {
    SetActive();
    }

    }

    TBool CLogViewer:umpLog()
    {
    if (iRecentLog->SetRecentListL(KLogNullRecentList, *iLogFilter, iStatus))
    {
    iState = 0;
    SetActive();
    return ETrue;
    }
    return EFalse;
    }

    void CLogViewer:umpEventL()
    {
    ++iEventNum;
    //LOG_WRITE("-----------------------------------------------");
    //LOG_FORMAT(_L("nEvent Number %d"), iEventNum);
    TLogId id=(iRecentLog->Event()).Id();
    //LOG_FORMAT(_L("ID Num : %d"), id);
    //Event Type
    TUid eventType = (iRecentLog->Event()).EventType();
    //LOG_FORMAT(_L("Event Type : 0x%08x"), eventType.iUid);
    //Remote Party
    _LIT(remoteParty,"Remote Party : %S");
    TBuf<50> party=(iRecentLog->Event()).RemoteParty();
    //LOG_FORMAT(remoteParty,&party);
    //Direction
    TBuf<50> dir=(iRecentLog->Event()).Direction();
    //LOG_FORMAT(_L("Direction : %S"), &dir);
    //Time
    TTime tim;
    TBuf<30> date;
    TBuf<30> time;
    _LIT(dateString,"Date : %D%M%Y%/0%1%/1%2%/2%3%/3");
    _LIT(timeString,"Time : %:0%H%:1%T%:2%S%.%C%:3");
    tim=(iRecentLog->Event()).Time();
    tim.FormatL(date,dateString);
    tim.FormatL(time,timeString);
    //LOG_FORMAT(date,&tim);
    //LOG_FORMAT(time,&tim);
    //Duration Type
    TLogDurationType durationtype=(iRecentLog->Event()).DurationType();
    //LOG_FORMAT(_L("Duration Type : %d"), durationtype);
    //Duration
    TLogDuration dur=(iRecentLog->Event()).Duration();
    //LOG_FORMAT(_L("Duration : %d Secs"), dur);
    //Tel. Num
    dialNum = (iRecentLog->Event()).Number();
    //LOG_FORMAT(_L("Tel. Num: %S"), &dialNum);
    //Status
    TBuf<50> statusDes = iRecentLog->Event().Status();
    //LOG_FORMAT(_L("Status: %S"), &statusDes);
    //flags
    if (KLogEventRead == iRecentLog->Event().Flags())
    {
    //LOG_WRITE("Status: KLogEventRead");
    }
    else if (KLogEventContactSearched == iRecentLog->Event().Flags())
    {
    //LOG_WRITE("Status: KLogEventContactSearched");
    }

    //LOG_FORMAT(_L("Status: %d"), iRecentLog->Event().Flags());
    //
    }



    Thanks.
    Vasant

  2. #2
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Not able to read Missed Calls?

    here is how you get the log contents ( last voice call) missed,received, and dialled.


    **********************************************************

    /* class for retriving the recent log */

    /* vasant patel - 25-11-06 */


    #include "MissedCallRetriever.h"
    #include <aknnotewrappers.h>

    void MissedCallRetriver::ConstructL()
    {
    // Connect to the Log Server
    iFs.Connect();
    iLogClientPtr = CLogClient::NewL(iFs);
    iRecentLogViewPtr = CLogViewRecent::NewL(*iLogClientPtr);
    CActiveScheduler::Add(this);
    }

    MissedCallRetriver::MissedCallRetriver():CActive(EPriorityStandard)
    {

    }

    MissedCallRetriver::~MissedCallRetriver()
    {
    Cancel(); // Causes call to DoCancel()
    }



    void MissedCallRetriver::RunL()
    {

    if( iStatus == KErrNone)
    {

    const CLogEvent& levent = iRecentLogViewPtr->Event();
    iTelNumber.Copy(levent.Number());
    }
    }

    void MissedCallRetriver::ShowL()
    {


    CAknInformationNote *info = new (ELeave) CAknInformationNote;
    info->ExecuteLD(iTelNumber);

    }

    void MissedCallRetriver::GetLastCall()
    {


    if( iRecentLogViewPtr->SetRecentListL(KLogNullRecentList,iStatus))
    {
    // Notify the Log server that we're ready
    SetActive();
    }
    }

    void MissedCallRetriver:oCancel()
    {

    Cancel();
    // Cancel any outstanding requests.
    iRecentLogViewPtr->Cancel();
    }


    void MissedCallRetriver::GetMissedCall(TDes& Number)
    {
    Number.Copy(iTelNumber);
    }

    **********************************************************

    Please note that it retireves the last call , though the name is missed call retriever.

    My requirement was to send the contents to pc as and when any call is attempted, so i set the log observer, which calls my application's notifyL function when there is any change in the log.


    Hope this helps.

    Regards,
    vasant.

Similar Threads

  1. BUG?? Blocking read() calls on InputStreams
    By kbateman in forum Mobile Java Tools & SDKs
    Replies: 8
    Last Post: 2009-01-03, 18:07
  2. marking missed calls as read?
    By ttmyks in forum Symbian
    Replies: 2
    Last Post: 2008-05-30, 16:54
  3. Logcalls transfer from Received Calls to Missed Calls
    By mateen_maldar in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-06-09, 14:03
  4. how to access/show missed calls while j2me app is running on 6230
    By hansprueller in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-12, 06:22
  5. socket read hangs until socket is closed
    By camroe in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-21, 09:44

Posting Permissions

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