×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Call History Log - Help

    Hi,

    I want to add an event in the call history log after every incoming call. I use the required classes like CLogClient, CLogViewEvent, CLogEvent etc. to update the log file. I am able to add an event but, everytime I encounter one crash or the other. Can anyone provide sample code which correctly adds an event to the call history log?

    Thanks,
    ==dn==

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    30
    Why do you want to add an event after an incoming call, as it is added for you? Do you mean you need to generate some events so you can use the log api's in debug mode?

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50
    I want to give more info to the user about the incoming call.

    Thanks,
    ==dn==

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    30
    Well to do this you do not need to add any events yourself, that is taken care for you. If you want to show the user info regarding more than just one event you should probably think of retrieving these calls and storing them in an array or database...

    So you need to create a class derived from CActive and in the ConstructL function you would have something like this

    Code:
    void CLogEngine::ConstructL()
    	{
    	// Get the file server session owned by control environment
    	RFs& fsSession = CCoeEnv::Static()->FsSession();
    
    	// create the log engine, a view of the logengine, a filter
    	iLogClient = CLogClient::NewL(fsSession);
    	iLogView = CLogViewEvent::NewL(*iLogClient);
    	iLogFilter = CLogFilter::NewL();
    
    	// Add to the active scheduler
    	CActiveScheduler::Add(this);
    
    	FillDataBaseL();
    Code:
    void CLogEngine::FillDataBaseL()
    	{
    	
    	TBool eventsInView = iLogView->SetFilterL(*iLogFilter, iStatus);
    	
    	if (eventsInView)
    		{
    		
    		SetActive();
    		}
    	else
                         ...//whatever you want to do here // 
                        }
    Then when the request has been dealt with you should do something in your runL() that would add these to an database or somewhere...

    Code:
    const CLogEvent& event = iLogView->Event();
    			iEventDataBase.AddEntryL(event);
    			
    			// Are there any more entries
    			if (iLogView->NextL(iStatus))
    				{
    				// if there is another entry, issue the request
    				// to move to the next entry.
    				SetActive();
    				}
    There won't be any events in the view if you are testing this on the emulator so you need to use AddEvent etc

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    30
    sorry if you are just talking about calls you should set the filter in the ConstructL function like so ..

    iLogFilter->SetEventType(KLogCallEventTypeUid);

  6. #6
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50
    Thanks for the sample code. I will work on this suggestion.

  7. #7
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50
    Hi JJ,

    I have used similar to your sample code AddEntriesL() found in this forum:
    CLogEvent* logEvent = CLogEvent::NewL();
    logEvent->SetEventType(KLogCallEventTypeUid);
    logEvent->SetDurationType(KLogDurationValid);
    logEvent->SetDirection(_L("Missed call"));
    logEvent->SetDuration(10000);
    logEvent->SetNumber(_L("9880060891"));
    iLogClient->AddEvent(*logEvent, iStatus);

    It just crashes the device. Any suggestions?

    ==dn==

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    30
    Hmm, I just tested your code and it works fine for me...
    Does it crash on iLogClient->AddEvent....

    I had another class for creating the events where I passed the log client as an argument..
    So in my first CActive class, the one from earlier you have..

    CCreateEntry::NewL(*iLogClient, iStatus);

    Then the constructor for the second cactive class looks something like this
    Code:
    CCreateEntry::CCreateEntry(CLogClient& aLogClient, TRequestStatus& aObserverRequestStatus)
    	:CActive(CActive::EPriorityStandard), iLogClient(aLogClient), iObserverRequestStatus(aObserverRequestStatus)
    	{
    	}
    so you are calling iLogClient.AddEvent(*logEvent, iStatus);

    But i do not know why you cannot do it like you are..

  9. #9
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50
    JJ, thanks for your help. Now, I am able to add events. But, when I add SetDescription or SetSubject, I do not see them on the device. The device only shows, the Direction, Type and the Number. I am not able to see any settings to add Subject or Description fields. Anything else to be done in order to view the Subject or Description?

    Thanks,
    ==dn==

  10. #10
    Registered User
    Join Date
    Jan 2005
    Posts
    30
    Ive had trouble setting the Time before where it appears to be set ok, but when i call myEvent.Time() it gives me the HomeTime() value. Sounds like you may be having the same problem except with subject. But as far as I know you cannot set the description, it is set for you by the log engine

    update
    *doesnt look like you can set the description...

    http://www.cs.tut.fi/~mobo/Symbianv6...aSubject%28%29
    Last edited by javajim; 2005-03-18 at 15:16.

Posting Permissions

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