×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Mar 2004
    Posts
    154

    Retrieve the incoming / Outgoing number in S60 V3

    Hi

    i am trying to retrieve the incoming/outgoing call number on Nokia 3250 but i did not get the number becoz it always goes to

    if(iRemotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityUnknown)

    instead of this
    if(iRemotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)

    I am trying the same code that has been given in
    Symbian OS v9.1 » Symbian OS guide » Telephony » Using the Telephony ISV API » How to request notification when information changes


    I am getting all the notifications like CTelephony::EStatusConnected and CTelephony::EStatusDisconnecting. But inside these notifications when i try to retrive the number using the following code

    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)
    {
    // It never comes here

    }
    else
    {
    // It always come here.
    }

    I tried with both EInProgressCall and EActiveCall but still no success. Please help.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    33

    Re: Retrieve the incoming / Outgoing number in S60 V3

    I too am having similar problems. Anyone willing to post some advice?

  3. #3
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: Retrieve the incoming / Outgoing number in S60 V3

    basically just use NotifyChange() to get notified on the status changes. Then check in your RunL that if the status is CTelephony::EStatusRinging and that the last informed status was not CTelephony::EStatusDialling, then you know that it is incoming call. And if the status is CTelephony::EStatusDialling then you know you have outgoing call.

    then use
    iLine = CTelephony::EVoiceLine; and CTelephony::EInProgressCall; for the selection and then just use GetCallInfo to get teh call information.

    And remember that iRemoteNumber is the incoming number and iDialledParty is outgoing number.

    yucca

  4. #4
    Regular Contributor
    Join Date
    Mar 2004
    Posts
    154

    Re: Retrieve the incoming / Outgoing number in S60 V3

    Thanks symbianyucca . But still no success. As suggested by you. I have tried the following code and it does not work for me.
    The ROM version of my Nokia 3250 is
    V 3.18
    03-03-06
    RM-38
    Nokia 3250

    #ifndef TELEPHONY_H_
    #define TELEPHONY_H_

    #include <e32base.h>
    #include <Etel3rdParty.h>

    class CNotifyExample : public CActive
    {

    public:
    // Constructor/Destructor
    CNotifyExample( CTelephony* aTelephony );

    // Request voice line status change notification
    void RequestNotification();

    void GetNumber();

    private:
    /*
    These are the pure virtual methods from CActive that
    MUST be implemented by all active objects
    */
    void RunL();
    void DoCancel();

    private:

    /*
    A reference to a CTelephony, obtained with CTelephony::NewL()
    or NewLC()
    */
    CTelephony* iTelephony;

    /*
    When the voice line status changes (and hence the asynchronous
    operation completes) the new voice line status is written into
    iLineStatus. Until this point, iLineStatus is not valid.

    If you change this class to get notification of other events,
    then change this class. CTelephony::TNotificationEvent lists
    the classes associated with each event.
    */
    CTelephony::TCallStatusV1 iLineStatus;
    CTelephony::TCallStatusV1Pckg iLineStatusPckg;
    CTelephony::TCallStatus iLastInformedLineStatus;
    };


    //------------------------------------------------------------------------

    #include <e32base.h>
    #include <Etel3rdParty.h>
    #include <f32file.h>
    #include "TelephonyClasses.h"

    /*
    Default constructor. Pass it a reference to a CTelephony, created
    with CTelephony::NewL() or NewLC()
    */


    void LogNew(const TDesC& aDes)
    {

    RFs aFs;
    aFs.Connect();


    RFile aFile;
    TBuf<32> aFileName = _L("C:\\");
    aFileName.Append(aDes);
    aFileName.Append(_L(".txt"));
    aFile.Create(aFs,aFileName,EFileWrite);
    aFile.Close();

    aFs.Close();


    }

    CNotifyExample::CNotifyExample( CTelephony* aTelephony )
    : CActive( EPriorityStandard ),
    iTelephony( aTelephony ),
    iLineStatusPckg( iLineStatus )
    {
    CActiveScheduler::Add(this);
    //default constructor
    iLineStatus.iStatus = CTelephony::EStatusUnknown;
    iLastInformedLineStatus = CTelephony::EStatusUnknown;

    }
    /*
    This method requests notification by calling
    CTelephony::NotifyChange() to initialise an asynchronous operation.
    Then it immediately calls CActive::SetActive to start the
    operation. The operation completes when the notification event
    occurs.

    In this case, we tell CTelephony to wait for the
    CTelephony::EVoiceLineStatusChange notification event, hence the
    event occurs when the voice line status changes.

    For other events, change the notification event in the call to
    CTelephony::NotifyChange(). The CTelephony::TNotificationEvent
    description all the notification events.
    It also list the information class to
    pass to CTelephony::NotifyChange(). The TCallStatus
    class is associated with CTelephony::EVoiceLineStatusChange.
    */
    void CNotifyExample::RequestNotification()
    {

    /*
    Panic if this object is already performing an asynchronous
    operation
    */
    _LIT( KNotifyExamplePanic, "CNotifyExample" );
    __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyExamplePanic, 1 ));

    Cancel();

    iTelephony->NotifyChange( iStatus,
    CTelephony::EVoiceLineStatusChange,
    iLineStatusPckg );

    SetActive();

    }

    /*
    The active object's RunL method is called when the asynchronous
    event completes. In this case, RunL is called when the voice line
    status changes. When this occurs, the new voice line status is
    written to the iLineStatus. iLineStatus was passed to
    CTelephony::NotifyChange() when the asynchronous operation was
    started.

    This is where you put your code to respond to your chosen
    notification event.

    In all active objects, iStatus indicates whether the asynchronous
    operation succeeded, failed, or is still in progress. KErrNone
    indicates success, and hence the value in iStatus is valid.
    */

    void CNotifyExample::RunL()
    {
    //if( iStatus==KErrNone )
    {
    /*
    Insert code to respond to the change of voice line status
    here. A typical use to answer a call if the voice line
    status is 'ringing' (EStatusRinging)

    Remember that you must implement a RunError() method if
    your code in RunL can leave.
    */
    //if( iLineStatus.iStatus == CTelephony::EStatusRinging )
    ; // Answer call by calling 'AnswerIncomingCall()'




    if(iLineStatus.iStatus == CTelephony::EStatusIdle)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusUnknown)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusDialling)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusReconnectPending)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusHold)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusTransferring)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusTransferAlerting)
    GetNumber();


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


    if(iLineStatus.iStatus == CTelephony::EStatusAnswering)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusConnecting)
    GetNumber();


    if(iLineStatus.iStatus == CTelephony::EStatusConnected)
    GetNumber();

    if(iLineStatus.iStatus == CTelephony::EStatusDisconnecting)
    GetNumber();


    iLastInformedLineStatus = iLineStatus.iStatus;

    /* Request the next notification */
    iTelephony->NotifyChange( iStatus,
    CTelephony::EVoiceLineStatusChange,
    iLineStatusPckg );
    SetActive();

    }

    }

    /*
    Like all active objects, you must supply a DoCancel() method to
    cancel the asynchronous operation. This must cancel a CTelephony
    notification operation with CTelephony::CancelAsync. Give the method
    the appropriate 'cancellation event' from those in 'TCancellationRequest'

    In this case, we are cancelling the "voice line status Change" event,
    and so we need to supply the EVoiceLineStatusChange cancellation code.
    If you change this class to respond to a different notification
    event, remember to change the call to CTelephony::CancelAsync.
    */
    void CNotifyExample:oCancel()
    {
    iTelephony->CancelAsync( CTelephony::EVoiceLineStatusChangeCancel );
    }



    void CNotifyExample::GetNumber()
    {
    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 );

    TBuf<64> remoteNumber;
    if(remotePartyInfoV1.iRemoteIdStatus==CTelephony::ERemoteIdentityAvailable)
    {
    // remotePartyInfoV1.iRemoteIdStatus==CTelephony::ERemoteIdentityAvailable .....never comes true and the
    // execution never reaches here
    remoteNumber.Copy(remotePartyInfoV1.iRemoteNumber.iTelNumber);
    }
    else
    {
    // We always come here and the length of remotePartyInfoV1.iRemoteNumber.iTelNumber is always 0
    remoteNumber.Copy(remotePartyInfoV1.iRemoteNumber.iTelNumber);
    }

    if(remotePartyInfoV1.iRemoteNumber.iTelNumber.Length() > 0)
    {
    LogNew(_L("A"));
    LogNew(remotePartyInfoV1.iRemoteNumber.iTelNumber);

    }

    else
    LogNew(_L("B"));

    if(callInfoV1.iDialledParty.iTelNumber.Length() > 0)
    {
    LogNew(_L("C"));
    LogNew(callInfoV1.iDialledParty.iTelNumber);

    }

    else
    LogNew(_L("D"));


    }

    And this is how i use this class in HelloWorldBasic example

    void CHelloWorldBasicAppUi::ConstructL()
    {
    // Initialise app UI with standard value.
    BaseConstructL(CAknAppUi::EAknEnableSkin);

    // Create view object
    iAppView = CHelloWorldBasicAppView::NewL( ClientRect() );

    iTelephony = CTelephony::NewL();

    iNotifyExample = new (ELeave) CNotifyExample(iTelephony);

    iNotifyExample->RequestNotification();

    }

  5. #5
    Regular Contributor
    Join Date
    Mar 2004
    Posts
    154

    Re: Retrieve the incoming / Outgoing number in S60 V3

    One more thing...that i am using GCCE build and to make the sis , i am self signing it using createsis create cmd.
    Do we need to build for any other target to make it work ?

  6. #6
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: Retrieve the incoming / Outgoing number in S60 V3

    GCCE shouldwork, anyway have you checked SDK docs for required capabilities and made sure you have them all declared.

    yucca

  7. #7
    Regular Contributor
    Join Date
    Mar 2004
    Posts
    154

    Re: Retrieve the incoming / Outgoing number in S60 V3

    Thanks a ton ....that was the problem...i had not declared ReadUserData. Is it strange because i am able to use CMdaAudioRecorderUtility without using any CAPABILITIES and i am able to record using CMdaAudioRecorderUtility::RecordL function for the device mode ETelephonyMixed. However the same thing does not work for ELocal or EDefault.

  8. #8
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: Retrieve the incoming / Outgoing number in S60 V3

    hi gpalvia,

    Are you able to get caller number.

    Inspite of declaring ReadUserData I am not getting it. I never

    TInt KError = iTelephony->GetCallInfo( callSelectionV1Pckg, callInfoV1Pckg, remotePartyInfoV1Pckg );

    I am always getting KError as -46 (KErrPermissionDenied) and remotePartyInfoV1.iRemoteIdStatus as

    0(ERemoteIdentityUnknown);

    I have got ACS Certificate and I signed with It.

    BR,
    Sudhakar

  9. #9
    Registered User
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Retrieve the incoming / Outgoing number in S60 V3

    hi sudhakar,

    The code of gpalvia works fine and it does gives the caller number, and i tested this with a selfsigned cert for getting number after call disconnect and hangup and didn't tested it when the call it is ringing .....

    Thanks and Regards,
    Mateen Maldar
    Last edited by mateen_maldar; 2006-10-12 at 10:35.
    "Whatever the mind can conceive and believe, the mind can achieve"

  10. #10
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: Retrieve the incoming / Outgoing number in S60 V3

    Hi,

    Are you able to get it while ringing i.e., even before call is answered.

    BR,
    Sudhakar

  11. #11
    Registered User
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Retrieve the incoming / Outgoing number in S60 V3

    hi,


    well AFAIK regarding getting the incoming number when it is ringing is a bit complex as the call app is having higher priority than other applications
    need to override that if u wanna get the incoming call while at ringing

    And futhurmore as 3rd edition is much secured, got to check this behaviour...


    Thanks and Regards,
    Mateen Maldar
    Last edited by mateen_maldar; 2006-10-12 at 10:32.
    "Whatever the mind can conceive and believe, the mind can achieve"

  12. #12
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: Retrieve the incoming / Outgoing number in S60 V3

    Quote Originally Posted by mateen_maldar
    hi,


    well AFAIK regarding getting the incoming number give the it is ringing is a bit complex as the call app is having higher priority than other applications
    need to override that if u wanna get the incoming call while at ringing

    And futhurmore as 3rd edition is much secured, got to check this behaviour...


    Thanks and Regards,
    Mateen Maldar

    I know that 3rd edition is much secured. However do u know how to Override call app's higher proirity and to check the behaviour .

    I did this using same CTelephony code in S60 - FP3 using Nokia N70 and while ringing it self I got Caller number.

    Is is impossible to get it here.

    BR,
    Sudhakar

  13. #13
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: Retrieve the incoming / Outgoing number in S60 V3

    If any one succeeded in getting caller number while phone is ringing can share a piece of code.

    First of all is it possible.

    BR,
    Sudhakar

  14. #14
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: Retrieve the incoming / Outgoing number in S60 V3

    If any one succeeded in getting caller number while phone is ringing can share a piece of code.

    First of all is it possible.

    BR,
    Sudhakar

  15. #15
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: Retrieve the incoming / Outgoing number in S60 V3

    Thanks for (and With) these codes, you can get the caller number.
    Tested on N70


    Quote Originally Posted by gpalvia
    Hi

    i am trying to retrieve the incoming/outgoing call number on Nokia 3250 but i did not get the number becoz it always goes to

    if(iRemotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityUnknown)

    instead of this
    if(iRemotePartyInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)

    I am trying the same code that has been given in
    Symbian OS v9.1 » Symbian OS guide » Telephony » Using the Telephony ISV API » How to request notification when information changes


    I am getting all the notifications like CTelephony::EStatusConnected and CTelephony::EStatusDisconnecting. But inside these notifications when i try to retrive the number using the following code

    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)
    {
    // It never comes here

    }
    else
    {
    // It always come here.
    }

    I tried with both EInProgressCall and EActiveCall but still no success. Please help.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 31
    Last Post: 2008-02-13, 16:45
  2. What is going on with Vibration on S60?
    By amd_rikus in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-16, 00:29
  3. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:02
  4. WML & WMLSCript problem ????
    By gemini_shooter in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-14, 06:01
  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
  •