Last modified by Sylvain Berfini on 2017/02/21 14:54

From version 7.1
edited by Sylvain Berfini
on 2017/02/03 17:14
To version 8.1
edited by Sylvain Berfini
on 2017/02/03 17:17
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -9,23 +9,23 @@
9 9  
10 10  === vCards ===
11 11  
12 -Linphone library will edit the FN and IMPP fields when using {{code}}int linphone_friend_set_address(LinphoneFriend *lf, const LinphoneAddress *addr){{/code}} and {{code}}int linphone_friend_set_name(LinphoneFriend *lf, const char *name){{/code}} if the LinphoneFriend has a vCard attached.
12 +Linphone library will edit the FN and IMPP fields when using {{code language="C"}}int linphone_friend_set_address(LinphoneFriend *lf, const LinphoneAddress *addr){{/code}} and {{code language="C"}}int linphone_friend_set_name(LinphoneFriend *lf, const char *name){{/code}} if the LinphoneFriend has a vCard attached.
13 13  
14 -On Android, the vCard update for SIP address and display name is done using {{code}}LinphoneFriend.setAddress(LinphoneAddress addr){{/code}} and {{code}}LinphoneFriend.setName(String name){{/code}}
14 +On Android, the vCard update for SIP address and display name is done using {{code language="java"}}LinphoneFriend.setAddress(LinphoneAddress addr){{/code}} and {{code language="java"}}LinphoneFriend.setName(String name){{/code}}
15 15  
16 16  == Import / Export of Friends from/to vCards ==
17 17  
18 18  === How to import LinphoneFriends from a vCard 4 file ===
19 19  
20 -Call the {{code}}int linphone_friend_list_import_friends_from_vcard4_file(LinphoneFriendList *list, const char *vcard_file){{/code}} or {{code}}int linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList *list, const char *vcard_buffer){{/code}} methods. If the operation succeeds, it returns the number of LinphoneFriend created.
20 +Call the {{code language="C"}}int linphone_friend_list_import_friends_from_vcard4_file(LinphoneFriendList *list, const char *vcard_file){{/code}} or {{code language="C"}}int linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList *list, const char *vcard_buffer){{/code}} methods. If the operation succeeds, it returns the number of LinphoneFriend created.
21 21  
22 -On Android, use {{code}}LinphoneFriendList.importFriendsFromVCardFile(String path){{/code}} or {{code}}LinphoneFriendList.importFriendsFromVCardBuffer(String buffer){{/code}} methods.
22 +On Android, use {{code language="java"}}LinphoneFriendList.importFriendsFromVCardFile(String path){{/code}} or {{code language="java"}}LinphoneFriendList.importFriendsFromVCardBuffer(String buffer){{/code}} methods.
23 23  
24 24  === How to export LinphoneFriends to a vCard 4 file ===
25 25  
26 -Call the {{code}}void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList *list, const char *vcard_file){{/code}} method. If the file already exists, it is overidden. If there is no LinphoneFriend (with a vCard attached or none at all), the file will be empty.
26 +Call the {{code language="C"}}void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList *list, const char *vcard_file){{/code}} method. If the file already exists, it is overidden. If there is no LinphoneFriend (with a vCard attached or none at all), the file will be empty.
27 27  
28 -On Android, use {{code}}LinphoneFriendList.exportFriendsToVCardFile(String path){{/code}} method.
28 +On Android, use {{code language="java"}}LinphoneFriendList.exportFriendsToVCardFile(String path){{/code}} method.
29 29  
30 30  === Supported RFCs ===
31 31  
... ... @@ -39,9 +39,9 @@
39 39  
40 40  First, linphone library has to be compiled with SQLite.
41 41  
42 -Then you can enable the friend storage using {{code}}void linphone_core_set_friends_database_path(LinphoneCore *lc, const char *path){{/code}}.
42 +Then you can enable the friend storage using {{code language="C"}}void linphone_core_set_friends_database_path(LinphoneCore *lc, const char *path){{/code}}.
43 43  
44 -On Android, use {{code}}void LinphoneCore.setFriendsDatabasePath(String path){{/code}}.
44 +On Android, use {{code language="java"}}void LinphoneCore.setFriendsDatabasePath(String path){{/code}}.
45 45  
46 46  Previous friends (stored in linphonerc) will be moved to the database storage on first call, and LinphoneFriend objects remain available through the same APIs as before.
47 47  
... ... @@ -66,7 +66,7 @@
66 66  
67 67  First of all, create a LinphoneFriendList that will contain the local LinphoneFriends:
68 68  
69 -{{code}}
69 +{{code language="C"}}
70 70  LinphoneFriendList *lfl = linphone_core_create_friend_list(lc);
71 71  {{/code}}
72 72  
... ... @@ -86,37 +86,33 @@
86 86  
87 87  Now add the LinphoneFriendList in the LinphoneCore:
88 88  
89 -{{code}}
89 +{{code language="C"}}
90 90  linphone_core_add_friend_list(lc, lfl);
91 91  {{/code}}
92 92  
93 93  Then, configure the CardDAV remote address:
94 94  
95 -{{code}}
95 +{{code language="C"}}
96 96  linphone_friend_list_set_uri(lfl, "http://192.168.0.230/sabredav/addressbookserver.php/addressbooks/sylvain/default");
97 97  {{/code}}
98 98  
99 99  If authentication is needed, add an auth info:
100 100  
101 -{{code}}
101 +{{code language="ini"}}
102 102  [auth_info_0]
103 -
104 104  domain=192.168.0.230
105 -
106 106  username=sylvain
107 -
108 108  ha1=<ha1> or password=<password>
109 -
110 110  realm=SabreDAV
111 111  {{/code}}
112 112  
113 113  Finally, do a synchronization:
114 114  
115 -{{code}}
111 +{{code language="C"}}
116 116  linphone_friend_list_synchronize_friends_from_server(lfl);
117 117  {{/code}}
118 118  
119 -Note that when a change is detected on a LinphoneFriend between {{code}}edit(){{/code}} and {{code}}done(){{/code}}, the LinphoneFriend will be added to a "dirty" list. Every second (in the iterate), if one or more LinphoneFriend are found in the dirty list, they are pushed to the CardDAV server automatically. Also when a LinphoneFriend is added to a LinphoneFriendList, it is automatically added to the dirty list.
115 +Note that when a change is detected on a LinphoneFriend between {{code language="c"}}edit(){{/code}} and {{code language="c"}}done(){{/code}}, the LinphoneFriend will be added to a "dirty" list. Every second (in the iterate), if one or more LinphoneFriend are found in the dirty list, they are pushed to the CardDAV server automatically. Also when a LinphoneFriend is added to a LinphoneFriendList, it is automatically added to the dirty list.
120 120  
121 121  
122 122  On Android, there is a CardDAV tutorial available in src/org/linphone/tutorials/TutorialCardDavSync.java