×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    Getting Phone Number from SMS Message

    I am using the following code to get the phone Number in the recipient field of sms. it is working fine, but it is giving me Contact Name(if the Contact is present against the recipient number). Now the problem is, How could I get the Actually Number instead of Contact Name( because there may be more than one Mobile number against one Contact).

    Code is this
    TMsvEntry entry1 = entry->Entry();
    TBufC<30> aText(entry1.iDetails); // Gives you phone Number
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

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

    Smile Re: Getting Phone Number from SMS Message

    Quote Originally Posted by saji_iq View Post
    I am using the following code to get the phone Number in the recipient field of sms. it is working fine, but it is giving me Contact Name(if the Contact is present against the recipient number). Now the problem is, How could I get the Actually Number instead of Contact Name( because there may be more than one Mobile number against one Contact).

    Code is this
    TMsvEntry entry1 = entry->Entry();
    TBufC<30> aText(entry1.iDetails); // Gives you phone Number
    You are right. iDetails will map to the name if there is any corresponding name in the phonebook. But don't worry, there is another way of getting phone number which doesn't map to name.

    Using CSmsHeader API, you can achieve this.

    Code:
    CSmsHeader& header = iSmsMtm->SmsHeader();
    TPtrC from = header.FromAddress();
    See this Wiki article where I have listed all possible operations on SMS: SMS Operations
    Nokia Developer Wiki Moderation team

  3. #3
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    Re: Getting Phone Number from SMS Message

    Thanks Kiran, I have already consulted you code, But in my Case I am reading Sent Folder Messages, and the code below

    CSmsHeader& header = iSmsMtm->SmsHeader();
    TPtrC from = header.FromAddress();

    will give me FromAddress and I am interested in ToAddress. I mean , I want to get the phone Number of the recipent not the Sender.
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

  4. #4
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    Re: Getting Phone Number from SMS Message

    Thanks, I have find out the solution, and I have updated it on WIKI too.

    http://wiki.forum.nokia.com/index.ph...ions#Sent_Item
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

Similar Threads

  1. Replies: 2
    Last Post: 2007-11-10, 13:19
  2. How to pass a message from a remote server to an application using phone number
    By arunangshu in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2006-10-03, 23:10
  3. Replies: 0
    Last Post: 2005-11-14, 21:44

Posting Permissions

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