×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    73

    Retreiving Phone number of incoming SMS

    Hi all,
    I am working on S60 3rd edition. In my application i want to retreive the phone number of an incoming SMS. I am using the following code to do that.
    Code:
    CMsvEntry* serverEntry = iSession->GetEntryL( aEntryId );   // current entry
    CleanupStack::PushL( serverEntry );
    TMsvEntry entry = serverEntry->Entry(); // currently handled message entry
        
    entry.SetNew( ETrue );
    entry.SetUnread( ETrue );
    entry.SetVisible( ETrue );
    
    serverEntry->ChangeL( entry );  // commit changes
    iPhDetail.Zero();
    iPhDetail.Copy(entry.iDetails); //get the phone number
    Now when i diplay the value in iPhDetail descriptor i observe
    the following

    1. If the phone number of the incoming SMS is not stored in the contact list of the phone, then the phone number (in digits) gets displayed.

    2. If the phone number of the incoming SMS is stored in the contact list of the phone with some name, then the name gets displayed.

    According to the needs of my application i always want to retreive the phone number in digits even if it is stored in the contact list with some name.

    I want to know how i can do that.

    thanks and regards,
    krishna.

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Retreiving Phone number of incoming SMS

    Hi,
    If you are trying to get sender num from a message in inbox than you wil get a name if it is there in your contacts. You can try to access the logs and from there find the received sms.
    Jajal Mehul

  3. #3
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    146

    Re: Retreiving Phone number of incoming SMS

    TBuf<KSmsMessageLength> iAddress(iSmsMtm->SmsHeader().FromAddress());

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: Retreiving Phone number of incoming SMS

    like anttijuu said.
    iDetails is display field, if the number in contract list, it change to the name.
    if not in, it show raw phone number.

    but FromAddress() always return phone number. so you need use the field.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  5. #5
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Re: Retreiving Phone number of incoming SMS

    Quote Originally Posted by anttijuu View Post
    TBuf<KSmsMessageLength> iAddress(iSmsMtm->SmsHeader().FromAddress());
    hi..
    if i use it dis way.. m getting the following error..

    error: forward declaration of `struct CSmsHeader'[..//..//..//..//..//9.1//S60_3rd_MR_4//EPOC32//include/smsclnt.h]

  6. #6
    Registered User
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Retreiving Phone number of incoming SMS

    Hi,
    did u added this header file SmutHdr.h

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  7. #7
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile Re: Retreiving Phone number of incoming SMS

    Thanks Mateen..
    m thru now..

Similar Threads

  1. Can I test SMS receiver on the phone without port number?
    By brighteyes in forum Mobile Java General
    Replies: 10
    Last Post: 2007-11-26, 23:38
  2. Replies: 1
    Last Post: 2007-07-10, 18:53
  3. Retreiving the number of the sender of an sms
    By christee in forum Python
    Replies: 1
    Last Post: 2006-04-13, 13:13
  4. incoming voice caller phone number?
    By bcchong in forum Symbian C++
    Replies: 2
    Last Post: 2002-09-12, 01:04

Posting Permissions

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