locked
How to retrieve the sender phone number in a outgoing sms? RRS feed

  • Question

  • Hi I am writing a small app for Windows Mobile (C++) for blocking outgoing sms and retrieving all sms details. I got notified by the outgoing sms and I was able to retrieve IMessage pointer. Using IMessage  pointer I was able to get the sms body text using PR_SUBJECT property and recepient details using GetRecipientTable(). Now I need to retrieve the sender phone number and the time of the message. Could anyone help me on this.

    - rahul
    Friday, April 17, 2009 10:07 PM

Answers

  • Woudn't sender phone number be the currrent device phone number?
    For your own number see GetPhoneNumber sample in Windows Mobile 6 SDK
    Alex Feinman. MVP .NET Compact Framework
    • Marked as answer by warrentang Friday, April 24, 2009 5:32 AM
    Saturday, April 18, 2009 5:26 PM
  •  That has been discussed number of times. The conclusion is what there's no generic way to retrieve a phone number. If you need details please search.

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by warrentang Friday, April 24, 2009 5:33 AM
    Sunday, April 19, 2009 8:12 PM

All replies

  • Woudn't sender phone number be the currrent device phone number?
    For your own number see GetPhoneNumber sample in Windows Mobile 6 SDK
    Alex Feinman. MVP .NET Compact Framework
    • Marked as answer by warrentang Friday, April 24, 2009 5:32 AM
    Saturday, April 18, 2009 5:26 PM
  • hiii,

    Ofcourse i meant the device phone number. And i tried the GetPhoneNumber sample in my emulator, but when i run it a message box with no phone number is shown. I wonder that, if i need to do some setting in my emulator. Is there any way, apart from the GetPhoneNumber sample to retrieve device phone no?

    MS Visual studio 2008
    Windows mobile sdk 5 Smartphone emulator

    - rahul
    Sunday, April 19, 2009 6:19 PM
  •  That has been discussed number of times. The conclusion is what there's no generic way to retrieve a phone number. If you need details please search.

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by warrentang Friday, April 24, 2009 5:33 AM
    Sunday, April 19, 2009 8:12 PM
  • As Ilya points out, there is no guaranteed way to retrieve device own phone number. If you look under Settings/Phone, depending on the SIM card and operator it may or may not show own phone number. If the technique shown in GetPhoneNumber example works, good for you. Otherwise you just have to accept that there is no platform-independent way to access it.
    Alex Feinman. MVP .NET Compact Framework
    Sunday, April 19, 2009 10:19 PM
  • Hi all,

    Thanks for all your suggestions. I ll try my luck with GetPhoneNumber() :)

    - rahul
    Tuesday, April 21, 2009 2:29 PM