Importing vcf, country prefix problem workaround
#1
Hello folks, finally I have started to test the PP with my separate SIM card I've bought just for PP. To test the calls etc. I have firstly wanted to import my contacts from daily driver phone (iPhone in this case). I've used 3rd party app in iPhone to export all my contacts to .vcf format which I then did send to my email. Using Geary I did save the .vcf to my pinephone.

I have then followed https://wiki.mobian-project.org/doku.php...]=contacts to import the contacts via Evolution. There the problem started.

All the contacts have been imported successfully, but calling them via Contacts didn't work. Why? For some reason every contact I don't have saved with prefix (format +<country specific prefix>) in tel. number (it's not like that in my iPhone either btw so it's not import problem) was called with prefix+10 using Contacts app. If you would ask why don't I have all the contacts saved with prefix for phone number, it's because sometimes I was lazy, and when calling Slovak mobile phones in Slovakia I don't have to use any prefix.

To explain in better, example:
- contact imported via vcf, phone number imported: 0910 123 456 (this is a standard Slovak mobile phone number). Displayed as 0910 123 456  in Contacts as well, everything looks good.
- calling the above number via Contacts results into calling: +10 910 123 456 which obviously fails (Slovakia has +421 prefix) instead of calling either [font=Tahoma, Verdana, Arial, sans-serif]0910 12[/font][font=Tahoma, Verdana, Arial, sans-serif]3 456 or +421 [font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]910 12[/font][font=Tahoma, Verdana, Arial, sans-serif]3 456[/font][/font][/font]
[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]- interestingly Contacts is at least clever enough not to ad a prefix for numbers which already have it[/font][/font][/font]

I couldn't find any setting in Contacts to change it, to stop adding prefix on its own, so I had to come up with my own workaround I wanted to share ^^. This is applicable for contacts imported via Evolution (vcf) tested on Phosh pmOS and Mobian.

1) take a backup of your vcf
2) check whether you need to modify anything in vcf:

Code:
pitrpp:~/Documents$ egrep "^TEL;|^item" MyContacts-2020-11-21-133432-124.vcf | grep -v "+" | egrep "CELL|TEL|HOME"
item1.TEL;CHARSET=UTF-8:0911 11 1111
TEL;CHARSET=UTF-8;TYPE=CELL:0922 222 222
...



2) modify your vcf as desired
Code:
pitrpp:~/Documents$ sed -i 's/:09/:+421 9/g' MyContacts-2020-11-21-133432-124.vcf

-> in this case when checking the vcf structure I have discovered that it's enough to change every entry <:09> to <:+421 9> (again Slovakia specific so adjust to your country code) 
-> this is an in place edit with sed, if you want just to test and see omit the -i option
-> be sure that with the expression you choose, you don't change anything else unintentionally (but only the phone numbers)

OPTIONAL
-> if you have already imported the vcf with phone numbers without prefix do the following BEFORE you import the "corrected" vcf:
1) take the backup of current contact database:
Code:
cp /home/<user>/.local/share/evolution/addressbook/system/contacts.db /home/<user>/Documents/

2) delete the contact database
Code:
rm /home/<user>/.local/share/evolution/addressbook/system/contacts.db

3) reboot the phone
4) import the corrected vcf using e.g [font=Tahoma, Verdana, Arial, sans-serif]https://wiki.mobian-project.org/doku.php?id=tweaks&s[]=contacts

Let me know if you have any questions or you know how to prevent Contacts from adding "+10" prefix automatically on its own.
[/font]
#2
Thanks for that workaround. Hopefully this soon won't be an issue anymore since there is already a merge request to remove automatically adding that prefix: https://source.puri.sm/Librem5/calls/-/m...quests/188
#3
Cheers for sharing the bug report - TBH I didn't search for it since the workaround is easy (but yes, annoying) ^^.

I'd at least suggest/appreciate if this was somehow part of the known bugs (or mentioned in docs which talk about importing vcf) for this application in pinephone forums to keep everyone aware. Also the PR is opened for two months already, and who knows when this new version will be then part of our favourite OSes on our PPs.
#4
the evolution on mobian nethor wants to import vcf files nor run with the contacts.db file from my computer Huh


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with incoming calls (w/o ModemManager/Ofono) jlucas 10 1,450 08-09-2021, 05:38 PM
Last Post: mouffa
  what if problem cant be solved rvh 7 1,732 06-11-2021, 01:06 AM
Last Post: dsimic
  Problem With Headphones Joelandsonja 0 771 07-22-2020, 01:49 PM
Last Post: Joelandsonja
  APN, OS, country & pinephone model e-minguez 2 2,074 07-02-2020, 08:35 AM
Last Post: ShadowPantz91
  PinePhone RTL8723CS automatic test fail and WiFi problem surfingtux 4 2,686 02-19-2020, 12:24 PM
Last Post: surfingtux

Forum Jump:


Users browsing this thread: 1 Guest(s)