.NET Components for Mobility

Is it possible to have more than one SMS MessageInterceptors with different actions?

Last post 03-11-2010 5:02 AM by devshed. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-04-2010 4:01 PM

    Is it possible to have more than one SMS MessageInterceptors with different actions?

    Hello all,

    I am interested in intercepting incoming SMS messages with a specific structure, without letting them pass to the SMS inbox.

    However, all other (normal) incoming SMS messages, I need only to recorded them in a text file and pass them to the SMS inbox for the user to view them.

    Although I have specified two SMS message interceptors in my application, only one of them really works (the one that gets the message and deletes it).

    Can you please tell me how I can successfully use two SMS message interceptors, one for special SMS messages that I don't want the user to see and another one for all other (normal) SMS messages sent to the user (which I want to only intercept to record to a file but NOT delete).

    Thank you for any help or pointers you can share.

  • 03-05-2010 5:15 AM In reply to

    Re: Is it possible to have more than one SMS MessageInterceptors with different actions?

    You could setup a single interceptor and manually put specific messages back into the inbox if you don't want to delete them (or in reverse delete those you want to process but the user may see a notification). Based on the way the interceptor is implemented (the native code part is part of the OS) it sets the flag to stop all further rules once the first match is made. It may be possible that you can force the order the message interceptors are run by manually changing some registry keys as you'll want your delete rule to run first and only process the messages to process and delete hidden from the user and then run your general catch all interceptor second.

    Peter

  • 03-05-2010 5:46 AM In reply to

    Re: Is it possible to have more than one SMS MessageInterceptors with different actions?

    Dear Peter,

    Thank you for your prompt reply. Can you be a bit more specific in how I could place an SMS I have already process and deleted back to the SMS inbox for the user to get notified ? Is this something I can achieve using the InTheHand library ?

    Is there a sample in C# you could give ??? (I mainly code in C# and I am not versed in native code).

    I appreciate your time,

    Panos

  • 03-08-2010 2:56 PM In reply to

    Re: Is it possible to have more than one SMS MessageInterceptors with different actions?

    You can create a new SmsMessage object, set it's properties to those of the retrieved message and then call Update() followed by MoveTo() to send it to the Inbox. However this will not notify the user. Probably better to persue the issue with the order in which the MessageInterceptors are called. Once registered are you saving your message interceptor with a named identifier? This is done using the EnableApplicationLauncher. If you don't do this the system generates a Guid for each new message interceptor so it is more difficult to identify them in the registry.

    Peter

  • 03-11-2010 5:02 AM In reply to

    Re: Is it possible to have more than one SMS MessageInterceptors with different actions?

    Dear Peter,

     Just a quick note to let you know that I did use named identifiers for my message interceptor, however, my NotifyAndDelete msg interc was called before the Notify msg interc due to their names. I prepended 01 to my Notify msg interc and 02 to my NotifyAndDelete msg interc and now I can safely record incoming messages that do NOT contain special commands.

    I must admin I did NOT know that message interceptors were executed in alphabetical sort order. :)

    Thank you for your help!

    Panos

Page 1 of 1 (5 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting