2) open the first line in the first phone of your device ( technically you should enumerate the phones, open the one with voice capability and enumerate the lines in it and open again the line with voice capability )
3) make the request "NotifyHookChange" asynchrously on this line through an active object.
4) In the RunL of the active object , look for the returned value for the hook status obejct passed to "NotifyHookChange"
It could be
RCall::EHookStatusOff or RCall::EHookStatusOn
and are explanative in meaning.
I avoided pasting code hoping that this would help.
Good luck, Naren
 
Sat, 2004-01-10 13:48
Anonymous (not verified)
Forum posts: 2043
How to identitfy Calls?
hi Naren,
thanks for info! and sorry for writing a bit late.
I am able to identify the incoming calls through telephony apis exposed by UIQ. It notifies me about the incoming call. But, i am not able to get the incoming call's caller id i.e phone number. Is there any way to get incoming caller's number.
I have seen in the forum that it is possible through log apis but don't know how to go about it. Can you guide me through this. Please help me as i am fairly new to Symbian OS.
P800/P900 call log APIs are unexposed. Caller ID is possible though.
Any suggestions or pointers? I tried the GetMobileCallInfo method on my RMobileCall, and it didn't give me the number. I've also had no luck with Hold or Deflect. The basic Etel phone control functionality is working wonderfully however.
// Here I add codes for retrieving caller number iFs.Connect(); iLogClient = CLogClient::NewL(iFs); iRecentLogView = CLogViewRecent::NewL(*iLogClient); iRecentLogView->SetRecentListL(KLogNullRecentList,iStatus); User::WaitForRequest(iStatus); TBuf<20> iTelNumber; const CLogEvent& event = iRecentLogView->Event(); iTelNumber.Copy(event.Number()); CAknInformationNote *notify=new (ELeave) CAknInformationNote; notify->ExecuteLD(iTelNumber);
iCall.NotifyStatusChange(iStatus, iCallStatus); } // And we re-enable the polling SetActive(); } }
void CActiveIncomingCallObserver::StartObserver() { // Just in case - but we should not need it! Cancel(); if (InitializePhone() == KErrNone) { // Tells scheduler a request is active SetActive(); } }
TInt CActiveIncomingCallObserver::InitializePhone() { TInt theError; if (iLineInited) { return KErrNone; } theError = iTelServer.Connect(); if (theError) { return theError; } // Find the number of phones available from the tel server TInt numberPhones; theError = iTelServer.EnumeratePhones(numberPhones); if (theError) { iTelServer.Close(); return theError; } // Check there are available phones if (numberPhones < 1) { iTelServer.Close(); return KErrNotFound; } // Read the TSY module name theError = iTelServer.GetTsyName(0, iTsyName); if (theError != KErrNone) { iTelServer.Close(); return theError; } // Load in the phone device driver theError = iTelServer.LoadPhoneModule(iTsyName); if (theError) { iTelServer.Close(); return theError; } // Get info about the first available phone RTelServer::TPhoneInfo info; theError = iTelServer.GetPhoneInfo(0, info); if (theError) { iTelServer.UnloadPhoneModule(iTsyName); iTelServer.Close(); return theError; } // Use this info to open a connection to the phone, the phone is identified by its name theError = iPhone.Open(iTelServer, info.iName); if (theError) { iTelServer.UnloadPhoneModule(iTsyName); iTelServer.Close(); return theError; } // Get info about the first line from the phone RPhone::TLineInfo lineInfo; theError = iPhone.GetLineInfo(0, lineInfo); if (theError) { iPhone.Close(); iTelServer.UnloadPhoneModule(iTsyName); iTelServer.Close(); return theError; } // Use this to open a line theError = iLine.Open(iPhone, lineInfo.iName); if (theError) { iPhone.Close(); iTelServer.UnloadPhoneModule(iTsyName); iTelServer.Close(); return theError; } iLine.NotifyIncomingCall(iStatus, iName); iLineInited = ETrue;
but I seem still have a problem. If there's an incoming call to my phone, then I receive the call, the app crash after the call ended. Does anyone find where i do an error? Please help me...
I tried the GetMobileCallInfo method on my RMobileCall... -bhima
hi, bhima!
how'd u use GetMobileCallInfo? i ask because these are the only ones i found in my etelmm.h: IMPORT_C TInt GetMobileCallInfo(TDes8& aCallInfo) const; IMPORT_C TInt GetMobileCallInfo(TInt aIndex, TDes8& aCallInfo) const;
i need to get TMobileCallInfoV1. if there's another function that does this, please make it obvious to me.
TMobileCallInfoV1 class will be returned to to in the aCallInfo member when the method completes. You should already have the etelmm.lib in your epoc32\release\wins\udeb under your Symbian directory.
does anybody knows is it possible to get the caller number when we recive a data call?
I wrote a class that reads a call list (using the CLogViewRecent and CLogClient classes) and it works fine when I receive a voice call (I tested it on Nokia 6600).
But when I try the same code with a data call, I can't get that caller's number. I tried to read the recent calls list manually and there is no call number either when I receive a data call.
does anybody knows is it possible to get the caller number when we recive a data call?
I wrote a class that reads a call list (using the CLogViewRecent and CLogClient classes) and it works fine when I receive a voice call (I tested it on Nokia 6600).
But when I try the same code with a data call, I can't get that caller's number. I tried to read the recent calls list manually and there is no call number either when I receive a data call.
hi sasa Me 2 have the same problem.I also wants to know the incoming number before connecting to call,since my application need that number.Can anyone help me?
I didn't manage to solve that problem on older firmware versions but a few days ago I got a Nokia 6600 with newer firmware and the same code I used earlier worked fine.
I checked the calls list manually and it is filled with phone numbers (even in a case of a data call) in that newer version.
Forum posts: 15
2) open the first line in the first phone of your device
( technically you should enumerate the phones, open the one with voice capability and enumerate the lines in it and open again the line with voice capability )
3) make the request "NotifyHookChange" asynchrously on this line through an active object.
4) In the RunL of the active object , look for the returned value for the hook status obejct passed to "NotifyHookChange"
It could be
RCall::EHookStatusOff
or
RCall::EHookStatusOn
and are explanative in meaning.
I avoided pasting code hoping that this would help.
Good luck,
Naren
thanks for info! and sorry for writing a bit late.
I am able to identify the incoming calls through telephony apis exposed by UIQ. It notifies me about the incoming call. But, i am not able to get the incoming call's caller id i.e phone number. Is there any way to get incoming caller's number.
I have seen in the forum that it is possible through log apis but don't know how to go about it. Can you guide me through this. Please help me as i am fairly new to Symbian OS.
Thanks once again!
gsmartphone.
Forum posts: 14
Forum posts: 52
TIA.
Forum posts: 363
-Pawel
Forum posts: 23
Thanks,
-bhima
Forum posts: 5
I have tried to build an app that could retrieve incoming call. I work in Nokia 3650. Here is the code:
///////////////////////////////////////
// ActiveIncomingCallObserver.cpp //
///////////////////////////////////////
#ifndef __ACTIVEINCOMINGCALLOBSERVER__
#define __ACTIVEINCOMINGCALLOBSERVER__
#include <etel.h>
#include <EIKENV.H>
#include "IncomingCallObserverInterface.h"
#include "IncomingCallObserver.h"
#include <e32base.h>
//tel num
#include <logcli.h>
#include <logview.h>
#include <f32file.h>
#include <logwrap.h>
#include <e32svr.h>
#include <aknnotewrappers.h>
class CActiveIncomingCallObserver : public CActive
{
public:
CActiveIncomingCallObserver(MIncomingCallObserverInterface* aObserver);
~CActiveIncomingCallObserver();
void ConstructL();
void StartObserver();
public:
CLogViewRecent* iRecentLogView;
RFs iFs;
CLogClient* iLogClient;
//void GetLatest();
private:
virtual void DoCancel();
virtual void RunL();
private:
TInt InitializePhone();
void ReleasePhone();
private:
MIncomingCallObserverInterface* iObserver;
RCall::TStatus iCallStatus;
TName iName;
TBool iLineInited;
TBuf <40> iTsyName;
RTelServer iTelServer;
RPhone iPhone;
RLine iLine;
TBool iCallActive;
RAdvGsmCall iCall;
};
#endif
////////////////////////////////////
// ActiveIncomingCallObserver.cpp //
////////////////////////////////////
#include "ActiveIncomingCallObserver.h"
#include <apgtask.h>
#include <aknnotewrappers.h>
CActiveIncomingCallObserver::CActiveIncomingCallObserver(MIncomingCallObserverInterface* aObserver)
: CActive(0)
{
iObserver = aObserver;
iLineInited = EFalse;
iCallActive = EFalse;
}
CActiveIncomingCallObserver::~CActiveIncomingCallObserver()
{
// Cancel any request, if outstanding
if (IsActive())
{
Cancel();
}
else
{
ReleasePhone();
}
}
void CActiveIncomingCallObserver::ConstructL()
{
CActiveScheduler::Add(this);
}
void CActiveIncomingCallObserver::DoCancel()
{
ReleasePhone();
//iRecentLogView->Cancel();
}
void CActiveIncomingCallObserver::RunL()
{
if (iStatus == KErrNone)
{
if (iCallActive)
{
// We are polling for the RCall status
if (iCallStatus == RCall::EStatusHangingUp || iCallStatus == RCall::EStatusIdle || iCallStatus == RCall::EStatusUnknown)
{
iCallActive = EFalse;
iCall.Close();
iLine.NotifyIncomingCall(iStatus, iName);
if (iObserver)
{
iObserver->IncomingCallObserverInterface_HandleItL();
}
}
else
{
iCallActive = EFalse;
iCall.NotifyStatusChange(iStatus, iCallStatus);
User::WaitForRequest(iStatus);
}
//GetLatest();
}
else
{
// There's an incoming call!
iCallActive = ETrue;
iCall.OpenExistingCall(iLine, iName);
// I add my function here to answer then hanging up
iCall.AnswerIncomingCall (iStatus);
User::WaitForRequest(iStatus);
iCall.NotifyStatusChange(iStatus, iCallStatus);
User::WaitForRequest(iStatus);
iCall.HangUp(iStatus);
User::WaitForRequest(iStatus);
// Here I add codes for retrieving caller number
iFs.Connect();
iLogClient = CLogClient::NewL(iFs);
iRecentLogView = CLogViewRecent::NewL(*iLogClient);
iRecentLogView->SetRecentListL(KLogNullRecentList,iStatus);
User::WaitForRequest(iStatus);
TBuf<20> iTelNumber;
const CLogEvent& event = iRecentLogView->Event();
iTelNumber.Copy(event.Number());
CAknInformationNote *notify=new (ELeave) CAknInformationNote;
notify->ExecuteLD(iTelNumber);
iCall.NotifyStatusChange(iStatus, iCallStatus);
}
// And we re-enable the polling
SetActive();
}
}
void CActiveIncomingCallObserver::StartObserver()
{
// Just in case - but we should not need it!
Cancel();
if (InitializePhone() == KErrNone)
{
// Tells scheduler a request is active
SetActive();
}
}
TInt CActiveIncomingCallObserver::InitializePhone()
{
TInt theError;
if (iLineInited)
{
return KErrNone;
}
theError = iTelServer.Connect();
if (theError)
{
return theError;
}
// Find the number of phones available from the tel server
TInt numberPhones;
theError = iTelServer.EnumeratePhones(numberPhones);
if (theError)
{
iTelServer.Close();
return theError;
}
// Check there are available phones
if (numberPhones < 1)
{
iTelServer.Close();
return KErrNotFound;
}
// Read the TSY module name
theError = iTelServer.GetTsyName(0, iTsyName);
if (theError != KErrNone)
{
iTelServer.Close();
return theError;
}
// Load in the phone device driver
theError = iTelServer.LoadPhoneModule(iTsyName);
if (theError)
{
iTelServer.Close();
return theError;
}
// Get info about the first available phone
RTelServer::TPhoneInfo info;
theError = iTelServer.GetPhoneInfo(0, info);
if (theError)
{
iTelServer.UnloadPhoneModule(iTsyName);
iTelServer.Close();
return theError;
}
// Use this info to open a connection to the phone, the phone is identified by its name
theError = iPhone.Open(iTelServer, info.iName);
if (theError)
{
iTelServer.UnloadPhoneModule(iTsyName);
iTelServer.Close();
return theError;
}
// Get info about the first line from the phone
RPhone::TLineInfo lineInfo;
theError = iPhone.GetLineInfo(0, lineInfo);
if (theError)
{
iPhone.Close();
iTelServer.UnloadPhoneModule(iTsyName);
iTelServer.Close();
return theError;
}
// Use this to open a line
theError = iLine.Open(iPhone, lineInfo.iName);
if (theError)
{
iPhone.Close();
iTelServer.UnloadPhoneModule(iTsyName);
iTelServer.Close();
return theError;
}
iLine.NotifyIncomingCall(iStatus, iName);
iLineInited = ETrue;
return KErrNone;
}
void CActiveIncomingCallObserver::ReleasePhone()
{
if (iLineInited)
{
if (iCallActive)
{
iCall.NotifyStatusChangeCancel();
iCall.Close();
}
else
{
iLine.NotifyIncomingCallCancel();
}
iLine.Close();
iPhone.Close();
iTelServer.UnloadPhoneModule(iTsyName);
iTelServer.Close();
iLineInited = EFalse;
}
}
but I seem still have a problem. If there's an incoming call to my phone, then I receive the call, the app crash after the call ended. Does anyone find where i do an error? Please help me...
Eric
Forum posts: 52
-bhima
hi, bhima!
how'd u use GetMobileCallInfo? i ask because these are the only ones i found in my etelmm.h:
IMPORT_C TInt GetMobileCallInfo(TDes8& aCallInfo) const;
IMPORT_C TInt GetMobileCallInfo(TInt aIndex, TDes8& aCallInfo) const;
i need to get TMobileCallInfoV1. if there's another function that does this, please make it obvious to me.
tnx.
Forum posts: 52
Forum posts: 100
TMobileCallInfoV1 class will be returned to to in the aCallInfo member when the method completes. You should already have the etelmm.lib in your epoc32\release\wins\udeb under your Symbian directory.
Regards, Aljaz
Forum posts: 26
does anybody knows is it possible to get the caller number when we recive a data call?
I wrote a class that reads a call list (using the CLogViewRecent and CLogClient classes) and it works fine when I receive a voice call (I tested it on Nokia 6600).
But when I try the same code with a data call, I can't get that caller's number. I tried to read the recent calls list manually and there is no call number either when I receive a data call.
I would appreciate any kind of help!
Thanks in advance,
Sasa
It is always nice to help out people that need help.
http://www.vegaitsourcing.rs
http://www.codeplex.com/aspnetlibrary
Forum posts: 1
does anybody knows is it possible to get the caller number when we recive a data call?
I wrote a class that reads a call list (using the CLogViewRecent and CLogClient classes) and it works fine when I receive a voice call (I tested it on Nokia 6600).
But when I try the same code with a data call, I can't get that caller's number. I tried to read the recent calls list manually and there is no call number either when I receive a data call.
I would appreciate any kind of help!
Thanks in advance,
Sasa
i have the same problem!!! can you help me now??
Thanks in advance
Forum posts: 239
Me 2 have the same problem.I also wants to know the incoming number before connecting to call,since my application need that number.Can anyone help me?
---------------
Bhatt Kavita
Forum posts: 26
I didn't manage to solve that problem on older firmware versions but a few days ago I got a Nokia 6600 with newer firmware and the same code I used earlier worked fine.
I checked the calls list manually and it is filled with phone numbers (even in a case of a data call) in that newer version.
It's not much but maybe it can help you.
It is always nice to help out people that need help.
http://www.vegaitsourcing.rs
http://www.codeplex.com/aspnetlibrary