SokosLee / imsdroid

Automatically exported from code.google.com/p/imsdroid
0 stars 0 forks source link

Match incoming/outgoing call phone numbers with address book contacts #379

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Place a call (via AB and/or dialer) or receive one from a contact having 
additional chars in the phone number (i.e. " ", "(", ")", "-").

What is the expected output? What do you see instead?
If the phone number is associated to a contact of the address book, the display 
name and the contact's avatar should be displayed in the call view. No 
information about the contact is displayed instead.

What version of the product are you using? On what operating system?
Imsdroid svn snapshot r511 on Samsung i9100 running Android 4.0.4

Please provide any additional information below.
The issue should be related to how Android stores the phone numbers in the 
Address Book (e.g. '+39 012 345 6789' or '+1 (234) 567-8901')) and the way to 
lookup contact information from the phone numbers considering all the phone 
number formats.

Original issue reported on code.google.com by massimo....@gmail.com on 24 Aug 2012 at 7:44

GoogleCodeExporter commented 9 years ago

Original comment by boss...@yahoo.fr on 3 Sep 2012 at 9:47

GoogleCodeExporter commented 9 years ago
Please Help me in below problem. How can it is possible?

like i m in US and using with imsdroid call to my friend who is live in US. So 
he see my number in US country code local number.

But now when i will go out side the country and now in UK than i will call my 
UK Friend live in UK. So he got my call through imsdroid and display the number 
with local Country code means local number.

Give me idea how to perform this functionality?

Original comment by sa...@spaninfoway.com on 26 Oct 2012 at 2:25

GoogleCodeExporter commented 9 years ago
I discovered there is a "compare" function in the PhoneNumberUtils class that 
can be used to compare the phone number stored in the INVITE message and the 
phone numbers stored in the adress book.

This function should return a positive match even if the two numbers are 
written into different formats (e.g INVITE->"+1801555666" and 
AB->"+1(801)555-666").

Please have a look at 
http://developer.android.com/reference/android/telephony/PhoneNumberUtils.html

Original comment by android....@gmail.com on 29 Oct 2012 at 8:28

GoogleCodeExporter commented 9 years ago
I fixed this issue by doing the following change:

In file src/org/doubango/ngn/model/NgnContact.java in function 
ContactFilterByAnyPhoneNumber, just replace:

if(NgnStringUtils.equals(phoneNumer.getNumber(), mPhoneNumber, false))

with

if(PhoneNumberUtils.compare(phoneNumer.getNumber(), mPhoneNumber))

Original comment by massimo....@gmail.com on 14 Dec 2012 at 1:34