×

Discussion Board

Results 1 to 15 of 21

Thread: Dialed Number

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Dialed Number

    Hi all,
    I want to retrieve the numbers i dialed. Don't know how it can be done. Is there any possibility?? If then please show me some way to solve it.

    With thanks & regards,
    Santu

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Dialed Number

    Have you tried searching this forum and wiki. It has been discussed so many times.

  3. #3
    Super Contributor
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803

    Re: Dialed Number

    Regards,
    ivey

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Dialed Number

    I think CTelephony work better than logs really.

  5. #5
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Unhappy Re: Dialed Number

    Hi, symbianyucca

    I have used CTelephony. Mainly i am trying to write all the numbers i dialed in a file.

    CODE:

    #include <f32file.h>
    #include "OutgoingCall.h"

    OutgoingCall::OutgoingCall(): CActive( CActive::EPriorityStandard )
    {
    }

    OutgoingCall::~OutgoingCall()
    {
    Cancel();

    delete iTelephony;
    iTelephony = NULL;
    }

    OutgoingCall* OutgoingCall::NewL()
    {
    OutgoingCall* self = OutgoingCall::NewLC();
    CleanupStack::Pop( self );
    return self;
    }

    OutgoingCall* OutgoingCall::NewLC()
    {
    OutgoingCall* self = new ( ELeave ) OutgoingCall();
    CleanupStack::PushL( self );
    self->ConstructL();
    return self;
    }

    void OutgoingCall::ConstructL()
    {

    CActiveScheduler::Add( this );
    iTelephony = CTelephony::NewL();
    // Initialize with ’unknown’ statuses
    iLineStatus.iStatus = CTelephony::EStatusUnknown;
    iLastInformedLineStatus = CTelephony::EStatusUnknown;
    CTelephony::TCallStatusV1Pckg lineStatusPckg( iLineStatus );
    // Request notification about the changes in voice line status
    iTelephony->NotifyChange( iStatus, CTelephony::EVoiceLineStatusChange, lineStatusPckg );
    SetActive();
    }

    void OutgoingCall::RunL()
    {
    if( iLineStatus.iStatus == CTelephony::EStatusDialling )
    {
    // GetNumber();
    }
    if(iLineStatus.iStatus == CTelephony::EStatusRinging)
    {
    if(iLastInformedLineStatus != CTelephony::EStatusDialling)
    {
    // GetNumber();
    }
    }
    iLastInformedLineStatus = iLineStatus.iStatus;
    }

    void OutgoingCall:oCancel()
    {
    iTelephony->CancelAsync( CTelephony::EVoiceLineStatusChangeCancel );
    }

    void OutgoingCall::GetNumber()
    {
    _LIT(KFileSpec,"c:\\Data\\dialednumber.txt");//File, in which SMS Body will be stored
    TInt pos=0;
    RFs fs;
    fs.Connect();
    RFile file;
    TInt err=file.Replace(fs,KFileSpec,EFileWrite);

    CTelephony::TTelNumber dialnumber;
    CTelephony::TCallInfoV1 callInfoV1;
    CTelephony::TCallInfoV1Pckg callInfoV1Pckg( callInfoV1 );
    CTelephony::TCallSelectionV1 callSelectionV1;
    CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 );
    CTelephony::TRemotePartyInfoV1 remotePartyInfoV1;
    CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg( remotePartyInfoV1 );
    callSelectionV1.iLine = CTelephony::EVoiceLine;
    callSelectionV1.iSelect = CTelephony::EInProgressCall;
    iTelephony->GetCallInfo( callSelectionV1Pckg, callInfoV1Pckg, remotePartyInfoV1Pckg );
    if( remotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable )
    {
    if( remotePartyInfoV1.iRemoteNumber.iTelNumber.Length() > 0 )
    {
    // Incoming call number can be read from
    // remotePartyInfoV1.iRemoteNumber.iTelNumber;
    }
    }
    if( callInfoV1.iDialledParty.iTelNumber.Length() > 0 )
    {
    // Outgoing call number can be read from
    dialnumber = callInfoV1.iDialledParty.iTelNumber;
    TBufC<50> aText(dialnumber);

    HBufC8* SMSContent8 = HBufC8::NewLC(400);

    HBufC* Buf1 = aText.AllocL();
    SMSContent8->Des().Copy(Buf1->Des());

    if(err==KErrNone)
    {
    file.Seek(ESeekEnd,pos);
    file.Write(SMSContent8->Des());
    }
    Buf1 = NULL;
    CleanupStack::PopAndDestroy(1,Buf1);
    }
    file.Close();
    fs.Close();
    }

    But (callInfoV1.iDialledParty.iTelNumber.Length() > 0) is coming false and (remotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable) is coming false. I have added CAPABILITY ReadUserData,WriteUserData,WriteDeviceData and ReadDeviceData in the mmp file. Where i am doing wrong please help me to find it out.

    With regards,
    Santu

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,696

    Re: Dialed Number

    You are giving it up too early: if you do not get remote party information at the first time, you should simply re-issue the NotifyChange+EVoiceLineStatusChange, and sooner or later you will get the info.

  7. #7
    Regular Contributor
    Join Date
    Aug 2007
    Posts
    69

    Re: Dialed Number

    did you solve your final problem on the IF statement returning false?

  8. #8
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Dialed Number

    Quote Originally Posted by santu.paul@gmail.com View Post
    Hi all,
    I want to retrieve the numbers i dialed. Don't know how it can be done. Is there any possibility?? If then please show me some way to solve it.

    With thanks & regards,
    Santu

    Hi Santu,

    use this in your code, hope works
    Code:
    	lineInfo1 = CTelephony::EVoiceLine;
    	iTel->GetLineStatus(lineInfo1,iCallStatusPckg );
    	CTelephony::TCallInfoV1 callInfoV1;
    	CTelephony::TCallSelectionV1 callSelectionV1;
    	CTelephony::TRemotePartyInfoV1 remotePartyInfoV1;
    
    	callSelectionV1.iLine = CTelephony::EVoiceLine;
    	callSelectionV1.iSelect = CTelephony::EInProgressCall;
    	
    	CTelephony::TCallInfoV1Pckg callInfoV1Pckg( callInfoV1 );
    	CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg( remotePartyInfoV1 );
    	CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 );
    	iTel->GetCallInfo( callSelectionV1Pckg, callInfoV1Pckg, remotePartyInfoV1Pckg );
    /////////////////////////////////////////////
    		if (remotePartyInfoV1.iDirection == CTelephony::EMobileTerminated)// Incomin Call
    		{
    			phNumber.Copy(remotePartyInfoV1.iRemoteNumber.iTelNumber);      //for incoming call
    		}
    		else if(remotePartyInfoV1.iDirection == CTelephony::EMobileOriginated)// OutGoing Call
    		{
    			phNumber.Copy(callInfoV1.iDialledParty.iTelNumber);
    		}
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  9. #9
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: Dialed Number

    Hi Amit, your code is not working too. May be i am doing something wrong. I want to know where does all the dialed numbers and missed call numbers are stored. My application should retrieve all those number.

    Can anyone please guide me through this.

    With regards,
    Santu

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Dialed Number

    check logs APIs, Wiki should also have good examples which you could find usefull, so check from there as well.

  11. #11
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Dialed Number

    Quote Originally Posted by santu.paul@gmail.com View Post
    Hi Amit, your code is not working too. May be i am doing something wrong. I want to know where does all the dialed numbers and missed call numbers are stored. My application should retrieve all those number.

    Can anyone please guide me through this.

    With regards,
    Santu
    What is the problem, check error codes.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  12. #12
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Dialed Number

    Quote Originally Posted by santu.paul@gmail.com View Post
    Hi Amit, your code is not working too. May be i am doing something wrong. I want to know where does all the dialed numbers and missed call numbers are stored. My application should retrieve all those number.

    Can anyone please guide me through this.

    With regards,
    Santu
    For your requirement You have to use CLogClient classes, try using wiki as suggested by yucca http://wiki.forum.nokia.com/index.php/Logs_Example

  13. #13
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: Dialed Number

    Hi skumar_rao,

    I changed my code totally.
    CODE:
    #include <aknnotewrappers.h>
    #include <e32base.h>
    #include <logcli.h> // CLogClient
    #include <logview.h> // CLogViewRecent
    #include <logwrap.h> // CLogEvent

    #include "CLogHandler.h"

    /**
    * Constructor. Defines the priority for this active object.
    */
    CLogHandler::CLogHandler() : CActive(EPriorityStandard)
    {
    }

    /**
    * 2nd phase constructor.
    */
    CLogHandler* CLogHandler::NewL()
    {
    CLogHandler* self = CLogHandler::NewLC();
    CleanupStack::Pop(self);
    return self;
    }

    /**
    * 2nd phase constructor.
    */
    CLogHandler* CLogHandler::NewLC()
    {
    CLogHandler* self = new (ELeave) CLogHandler();
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

    /**
    * 2nd phase constructor.
    */
    void CLogHandler::ConstructL()
    {
    User::LeaveIfError(iFs.Connect());

    // Establish connection to log engine
    iLogClient = CLogClient::NewL(iFs);
    iLogViewRecent = CLogViewRecent::NewL(*iLogClient);

    iTask = ESleep; // Default task for RunL

    CActiveScheduler::Add(this);
    }

    /**
    * Destructor.
    */
    CLogHandler::~CLogHandler()
    {
    Cancel();

    delete iLogViewRecent;
    delete iLogClient;

    iFs.Close();
    }

    /**
    * From CActive.
    */
    void CLogHandler::RunL()
    {
    switch (iTask)
    {
    case EGetRecent:
    {
    // Retrieve the event and handle it
    HandleRecentEventL(iLogViewRecent->Event());

    // If there are more events in the log engine database...
    if (iLogViewRecent->NextL(iStatus))
    {
    if (iStatus == KErrNone)
    {
    // ... set active to get the next one
    SetActive();
    }
    }
    else
    {
    // No more events. Go to sleep.
    iTask = ESleep;
    }
    break;
    }

    case ESleep:
    default:
    {
    break;
    }
    }
    }

    /**
    * From CActive.
    */
    TInt CLogHandler::RunError(TInt anError)
    {
    return anError;
    }

    /**
    * From CActive.
    */
    void CLogHandler:oCancel()
    {
    // Cancel the appropriate task
    switch (iTask)
    {
    case EGetRecent:
    {
    iLogViewRecent->Cancel();
    }

    case ESleep:
    default:
    {
    break;
    }
    }
    }

    /**
    * Reads recent events from the main event database
    */
    void CLogHandler::ReadRecentEventsL()
    {
    if (iLogViewRecent->SetRecentListL(KLogNullRecentList, iStatus))
    {

    if (iStatus == KErrNone)
    {
    // If there are events in the log view, set this active object active
    // to get the events from the main event database. See RunL().
    iTask = EGetRecent;
    SetActive();
    }
    }
    else
    {
    _LIT(KTxt, "No recent calls.");
    CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    note->ExecuteLD(KTxt);
    }
    }

    /**
    * Displays a recent event in an information note.
    */
    void CLogHandler::HandleRecentEventL(const CLogEvent& anEvent)
    {
    TBuf<255> buffer;
    _LIT(KTxt, "Description: %S\nNumber: %S");
    buffer.Format(KTxt, &(anEvent.Description()), &(anEvent.Number()));
    CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    note->ExecuteLD(buffer);
    }

    But as i call the the function ReadRecentEventsL, iStatus is not comming KErrNone.

    Not getting where is the wrong. Please help me to find it out.

    With regards,
    Santu

  14. #14
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: Dialed Number

    Hi, It is working fine. I just comment the if condition
    //if (iStatus == KErrNone).

    Now for miss call what i have to do. Please guide me through this.

    With regards,
    Santu Paul

Similar Threads

  1. how to delete dialed number from phone log?
    By topwingo in forum Symbian
    Replies: 4
    Last Post: 2011-02-21, 09:49
  2. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:02
  3. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:01
  4. Hiding/Masking dialed number
    By BarSim in forum Symbian
    Replies: 2
    Last Post: 2005-11-29, 01:27
  5. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52

Posting Permissions

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