forked from mirrors/linphone-iphone
Add assistant config files (linphone and third party)
Fix presence
This commit is contained in:
parent
b576785399
commit
07b2c1e04e
9 changed files with 85 additions and 11 deletions
|
|
@ -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 = "<group>"; };
|
||||
D78290B72ADD3910004AA85C /* ContactsFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsFragment.swift; sourceTree = "<group>"; };
|
||||
D78290BA2ADD40B2004AA85C /* ContactViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactViewModel.swift; sourceTree = "<group>"; };
|
||||
D783C77A2B1089B200622CC2 /* assistant_linphone_default_values */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = assistant_linphone_default_values; sourceTree = "<group>"; };
|
||||
D783C77B2B1089B200622CC2 /* assistant_third_party_default_values */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = assistant_third_party_default_values; sourceTree = "<group>"; };
|
||||
D796F1FF2B0BB61A0041115F /* ToastViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastViewModel.swift; sourceTree = "<group>"; };
|
||||
D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsView.swift; sourceTree = "<group>"; };
|
||||
D7A03FBF2ACC2E390081A588 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
36
Linphone/Ressources/assistant_linphone_default_values
Normal file
36
Linphone/Ressources/assistant_linphone_default_values
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
||||
<section name="proxy_default_values">
|
||||
<entry name="avpf" overwrite="true">1</entry>
|
||||
<entry name="dial_escape_plus" overwrite="true">0</entry>
|
||||
<entry name="publish" overwrite="true">1</entry>
|
||||
<entry name="publish_expires" overwrite="true">120</entry>
|
||||
<entry name="quality_reporting_collector" overwrite="true">sip:voip-metrics@sip.linphone.org;transport=tls</entry>
|
||||
<entry name="quality_reporting_enabled" overwrite="true">1</entry>
|
||||
<entry name="quality_reporting_interval" overwrite="true">180</entry>
|
||||
<entry name="reg_expires" overwrite="true">31536000</entry>
|
||||
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
|
||||
<entry name="reg_proxy" overwrite="true"><sip:sip.linphone.org;transport=tls></entry>
|
||||
<entry name="reg_route" overwrite="true"><sip:sip.linphone.org;transport=tls></entry>
|
||||
<entry name="reg_sendregister" overwrite="true">1</entry>
|
||||
<entry name="nat_policy_ref" overwrite="true">nat_policy_default_values</entry>
|
||||
<entry name="realm" overwrite="true">sip.linphone.org</entry>
|
||||
<entry name="conference_factory_uri" overwrite="true">sip:conference-factory@sip.linphone.org</entry>
|
||||
<entry name="audio_video_conference_factory_uri" overwrite="true">sip:videoconference-factory@sip.linphone.org</entry>
|
||||
<entry name="push_notification_allowed" overwrite="true">1</entry>
|
||||
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
|
||||
<entry name="rtp_bundle" overwrite="true">1</entry>
|
||||
<entry name="lime_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>
|
||||
</section>
|
||||
<section name="nat_policy_default_values">
|
||||
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>
|
||||
<entry name="protocols" overwrite="true">stun,ice</entry>
|
||||
</section>
|
||||
<section name="sip">
|
||||
<entry name="media_encryption" overwrite="true">zrtp</entry>
|
||||
<entry name="media_encryption_mandatory" overwrite="true">1</entry>
|
||||
</section>
|
||||
<section name="net">
|
||||
<entry name="friendlist_subscription_enabled" overwrite="true">1</entry>
|
||||
</section>
|
||||
</config>
|
||||
25
Linphone/Ressources/assistant_third_party_default_values
Normal file
25
Linphone/Ressources/assistant_third_party_default_values
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
||||
<section name="proxy_default_values">
|
||||
<entry name="avpf" overwrite="true">0</entry>
|
||||
<entry name="dial_escape_plus" overwrite="true">0</entry>
|
||||
<entry name="publish" overwrite="true">0</entry>
|
||||
<entry name="publish_expires" overwrite="true">-1</entry>
|
||||
<entry name="quality_reporting_collector" overwrite="true"></entry>
|
||||
<entry name="quality_reporting_enabled" overwrite="true">0</entry>
|
||||
<entry name="quality_reporting_interval" overwrite="true">0</entry>
|
||||
<entry name="reg_expires" overwrite="true">3600</entry>
|
||||
<entry name="reg_identity" overwrite="true"></entry>
|
||||
<entry name="reg_proxy" overwrite="true"></entry>
|
||||
<entry name="reg_route" overwrite="true"></entry>
|
||||
<entry name="reg_sendregister" overwrite="true">1</entry>
|
||||
<entry name="nat_policy_ref" overwrite="true"></entry>
|
||||
<entry name="realm" overwrite="true"></entry>
|
||||
<entry name="conference_factory_uri" overwrite="true"></entry>
|
||||
<entry name="audio_video_conference_factory_uri" overwrite="true"></entry>
|
||||
<entry name="push_notification_allowed" overwrite="true">0</entry>
|
||||
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">0</entry>
|
||||
<entry name="rtp_bundle" overwrite="true">0</entry>
|
||||
<entry name="lime_server_url" overwrite="true"></entry>
|
||||
</section>
|
||||
</config>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue