×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    36

    Is it possible to get info of outgoing sms and delete it before sent?

    Dear ALL,

    I am doing a project and I have to get the info of outgoing SMS message details and delete it before sent.
    I've found many post about this topic and it seems the details of the SMS can be get but cannot delete it before sent.
    Can it be done?
    ALso, how can it be done?

    Thank you very much!

    Regards,
    Lily

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by lilyaaa View Post
    Dear ALL,

    I am doing a project and I have to get the info of outgoing SMS message details and delete it before sent.
    I've found many post about this topic and it seems the details of the SMS can be get but cannot delete it before sent.
    Can it be done?
    ALso, how can it be done?

    Thank you very much!

    Regards,
    Lily
    Yes, you can do that. See this Wiki article: SMS Operations
    Nokia Developer Wiki Moderation team

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

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Yep, but if you read the older posts, it is not really relaible to try catching the SMS messages from outbox, and then deletin them, at least I do remember from older possts that somwtimes some messages do get through before they were deleted..

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by symbianyucca View Post
    Yep, but if you read the older posts, it is not really relaible to try catching the SMS messages from outbox, and then deletin them, at least I do remember from older possts that somwtimes some messages do get through before they were deleted..
    Hmm, I misinterpreted the original question then. Yes, I could not find time to try out this particular scenario(to delete message before it reaches to Sent Item)
    Nokia Developer Wiki Moderation team

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    36

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by symbianyucca View Post
    Yep, but if you read the older posts, it is not really relaible to try catching the SMS messages from outbox, and then deletin them, at least I do remember from older possts that somwtimes some messages do get through before they were deleted..
    SO, What can I do? Could anyone successfully do that?

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

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    AFAIK, there ois no 100% relaible way on doing this.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by lilyaaa View Post
    SO, What can I do? Could anyone successfully do that?
    Odota. I just did it. Add the following case in your HandleSessionEventL function.

    Code:
    case EMsvEntriesMoved:
    {
    	// Entry id is obtained from the session event arguments.
    	TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );
    
    	// We are interested in messages that are moved to Sent Item Folder
    	if (*entryId == KMsvGlobalOutBoxIndexEntryId)
    	{
    		TMsvSelectionOrdering sort;
    		sort.SetSorting(EMsvSortByDateReverse);
    		sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
    
    		CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,
    				KMsvGlobalOutBoxIndexEntryId, sort);
    		CleanupStack::PushL(parentEntry);
    
    		CMsvEntrySelection* entries = parentEntry->ChildrenL();
    		CleanupStack::PushL(entries);
    
    		for (TInt i = 0; i < entries->Count(); i++)
    		{
    			if (parentEntry->ChildDataL(entries->At(i)).iMtmData3
    					!= KUidMsgTypeSMS.iUid)
    			{
    				TMsvEntry entry = parentEntry->ChildDataL(entries->At(i));
    				const TDesC& descp = entry.iDescription; // iDescription will have only first 32 characters from the message
    				TBufC<50> text(entry.iDetails);
    				parentEntry->DeleteL(entries->At(i));
    				break;
    			}
    		}
    		CleanupStack::PopAndDestroy(entries);
    		CleanupStack::PopAndDestroy(parentEntry);
    	}
    	break;
    }
    Nokia Developer Wiki Moderation team

  8. #8
    Registered User
    Join Date
    Sep 2009
    Posts
    36

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by kiran10182 View Post
    Odota. I just did it. Add the following case in your HandleSessionEventL function.
    Oh! You are so powerful, but I want to ask how can you test it since emulator cannot really send sms message?

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Have you actually tried? Because it can. If you send a message, it will appear as a file in epoc32\winscw\c\smsout, and if you copy/move that file into smsin, the message will arrive to the Inbox.
    If you successfully capture the SMS, the file will not appear there.

  10. #10
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by lilyaaa View Post
    Oh! You are so powerful, but I want to ask how can you test it since emulator cannot really send sms message?
    If you intend to send message from within your application, make sure to define message service center number on your emulator. You can find it in Messaging->Options->Settings .... You can define any number there. For example 1 will work.
    Nokia Developer Wiki Moderation team

  11. #11
    Registered User
    Join Date
    Sep 2009
    Posts
    36

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Yes, I can send the SMS message!

  12. #12
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by lilyaaa View Post
    Yes, I can send the SMS message!
    Then I believe you can emulate your original outbox issue, can't you? So now you can delete messages from outbox, right?
    Nokia Developer Wiki Moderation team

  13. #13
    Registered User
    Join Date
    Sep 2009
    Posts
    36

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by kiran10182 View Post
    Then I believe you can emulate your original outbox issue, can't you? So now you can delete messages from outbox, right?
    Yes, follow you codes, I can delete the message from outbox and get the recipents and content of the message.
    Thank you very much!

    But I didn't try on real mobile phone, so I am not sure all the things can go right.

    Since I want to add things at the end, so I use

    TBufC<100> text2(entry.iDescription); to get the content.

    You say entry.iDescription get the first 32 character, but I try that it seems can get first 60 characters.
    but how can I get the whole message content?

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

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    you would actually need to get the body of the message, see some codes from: http://wiki.forum.nokia.com/index.php/SMS_Operations

  15. #15
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Is it possible to get info of outgoing sms and delete it before sent?

    Quote Originally Posted by lilyaaa View Post
    But I didn't try on real mobile phone, so I am not sure all the things can go right.
    Yes, it works on device as well. I tested it both on Emulator and on real device. There is one glitch on real device though. After deleting message from Outbox, the control reaches to ScheduleL and in that function a call to InvokeAsyncFunctionL will leave. You can simply wrap it with TRAP_IGNORE to avoid any error popup on real device. Something like:
    Code:
    TRAP_IGNORE(iOperation = iSmsMtm->InvokeAsyncFunctionL( ESmsMtmCommandScheduleCopy,
                              *selection, dummyParams, iStatus ));
    Quote Originally Posted by lilyaaa View Post
    You say entry.iDescription get the first 32 character, but I try that it seems can get first 60 characters.
    but how can I get the whole message content?
    Yes, as Jukka mentioned, see the Wiki article and you would find some ways to get it.
    Nokia Developer Wiki Moderation team

Similar Threads

  1. Client exit when new sms(general sms, not related with APP) comes,
    By sanjeevmehtaubi in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2009-04-22, 16:06
  2. Error when deleting outgoing sms, how could we hide it or avoid it ?
    By khalidpeace in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2008-04-17, 15:26
  3. Replies: 2
    Last Post: 2007-11-10, 13:19

Posting Permissions

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