×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Unhappy Problem sending SMS

    Hello!

    I'm a starter in symbian development, so take that in consideration and forgive me if my question seems stupid!

    I have a console application (.exe) that waits for outgoing calls, and when a call hangup, sends an SMS with the duration of the call.

    My problem is that, after 3 calls, the application stops sending the SMS. The 4th SMS blocks on Draft folder, and when I try to open the message details, return me a System Error -1.

    Can you suggest me samething about what's happening??
    Please, it's a little urgent!!!

    Thanks!!

    PS.: I'm developing for S60 2nd FP3, and using Active Objects
    Last edited by aprata; 2008-02-20 at 15:38.

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

    Re: Problem sending SMS

    just add file logging into your application to find out which line gets called last,also try using TRAPs and write returned error codes to the log as well, so you could get more information on what is going wrong inside there.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: Problem sending SMS

    Thanks for the quick reply!
    I'll try to implement your suggestion!

    Hope I have some good news soon!

  4. #4
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: Problem sending SMS

    Hi Jukka!

    I'm trying to implement the logs as you suggest, but I'm facing some problems.

    I've included flogger.lib in my mpp and flogger.h in my files, and use the code:

    RFileLogger logFile;
    logFile.Connect();
    logFile.CreateLog(_L("C:/Logs"),_L("LogFile"), EFileLoggingModeOverwrite);

    (.....)

    logFile.CloseLog();
    logFile.Close();

    But when I complile, it´s giging me the folowing error:
    "undefined reference to `TLogFormatter16Overflow::Overflow(TDes16 &)"

    Can you help me with this?

    Thanks,
    aprata

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

    Re: Problem sending SMS

    check docs for the class for all headers & libraries needed, anyway you can do logging with RFile as well.

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: Problem sending SMS

    Hi! Not good nwes yet!

    I've made some changes on my code:
    - Include Logs using RFile
    - Remove sms send code, now I only write info to log

    Now, my application detects the first occurence of an outgoing call, and after this first occurrence, does not detect nothing anymore.

    I do the following:
    In main:
    - Install the scheduler
    - Create the logger
    - Call the Outgoing Call listener

    COutgoingCallsHandler* outgoingCallsHanhler = COutgoingCallsHandler::NewL(logFile);
    outgoingCallsHanhler->StartListeningL();

    In COutgoingCallsHandler::StartListeningL:

    iLine.NotifyStatusChange(iStatus, iLineInfo.iStatus);
    SetActive();
    msg.Append(_L("CallsHandler - Start()\n"));
    iLogFile.Write(msg);
    CActiveScheduler::Start();

    In COutgoingCallsHandler::RunL:
    case RCall::EStatusConnecting: //trying to connect
    {
    TBuf8<100> msg;
    msg.Append(_L("Connecting-Stop()\n"));
    iLogFile.Write(msg);
    CActiveScheduler::Stop();
    }
    break;
    case RCall::EStatusConnected: //connected -> the call is active
    {
    iLogEvent = iLogEngine->CreateLogEventL();
    TBuf8<100> msg;
    msg.Append(_L("Connected-Stop()\n"));
    iLogFile.Write(msg);
    CActiveScheduler::Stop();
    }
    break;
    case RCall::EStatusHangingUp:
    {
    TTimeIntervalSeconds callDuration;
    TTime time;
    time.HomeTime();
    time.SecondsFrom(iLogEvent->Time(), callDuration);
    iLogEvent->SetDuration(callDuration.Int());

    iLogEngine->AddOwnEventL(iLogEvent);

    iCallCounter = iCallCounter + 1;
    iCallDurationCounter = iCallDurationCounter + callDuration.Int();

    TUint cellId;
    TBuf<30> networkId;
    TBuf<30> countryId;
    TBuf<30> operatorLongName;

    CNetworkInfoHandler* networkInfoHandler = CNetworkInfoHandler::NewL(iLogFile, cellId, networkId, countryId, operatorLongName);
    TBool result = networkInfoHandler->GetNetworkInfo(cellId,networkId,countryId,operatorLongName);
    TBuf8<100> msg;
    msg.Append(_L("NetworkInfo-Start()\n"));
    iLogFile.Write(msg);
    CActiveScheduler::Start();

    if(result)
    {
    TBuf8<100> msg1;
    msg1.Append(_L("ID:"));
    msg1.Append(networkId);
    msg1.Append(_L("\n"));
    iLogFile.Write(msg1);
    }
    TBuf8<100> msg1;
    msg1.Append(_L("HangingUp-Stop()\n"));
    iLogFile.Write(msg1);
    CActiveScheduler::Stop();
    }
    (...)

    StartListeningL();

    In CNetworkInfoHandler::GetNetworkInfo:

    iTelephony = CTelephony::NewL();
    CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg (iNetworkInfoV1);
    iTelephony->GetCurrentNetworkInfo(iStatus, iNetworkInfoV1Pckg);
    SetActive();

    In CNetworkInfoHandler::RunL:

    if(iStatus==KErrNone)
    {
    iCellID = iNetworkInfoV1.iCellId;
    iNetworkID = iNetworkInfoV1.iNetworkId;
    iCountryCODE = iNetworkInfoV1.iCountryCode;
    iLongNAME= iNetworkInfoV1.iLongName;
    }
    else
    User::Leave(iStatus.Int());

    TBuf8<100> msg;
    msg.Append(_L("NetworkInfo - Stop()\n"));
    iLogFile.Write(msg);
    CActiveScheduler::Stop();

    ---------

    When I look to log file, after I made 2 calls:

    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Connecting - Stop()
    CallsHandler - Start()
    Connected - Stop()
    CallsHandler - Start()
    NetworkInfo - Start()
    NetworkInfo - Stop()
    ID:01
    HangingUp - Stop()
    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Connecting - Stop()
    CallsHandler - Start()

    It seems that something wrong appends after Connecting state...
    Can you give me any clue about what's happening??

    Thanks, aprata

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: Problem sending SMS

    OK, something REALLY stange it's appening here!

    I've put something like this

    TRAPD(error8, CActiveScheduler::Stop());
    if(error8)
    {
    TBuf8<100> msg1;
    msg1.Append(_L("Error: "));
    msg1.AppendNum(error8);
    iLogFile.Write(msg1);
    }
    in all occurences of CActiveScheduler::Start() and CActiveScheduler::Stop().
    The result on log file is:

    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Connecting - Stop()
    CallsHandler - Start()
    Connected - Stop()
    CallsHandler - Start()

    whith no error message...

    When I remove all the TRAPD from code, the result in log file the same I describe erlier:

    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Connecting - Stop()
    CallsHandler - Start()
    Connected - Stop()
    CallsHandler - Start()
    NetworkInfo - Start()
    NetworkInfo - Stop()
    ID:01
    HangingUp - Stop()
    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Other - Stop()
    CallsHandler - Start()
    Connecting - Stop()
    CallsHandler - Start()

    I don't understand... why the error message dosen't appears?
    I don't know what to do...
    Please help me if you can!!

    Thanks,
    aprata

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    187

    Re: Problem sending SMS

    Hi
    u can also try this code for sending SMS in third edition.

    void SendTextMessage(const TDesC& aAddr, const TDesC& aMsg)
    {
    #ifdef __SERIES60_30__
    RSendAs sendAs;
    User::LeaveIfError(sendAs.Connect());
    CleanupClosePushL(sendAs);

    RSendAsMessage sendAsMessage;
    sendAsMessage.CreateL(sendAs, KUidMsgTypeSMS);
    CleanupClosePushL(sendAsMessage);

    // prepare the message
    sendAsMessage.AddRecipientL(aAddr, RSendAsMessage::ESendAsRecipientTo);
    sendAsMessage.SetBodyTextL(aMsg);

    // send the message
    sendAsMessage.SendMessageAndCloseL();

    // sendAsMessage (already closed)
    CleanupStack::Pop();
    // sendAs
    CleanupStack::PopAndDestroy();
    #endif
    }



    Regards
    Asif Nazir

Similar Threads

  1. N91 SMS sending problem
    By markmaya in forum General Messaging
    Replies: 17
    Last Post: 2007-10-01, 18:05
  2. Problem regarding sending sms from pc to mobile
    By Archana. M in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2007-01-10, 05:52
  3. Problem in sending SMS
    By sylvia in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2006-09-27, 07:06
  4. Problem - Sending SMS with Java WMA
    By Geodonis in forum General Messaging
    Replies: 0
    Last Post: 2005-02-01, 11:57

Posting Permissions

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