×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    27

    Question Problem with the alert for a new SMS

    I'm working on with an SMS filter program, so I need to make an ajudgement to the new-coming SMS to see if it satisfies a certain condition. If it does, I have to avoid the system to alert, no matter in the form of sound or notification.

    Someone plz tell me if it's possible and how?
    Thanks ahead!

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Problem with the alert for a new SMS

    You can try the SMS Utilities API (http://wiki.forum.nokia.com/index.php/SMS_Utilities_API) - note the "Note!", and download the plugin pack if you want to try. It can filter SMS-es by prefix, if that is OK with you.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    27

    Re: Problem with the alert for a new SMS

    Thank you so much!
    Is there anyway else, or just one way?
    Thanks!

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Problem with the alert for a new SMS

    Only this prefix-based way exists as far as I know.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Problem with the alert for a new SMS

    There are also methods to intercept SMS messages by port number or to intercept all SMS messages. SMS messages which do not comply with the filer, you can forward to the Inbox.

    Filtering by prefix is easiest to implement.

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  6. #6
    Registered User
    Join Date
    Jul 2008
    Posts
    27

    Re: Problem with the alert for a new SMS

    Thank you so much!

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    27

    Re: Problem with the alert for a new SMS

    Could you please tell me more details about that, since I'm just a novice on that.
    I'm expecting your reply. Thank you!

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Problem with the alert for a new SMS

    You should rather tell your needs. Though port-based approach exists, it will get messages addressed to a given port. And regular users rarely send messages to varying ports.

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    27

    Re: Problem with the alert for a new SMS

    Got it! Thank you!
    So actually, there is just one proper way to realize the 'silent SMS', i.e. through 'socket' right?

  10. #10
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Problem with the alert for a new SMS

    Hi,

    yes - use RSocket iSocket API. This code would listen to incoming SMS messages on a port:

    TPckgBuf<TUint> iResult;

    TSmsAddr smsAddress;

    smsAddress.SetSmsAddrFamily( ESmsAddrApplication16BitPort );
    smsAddress.SetPort( aPort );
    User::LeaveIfError( iSocket.Bind(smsAddress) );

    iResult() = KSockSelectRead;
    iSocket.Ioctl ( KIOctlSelect, iStatus, &iResult, KSOLSocket);
    iState = EWaitingForMessage;
    SetActive();

    Put this code in a CActive derived class. Once you receive an SMS on the port, you end up in RunL.

    In RunL you can do something like this:

    CSmsBuffer* smsBuffer=CSmsBuffer::NewL();
    CleanupStack::PushL(smsBuffer);

    CSmsMessage* smsMessage = CSmsMessage::NewL(iFs, CSmsPDU::ESmsDeliver, smsBuffer);
    // smsMessage has taken ownership of smsBuffer
    CleanupStack::Pop(smsBuffer);
    CleanupStack::PushL(smsMessage);

    RSmsSocketReadStream readstream(iSocket);
    readstream >> *smsMessage; // This function may leave!

    The advantage would be that you can intercept messages without depending on a specific prefix in the messages (note that prefix means you can not check for a string in the middle of the SMS messages, i.e. that would mean all messages have to be intercepted and inspected). If you server sends SMS messages to a specific port you can be sure you that in your S60 app you are only spending execution time on messages which come from your server and not on any other messages.

    Sending messages to a specific port is a bit more complicated, but I believe it is quite common practise in the industry.

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

Similar Threads

  1. Replies: 2
    Last Post: 2007-11-10, 13:19
  2. Problem with Push registry for SMS interceptor
    By iworktech_kiran in forum Mobile Java General
    Replies: 4
    Last Post: 2007-11-02, 22:13
  3. OK Cancel Alert Problem
    By MananW in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2006-07-17, 12:12
  4. Error sending SMS
    By jorge_c in forum Multimodecards
    Replies: 0
    Last Post: 2003-10-07, 11:53
  5. Problem sending SMS using Nokia 6210 and SDK 2.1
    By standi in forum PC Suite API and PC Connectivity SDK
    Replies: 2
    Last Post: 2002-07-25, 03:14

Posting Permissions

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