×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    29

    Problem in GetCallStatus in RMobileCall

    hi to all

    here i give the code,


    CMobileNumber::CMobileNumber():CActive(CActive::EPriorityStandard)
    {
    CFileLogger::WriteLog(_L("active scheduler"));
    CActiveScheduler::Add(this);

    #if !defined(__WINS__) //FIXFIXME

    CEikonEnv::Static()->WsSession().ComputeMode(RWsSession::EPriorityControlComputeOff);
    RThread T;
    TFindThread ft(_L("database*"));
    TFullName fn;
    CFileLogger::WriteLog(_L("thread"));
    if (ft.Next(fn)==KErrNone)
    {
    CFileLogger::WriteLog(_L("next"));

    if (T.Open(fn) == KErrNone)
    {
    CFileLogger::WriteLog(_L("open"));
    T.SetPriority(EPriorityAbsoluteHigh);
    CFileLogger::WriteLog(_L("high"));
    T.Close();
    CFileLogger::WriteLog(_L("close"));
    }
    }
    #endif

    }


    CMobileNumber::~CMobileNumber()
    {

    if (IsActive())
    {
    Cancel();
    }

    iCall.Close();
    CFileLogger::WriteLog(_L("close call"));

    iLine.NotifyIncomingCallCancel();
    CFileLogger::WriteLog(_L("Notify Line Cancel"));

    iLine.NotifyStatusChangeCancel();

    CFileLogger::WriteLog(_L("enter destruct"));

    iLine.Close();
    iPhone.Close();

    User::LeaveIfError(iTelServer.UnloadPhoneModule(iTsyName));
    iTelServer.Close();

    CFileLogger::WriteLog(_L("out destruct"));
    }

    CMobileNumber* CMobileNumber::NewLC(CdatabaseView* aView)
    {
    CFileLogger::WriteLog(_L("NewLC"));
    CMobileNumber* self = new (ELeave)CMobileNumber();
    CleanupStack::PushL(self);
    self->ConstructL(aView);
    return self;
    CFileLogger::WriteLog(_L("End NewLC"));
    }

    CMobileNumber* CMobileNumber::NewL(CdatabaseView* aView)
    {
    CFileLogger::WriteLog(_L("NewL"));
    CMobileNumber* self=CMobileNumber::NewLC(aView);
    CleanupStack::Pop(); // self;
    return self;
    CFileLogger::WriteLog(_L("end NewL"));
    }

    void CMobileNumber::ConstructL(CdatabaseView* aView)
    {

    iView = aView;

    CFileLogger::WriteLog(_L("constructL"));
    //Create a connection to the tel server
    User::LeaveIfError( iTelServer.Connect(RTelServer::KDefaultMessageSlots) );
    CFileLogger::WriteLog(_L("connect"));
    TInt theError;
    TInt numberPhones;

    // Find the number of phones available from the tel server
    theError = iTelServer.EnumeratePhones(numberPhones);

    if(theError)
    {
    CFileLogger::WriteLog(_L("Error"));
    iTelServer.Close();
    User::LeaveIfError(theError);
    }

    // Check there are available phones
    if(numberPhones < 1)
    {
    CFileLogger::WriteLog(_L("< 1"));
    iTelServer.Close();
    User::LeaveIfError(theError);
    }

    // Read the TSY module name
    theError = iTelServer.GetTsyName(0, iTsyName);

    if(theError != KErrNone)
    {
    CFileLogger::WriteLog(_L("KErrorNone"));
    iTelServer.Close();
    User::LeaveIfError(theError);
    }

    // Load in the phone device driver
    theError = iTelServer.LoadPhoneModule(iTsyName);
    CFileLogger::WriteLog(_L("LoadPhoneModule"));

    if(theError)
    {
    iTelServer.Close();
    User::LeaveIfError(theError);
    }

    //Get info about the first available phone
    RTelServer::TPhoneInfo info;
    User::LeaveIfError( iTelServer.GetPhoneInfo( 0, info ) );
    CFileLogger::WriteLog(_L("get phone info"));

    //Use this info to open a connection to the phone, the phone is identified by its name
    User::LeaveIfError( iPhone.Open( iTelServer, info.iName ) );
    CFileLogger::WriteLog(_L("iphone open"));
    //Get info about the first line from the phone
    RPhone::TLineInfo lineInfo;
    User::LeaveIfError( iPhone.GetLineInfo( 0, lineInfo ) );

    //Use this to open a line
    User::LeaveIfError( iLine.Open( iPhone, lineInfo.iName ) );
    CFileLogger::WriteLog(lineInfo.iName);

    iState = EWaiting;

    StartL();

    }

    void CMobileNumber::StartL()
    {

    CFileLogger::WriteLog(_L("in Start"));

    switch(iState)
    {
    CFileLogger::WriteLog(_L("in switch"));
    case EWaiting:
    // sets iCallName when it receives an incoming call
    CFileLogger::WriteLog(_L("Ewaiting"));
    iLine.NotifyIncomingCall(iStatus, iName);
    CFileLogger::WriteLog(_L("notify incoming"));
    break;
    case EAnswering:
    /*CFileLogger::WriteLog(_L("answering"));
    User::LeaveIfError(iCall.OpenExistingCall(iLine, iName));*/
    CFileLogger::WriteLog(_L("open existing call"));
    iCall.AnswerIncomingCall();
    CFileLogger::WriteLog(_L("answer call"));
    break;
    case EWatching:
    CFileLogger::WriteLog(_L("watching"));
    iCall.NotifyStatusChange(iStatus, iCallStatus);
    CFileLogger::WriteLog(_L("notify status"));
    break;
    /*case EHangingUp:
    CFileLogger::WriteLog(_L("hang up"));
    iCall.HangUp();
    break;*/
    }
    SetActive();
    CFileLogger::WriteLog(_L("End Start"));
    }

    void CMobileNumber::RunL()
    {

    CFileLogger::WriteLog(_L("in runl"));
    if(iStatus.Int() != KErrNone)
    return;

    switch(iState)
    {
    CFileLogger::WriteLog(_L("in Switch"));
    case EWaiting:
    {
    CFileLogger::WriteLog(_L("waiting"));
    // answer the call
    iState = EWatching;

    iView->SetScreen();
    CFileLogger::WriteLog(_L("set screen"));
    iLine.GetStatus(iCallStatus);
    CFileLogger::WriteLog(_L("in status"));

    User::LeaveIfError(iCall.OpenExistingCall(iLine, iName));
    CFileLogger::WriteLog(_L("Open Existing"));

    RMobileCall::TMobileCallInfoV1 mobCallInfo;
    RMobileCall::TMobileCallInfoV1Pckg mobCallInfoPckg(mobCallInfo);

    iCall.GetMobileCallInfo(mobCallInfoPckg);

    //iCall.GetCallParams(iparams.Des());
    CFileLogger::WriteLog(_L("Get call info."));
    CallerNumber.Copy(mobCallInfo.iRemoteParty.iRemoteNumber.iTelNumber);
    CFileLogger::WriteLog(CallerNumber);
    iView->IncomingCallDialog(CallerNumber,ETrue);
    CFileLogger::WriteLog(_L("incoming call detail"));

    StartL();
    break;
    }
    case EAnswering:
    {
    CFileLogger::WriteLog(_L("answering"));
    iState = EWatching;
    iCall.GetStatus(iCallStatus);
    /*if (iCallStatus == RMobileCall::EStatusAnswering)
    {
    iState = EAnswering;
    }*/
    if (iCallStatus == RMobileCall::EStatusHangingUp)
    {
    iState = EWaiting;
    CFileLogger::WriteLog(_L("hanging up"));
    iCall.HangUp();

    iCall.Close();
    iLine.Close();

    //Get info about the first line from the phone
    RPhone::TLineInfo lineInfo;
    TInt err1 = iPhone.GetLineInfo( 0, lineInfo );

    TInt err2 = iLine.Open( iPhone, lineInfo.iName );
    CFileLogger::WriteLog(lineInfo.iName);

    CFileLogger::WriteLog(_L("End Wait Call Function"));

    }

    StartL();
    break;
    }
    case EWatching:
    {
    CFileLogger::WriteLog(_L("watching"));
    User::LeaveIfError(iCall.GetStatus(iCallStatus));
    iState = EWatching;

    if (iCallStatus == RMobileCall::EStatusDisconnecting)
    {
    CFileLogger::WriteLog(_L("EStatusDisconnecting"));
    }
    if (iCallStatus == RMobileCall::EStatusHold)
    {
    CFileLogger::WriteLog(_L("EStatusHold"));
    }
    if (iCallStatus == RMobileCall::EStatusIdle)
    {
    CFileLogger::WriteLog(_L("EStatusIdle"));
    }
    if (iCallStatus == RMobileCall::EStatusConnecting)
    {
    CFileLogger::WriteLog(_L("EStatusConnecting"));
    }
    if (iCallStatus == RMobileCall::EStatusReconnectPending)
    {
    CFileLogger::WriteLog(_L("EStatusReconnectPending"));
    }
    if (iCallStatus == RMobileCall::EStatusUnknown)
    {
    CFileLogger::WriteLog(_L("EStatusUnknown"));
    }
    if (iCallStatus == RMobileCall::EStatusConnected)
    {
    CFileLogger::WriteLog(_L("EStatusConnected"));
    }
    if (iCallStatus == RMobileCall::EStatusAnswering)
    {
    CFileLogger::WriteLog(_L("answering"));
    iView->DimmScreen();
    CFileLogger::WriteLog(_L("dim screen"));
    iState = EAnswering;
    }
    if (iCallStatus == RMobileCall::EStatusHangingUp)
    {
    CFileLogger::WriteLog(_L("hang up"));
    iView->DimmScreen();
    CFileLogger::WriteLog(_L("dim screen"));
    iState = EHangingUp;
    }
    StartL();
    break;
    }
    }
    CFileLogger::WriteLog(_L("end run"));

    }

    void CMobileNumber:oCancel()
    {

    }





    in this i can receive call and also i get the number but when i press green key in mobile 6600 there is no response. i can not get the status. i can get the status of red button but problem in green button.

    What should i do to solve this problem?

    plz,

    thanks to all

  2. #2
    Regular Contributor
    Join Date
    Feb 2007
    Location
    Mumbai
    Posts
    67

    Re: Problem in GetCallStatus in RMobileCall

    Hi Sanjay,

    To get the status of the green key (EKeyYes) handle the EStatusDialing
    condition.

    Best of luck,

    Sunil.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    29

    Re: Problem in GetCallStatus in RMobileCall

    hi sunil,

    thanks for your reply,

    now i can receive green key event in my application but i can not answer the incoming call.

    thanks again

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  5. wireless problem
    By sash_mca in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2003-06-06, 11:34

Posting Permissions

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