diff --git a/Linphone.xcodeproj/project.pbxproj b/Linphone.xcodeproj/project.pbxproj index cb827f198..f9374e42c 100644 --- a/Linphone.xcodeproj/project.pbxproj +++ b/Linphone.xcodeproj/project.pbxproj @@ -48,6 +48,8 @@ D777DBB32AE12C5900565A99 /* ContactsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D777DBB22AE12C5900565A99 /* ContactsManager.swift */; }; D78290B82ADD3910004AA85C /* ContactsFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78290B72ADD3910004AA85C /* ContactsFragment.swift */; }; D78290BB2ADD40B2004AA85C /* ContactViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78290BA2ADD40B2004AA85C /* ContactViewModel.swift */; }; + D783C77C2B1089B200622CC2 /* assistant_linphone_default_values in Resources */ = {isa = PBXBuildFile; fileRef = D783C77A2B1089B200622CC2 /* assistant_linphone_default_values */; }; + D783C77D2B1089B200622CC2 /* assistant_third_party_default_values in Resources */ = {isa = PBXBuildFile; fileRef = D783C77B2B1089B200622CC2 /* assistant_third_party_default_values */; }; D796F2002B0BB61A0041115F /* ToastViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D796F1FF2B0BB61A0041115F /* ToastViewModel.swift */; }; D7A03FBD2ACC2DB60081A588 /* ContactsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */; }; D7A03FC02ACC2E390081A588 /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A03FBF2ACC2E390081A588 /* HistoryView.swift */; }; @@ -123,6 +125,8 @@ D777DBB22AE12C5900565A99 /* ContactsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsManager.swift; sourceTree = ""; }; D78290B72ADD3910004AA85C /* ContactsFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsFragment.swift; sourceTree = ""; }; D78290BA2ADD40B2004AA85C /* ContactViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactViewModel.swift; sourceTree = ""; }; + D783C77A2B1089B200622CC2 /* assistant_linphone_default_values */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = assistant_linphone_default_values; sourceTree = ""; }; + D783C77B2B1089B200622CC2 /* assistant_third_party_default_values */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = assistant_third_party_default_values; sourceTree = ""; }; D796F1FF2B0BB61A0041115F /* ToastViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastViewModel.swift; sourceTree = ""; }; D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsView.swift; sourceTree = ""; }; D7A03FBF2ACC2E390081A588 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = ""; }; @@ -404,6 +408,8 @@ D7ADF6012AFE5C7C00212231 /* Ressources */ = { isa = PBXGroup; children = ( + D783C77A2B1089B200622CC2 /* assistant_linphone_default_values */, + D783C77B2B1089B200622CC2 /* assistant_third_party_default_values */, D732A90A2B0376F500DB42BA /* linphonerc-default */, D732A90B2B0376F500DB42BA /* linphonerc-factory */, ); @@ -499,6 +505,7 @@ D7D24D142AC1B4E800C6F35B /* NotoSans-Regular.ttf in Resources */, D7D24D182AC1B4E800C6F35B /* NotoSans-ExtraBold.ttf in Resources */, D7D24D152AC1B4E800C6F35B /* NotoSans-Light.ttf in Resources */, + D783C77D2B1089B200622CC2 /* assistant_third_party_default_values in Resources */, D7D24D162AC1B4E800C6F35B /* NotoSans-SemiBold.ttf in Resources */, D7D24D172AC1B4E800C6F35B /* NotoSans-Bold.ttf in Resources */, D719ABBF2ABC67BF00B41C10 /* Preview Assets.xcassets in Resources */, @@ -506,6 +513,7 @@ D7D24D132AC1B4E800C6F35B /* NotoSans-Medium.ttf in Resources */, D732A90C2B0376F500DB42BA /* linphonerc-default in Resources */, D732A90D2B0376F500DB42BA /* linphonerc-factory in Resources */, + D783C77C2B1089B200622CC2 /* assistant_linphone_default_values in Resources */, D70C93DE2AC2D0F60063CA3B /* Localizable.xcstrings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Linphone/Contacts/ContactsManager.swift b/Linphone/Contacts/ContactsManager.swift index 44149bb49..eafa75152 100644 --- a/Linphone/Contacts/ContactsManager.swift +++ b/Linphone/Contacts/ContactsManager.swift @@ -67,9 +67,6 @@ final class ContactsManager { do { self.linphoneFriendList = try core.getFriendListByName(name: self.linphoneAddressBookFriendList) ?? core.createFriendList() - - //self.linphoneFriendList?.updateSubscriptions() - print("friendListfriendListfriendListfriendList \(self.linphoneFriendList!.rlsAddress)") } catch let error { print("\(#function) - Failed to enumerate contacts: \(error)") } @@ -239,7 +236,11 @@ final class ContactsManager { friend.organization = contact.organizationName friend.jobTitle = contact.jobTitle + try friend.setSubscribesenabled(newValue: false) + try friend.setIncsubscribepolicy(newValue: .SPDeny) + friend.done() + completion(friend) } catch let error { print("Failed to enumerate contact", error) diff --git a/Linphone/Core/CoreContext.swift b/Linphone/Core/CoreContext.swift index ecb07e916..9f8e1d5bf 100644 --- a/Linphone/Core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -87,10 +87,7 @@ final class CoreContext: ObservableObject { self.mCore.autoIterateEnabled = false self.mCore.friendsDatabasePath = "\(configDir)/friends.db" - //self.mCore.logCollectionUploadServerUrl = "https://www.linphone.org:444/lft.php" - //self.mCore.friendListSubscriptionEnabled = true - - print("configDirconfigDir \(configDir)") + self.mCore.friendListSubscriptionEnabled = true self.mCore.publisher?.onGlobalStateChanged?.postOnMainQueue { (cbVal: (core: Core, state: GlobalState, message: String)) in if cbVal.state == GlobalState.On { diff --git a/Linphone/Ressources/assistant_linphone_default_values b/Linphone/Ressources/assistant_linphone_default_values new file mode 100644 index 000000000..f3723d7a9 --- /dev/null +++ b/Linphone/Ressources/assistant_linphone_default_values @@ -0,0 +1,36 @@ + + +
+ 1 + 0 + 1 + 120 + sip:voip-metrics@sip.linphone.org;transport=tls + 1 + 180 + 31536000 + sip:?@sip.linphone.org + <sip:sip.linphone.org;transport=tls> + <sip:sip.linphone.org;transport=tls> + 1 + nat_policy_default_values + sip.linphone.org + sip:conference-factory@sip.linphone.org + sip:videoconference-factory@sip.linphone.org + 1 + 1 + 1 + https://lime.linphone.org/lime-server/lime-server.php +
+
+ stun.linphone.org + stun,ice +
+
+ zrtp + 1 +
+
+ 1 +
+
diff --git a/Linphone/Ressources/assistant_third_party_default_values b/Linphone/Ressources/assistant_third_party_default_values new file mode 100644 index 000000000..78927cf4e --- /dev/null +++ b/Linphone/Ressources/assistant_third_party_default_values @@ -0,0 +1,25 @@ + + +
+ 0 + 0 + 0 + -1 + + 0 + 0 + 3600 + + + + 1 + + + + + 0 + 0 + 0 + +
+
diff --git a/Linphone/Ressources/linphonerc-default b/Linphone/Ressources/linphonerc-default index 46ca19ac0..ea5356429 100644 --- a/Linphone/Ressources/linphonerc-default +++ b/Linphone/Ressources/linphonerc-default @@ -16,7 +16,6 @@ update_presence_model_timestamp_before_publish_expires_refresh=1 #Because dynamic bitrate adaption can increase bitrate, we must allow "no limit" download_bw=0 upload_bw=0 -friendlist_subscription_enabled=1 [video] size=vga diff --git a/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift b/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift index 7462e16dd..e9150c82c 100644 --- a/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift +++ b/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift @@ -35,6 +35,17 @@ class AccountLoginViewModel: ObservableObject { func login() { coreContext.doOnCoreQueue { core in do { + + if self.domain != "sip.linphone.org" { + if let assistantLinphone = Bundle.main.path(forResource: "assistant_third_party_default_values", ofType: nil) { + core.loadConfigFromXml(xmlUri: assistantLinphone) + } + } else { + if let assistantLinphone = Bundle.main.path(forResource: "assistant_linphone_default_values", ofType: nil) { + core.loadConfigFromXml(xmlUri: assistantLinphone) + } + } + // Get the transport protocol to use. // TLS is strongly recommended // Only use UDP if you don't have the choice diff --git a/Linphone/UI/Main/Fragments/SideMenu.swift b/Linphone/UI/Main/Fragments/SideMenu.swift index 8da7a0086..60f3c9606 100644 --- a/Linphone/UI/Main/Fragments/SideMenu.swift +++ b/Linphone/UI/Main/Fragments/SideMenu.swift @@ -78,7 +78,6 @@ struct SideMenu: View { let newCoreDelegate = CoreDelegateStub( onLogCollectionUploadStateChanged: { core, logCollectionUploadState, logString in - print("newCoreDelegatenewCoreDelegate \(logString)") if logString.starts(with: "https") { UIPasteboard.general.setValue( diff --git a/Linphone/Utils/Avatar.swift b/Linphone/Utils/Avatar.swift index 5597ba38a..16d3f9fba 100644 --- a/Linphone/Utils/Avatar.swift +++ b/Linphone/Utils/Avatar.swift @@ -83,10 +83,8 @@ struct Avatar: View { } func addDelegate() { - print("onPresenceReceivedonPresenceReceived \(friend.name) \(friend.consolidatedPresence)") let newFriendDelegate = FriendDelegateStub( onPresenceReceived: { (linphoneFriend: Friend) -> Void in - print("onPresenceReceivedonPresenceReceived delegate \(friend.name) \(friend.consolidatedPresence) \(linphoneFriend.consolidatedPresence)") self.presenceImage = linphoneFriend.consolidatedPresence == ConsolidatedPresence.Online ? "presence-online" : "presence-busy" } )