×
Namespaces

Variants
Actions

How to get incoming voip call sip uri

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: judith14 (26 Sep 2007)
Last edited: hamishwillee (03 Feb 2012)


The CTelephony class does not work for VoIP calls. So we cannot use NotifyCall and GetCallInfo to get notification and caller number for VoIP calls. The workaround is to use Logengine to get incoming VoIP SIP uri.

The following code snippet should be used and this code snippet can be used for Video calls also.

Headers to be included are

#include <LogCli.h>
#include <LOGWRAP.H>
#include <LogViewChangeObserver.h>
#include <LOGVIEW.H>
#include <eikenv.h>

Link against these libraries

logcli.lib logwrap.lib eikcore.lib

1. Make your class an Active object class by deriving from CActive.

2. Derive your class from MLogViewChangeObserver and give implementations for virtual functions HandleLogViewChangeEventAddedL ,HandleLogViewChangeEventChangedL , HandleLogViewChangeEventDeletedL.

3. Declare following member variables

CLogClient* iClient;
CLogEvent* iLogEvent;
CLogViewEvent* iLogViewEvent;
CLogFilter* iLogFilter;

4. In constructL,

// Create LogClient, Logevent, Logfilter, Logviewevent objects
// using already created session instead of creatinga new one
iClient=CLogClient::NewL(CEikonEnv::Static()->FsSession(),CActive::EPriorityHigh);
iLogEvent=CLogEvent::NewL();
iLogViewEvent = CLogViewEvent::NewL(*iClient,*this);
iLogFilter = CLogFilter::NewL();
 
// Set filter for call type
iLogFilter->SetEventType(KLogCallEventTypeUid);
 
//Set filter for Missed call
TBuf<20> string;
iClient->GetString(string,R_LOG_DIR_MISSED);
iLogFilter->SetDirection(string);
iLogViewEvent->SetFilterL(*iLogFilter,iStatus);
SetActive();

5. HandleLogViewChangeEventAddedL will be called when a logevent (Satisfying the filter criteria) is added to a view.

void CNotifyCall::HandleLogViewChangeEventAddedL(TLogId aId, 
TInt /*aViewIndex*/, TInt /*aChangeIndex*/, TInt /*aTotalChangeCount*/)
{
//Set the incoming id to the logevent
// aId is the Id of the log event which has been added to the view
 
iLogEvent->SetId(aId);
 
//Get the event
iClient->GetEvent(*iLogEvent,iStatus);
SetActive();
}

6. In RunL,

// Number gives the incoming number in case of voice call
TBuf<128> callNameBuf=iLogEvent->Number();
CEikonEnv::InfoWinL(_L("Incoming call Number"),callNameBuf);
 
// Remote party gives the caller voip sip uri
callNameBuf.Copy(iLogEvent->RemoteParty());
CEikonEnv::InfoWinL(_L("Remote party"),callNameBuf);
This page was last modified on 3 February 2012, at 08:36.
33 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×