Merge branch 'master' into dev_group_chat

This commit is contained in:
Benjamin Reis 2017-09-29 10:14:12 +02:00
commit e484333aa0
15 changed files with 119 additions and 53 deletions

View file

@ -192,17 +192,27 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)coreUpdateEvent:(NSNotification *)notif {
if (IPAD) {
if (linphone_core_video_display_enabled(LC) && linphone_core_video_preview_enabled(LC)) {
linphone_core_set_native_preview_window_id(LC, (__bridge void *)(_videoPreview));
[_backgroundView setHidden:FALSE];
[_videoCameraSwitch setHidden:FALSE];
} else {
linphone_core_set_native_preview_window_id(LC, NULL);
[_backgroundView setHidden:TRUE];
[_videoCameraSwitch setHidden:TRUE];
@try {
if (IPAD) {
if (linphone_core_video_display_enabled(LC) && linphone_core_video_preview_enabled(LC)) {
linphone_core_set_native_preview_window_id(LC, (__bridge void *)(_videoPreview));
[_backgroundView setHidden:FALSE];
[_videoCameraSwitch setHidden:FALSE];
} else {
linphone_core_set_native_preview_window_id(LC, NULL);
[_backgroundView setHidden:TRUE];
[_videoCameraSwitch setHidden:TRUE];
}
}
}
@catch (NSException *exception) {
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
LOGE(@"Core already destroyed");
return;
}
LOGE(@"Uncaught exception : %@", exception.description);
abort();
}
}
#pragma mark - Debug Functions

View file

@ -97,7 +97,17 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Event Functions
- (void)coreUpdateEvent:(NSNotification *)notif {
[self update];
@try {
[self update];
}
@catch (NSException *exception) {
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
LOGE(@"Core already destroyed");
return;
}
LOGE(@"Uncaught exception : %@", exception.description);
abort();
}
}
- (void) deviceOrientationDidChange:(NSNotification*) notif {

View file

@ -81,8 +81,18 @@
#pragma mark - Event Functions
- (void)coreUpdateEvent:(NSNotification *)notif {
// Invalid all pointers
[self loadData];
@try {
// Invalid all pointers
[self loadData];
}
@catch (NSException *exception) {
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
LOGE(@"Core already destroyed");
return;
}
LOGE(@"Uncaught exception : %@", exception.description);
abort();
}
}
#pragma mark - Property Functions

View file

@ -814,6 +814,8 @@ didInvalidatePushTokenForType:(NSString *)type {
}
#pragma mark - NSUser notifications
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wstrict-prototypes"
- (void)application:(UIApplication *)application
handleActionWithIdentifier:(NSString *)identifier
@ -894,7 +896,7 @@ didInvalidatePushTokenForType:(NSString *)type {
}
completionHandler();
}
#pragma clang diagnostic pop
#pragma deploymate pop
#pragma mark - Remote configuration Functions (URL Handler)

View file

@ -36,6 +36,7 @@
#import "Utils/AudioHelper.h"
#import "Utils/FileTransferDelegate.h"
#include "linphone/factory.h"
#include "linphone/linphonecore_utils.h"
#include "linphone/lpconfig.h"
#include "mediastreamer2/mscommon.h"
@ -610,7 +611,7 @@ static void linphone_iphone_log_user_warning(struct _LinphoneCore *lc, const cha
static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char *message) {
NSString *status = [[NSString alloc] initWithCString:message encoding:[NSString defaultCStringEncoding]];
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) displayStatus:status];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) displayStatus:status];
}
#pragma mark - Call State Functions
@ -985,7 +986,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState state,
const char *message) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onCall:call StateChanged:state withMessage:message];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onCall:call StateChanged:state withMessage:message];
}
#pragma mark - Transfert State Functions
@ -996,7 +997,7 @@ static void linphone_iphone_transfer_state_changed(LinphoneCore *lc, LinphoneCal
#pragma mark - Global state change
static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onGlobalStateChanged:gstate withMessage:message];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onGlobalStateChanged:gstate withMessage:message];
}
- (void)onGlobalStateChanged:(LinphoneGlobalState)state withMessage:(const char *)message {
@ -1022,7 +1023,7 @@ static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGloba
static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, LinphoneConfiguringState status,
const char *message) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onConfiguringStatusChanged:status withMessage:message];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onConfiguringStatusChanged:status withMessage:message];
}
- (void)onConfiguringStatusChanged:(LinphoneConfiguringState)status withMessage:(const char *)message {
@ -1127,15 +1128,17 @@ static void linphone_iphone_configuring_status_changed(LinphoneCore *lc, Linphon
static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyConfig *cfg,
LinphoneRegistrationState state, const char *message) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onRegister:lc cfg:cfg state:state message:message];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onRegister:lc cfg:cfg state:state message:message];
}
#pragma mark - Auth info Function
static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char *realmC, const char *usernameC,
const char *domainC) {
static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAuthInfo *auth_info, LinphoneAuthMethod method) {
// let the wizard handle its own errors
if ([PhoneMainView.instance currentView] != AssistantView.compositeViewDescription) {
const char * realmC = linphone_auth_info_get_realm(auth_info);
const char * usernameC = linphone_auth_info_get_username(auth_info);
const char * domainC = linphone_auth_info_get_domain(auth_info);
static UIAlertController *alertView = nil;
// avoid having multiple popups
@ -1370,7 +1373,7 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, const char
}
static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onMessageReceived:lc room:room message:message];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onMessageReceived:lc room:room message:message];
}
static void linphone_iphone_message_received_unable_decrypt(LinphoneCore *lc, LinphoneChatRoom *room,
@ -1465,7 +1468,7 @@ static void linphone_iphone_message_received_unable_decrypt(LinphoneCore *lc, Li
static void linphone_iphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event,
const LinphoneContent *body) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onNotifyReceived:lc
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onNotifyReceived:lc
event:lev
notifyEvent:notified_event
content:body];
@ -1488,7 +1491,7 @@ static void linphone_iphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev
static void linphone_iphone_notify_presence_received_for_uri_or_tel(LinphoneCore *lc, LinphoneFriend *lf,
const char *uri_or_tel,
const LinphonePresenceModel *presence_model) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onNotifyPresenceReceivedForUriOrTel:lc
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onNotifyPresenceReceivedForUriOrTel:lc
friend:lf
uri:uri_or_tel
presenceModel:presence_model];
@ -1496,7 +1499,7 @@ static void linphone_iphone_notify_presence_received_for_uri_or_tel(LinphoneCore
static void linphone_iphone_call_encryption_changed(LinphoneCore *lc, LinphoneCall *call, bool_t on,
const char *authentication_token) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onCallEncryptionChanged:lc
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onCallEncryptionChanged:lc
call:call
on:on
token:authentication_token];
@ -1580,7 +1583,7 @@ static void linphone_iphone_call_encryption_changed(LinphoneCore *lc, LinphoneCa
}
static void linphone_iphone_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) {
[(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onMessageComposeReceived:lc forRoom:room];
[(__bridge LinphoneManager *)linphone_core_cbs_get_user_data(linphone_core_get_current_callbacks(lc)) onMessageComposeReceived:lc forRoom:room];
}
#pragma mark - Network Functions
@ -1834,23 +1837,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
}
#pragma mark - VTable
static LinphoneCoreVTable linphonec_vtable = {
.call_state_changed = (LinphoneCoreCallStateChangedCb)linphone_iphone_call_state,
.registration_state_changed = linphone_iphone_registration_state,
.notify_presence_received_for_uri_or_tel = linphone_iphone_notify_presence_received_for_uri_or_tel,
.auth_info_requested = linphone_iphone_popup_password_request,
.message_received = linphone_iphone_message_received,
.message_received_unable_decrypt = linphone_iphone_message_received_unable_decrypt,
.transfer_state_changed = linphone_iphone_transfer_state_changed,
.is_composing_received = linphone_iphone_is_composing_received,
.configuring_status = linphone_iphone_configuring_status_changed,
.global_state_changed = linphone_iphone_global_state_changed,
.notify_received = linphone_iphone_notify_received,
.call_encryption_changed = linphone_iphone_call_encryption_changed,
};
#pragma mark -
// scheduling loop
@ -2082,7 +2068,26 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat
[self lpConfigSetString:[LinphoneManager bundleFile:ringback] forKey:@"remote_ring" inSection:@"sound"];
[self lpConfigSetString:[LinphoneManager bundleFile:hold] forKey:@"hold_music" inSection:@"sound"];
theLinphoneCore = linphone_core_new_with_config(&linphonec_vtable, _configDb, (__bridge void *)(self));
LinphoneFactory *factory = linphone_factory_get();
LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(factory);
linphone_core_cbs_set_call_state_changed(cbs, linphone_iphone_call_state);
linphone_core_cbs_set_registration_state_changed(cbs,linphone_iphone_registration_state);
linphone_core_cbs_set_notify_presence_received_for_uri_or_tel(cbs, linphone_iphone_notify_presence_received_for_uri_or_tel);
linphone_core_cbs_set_authentication_requested(cbs, linphone_iphone_popup_password_request);
linphone_core_cbs_set_message_received(cbs, linphone_iphone_message_received);
linphone_core_cbs_set_message_received_unable_decrypt(cbs, linphone_iphone_message_received_unable_decrypt);
linphone_core_cbs_set_transfer_state_changed(cbs, linphone_iphone_transfer_state_changed);
linphone_core_cbs_set_is_composing_received(cbs, linphone_iphone_is_composing_received);
linphone_core_cbs_set_configuring_status(cbs, linphone_iphone_configuring_status_changed);
linphone_core_cbs_set_global_state_changed(cbs, linphone_iphone_global_state_changed);
linphone_core_cbs_set_notify_received(cbs, linphone_iphone_notify_received);
linphone_core_cbs_set_call_encryption_changed(cbs, linphone_iphone_call_encryption_changed);
linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self));
theLinphoneCore = linphone_factory_create_core_with_config(factory, cbs, _configDb);
// Let the core handle cbs
linphone_core_cbs_unref(cbs);
LOGI(@"Create linphonecore %p", theLinphoneCore);
// Load plugins if available in the linphone SDK - otherwise these calls will do nothing

View file

@ -61,7 +61,7 @@
stderrInUse = YES;
}
linphone_core_set_log_collection_path([self cacheDirectory].UTF8String);
linphone_core_enable_logs_with_cb(linphone_iphone_log_handler);
linphone_core_set_log_handler(linphone_iphone_log_handler);
linphone_core_enable_log_collection(enabled);
if (level == 0) {
linphone_core_set_log_level(ORTP_FATAL);

View file

@ -129,8 +129,9 @@
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "linphone_icon_1024.png",
"scale" : "1x"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -128,7 +128,7 @@
linphone_address_set_transport(testAddr, LinphoneTransportTcp);
linphone_address_set_port(testAddr, 0);
LinphoneProxyConfig *testProxy = linphone_proxy_config_new();
LinphoneProxyConfig *testProxy = linphone_core_create_proxy_config(LC);
linphone_proxy_config_set_identity_address(testProxy, testAddr);
linphone_proxy_config_set_server_addr(testProxy, [self accountProxyRoute].UTF8String);
linphone_proxy_config_set_route(testProxy, [self accountProxyRoute].UTF8String);
@ -145,7 +145,7 @@
[[LinphoneManager instance] configurePushTokenForProxyConfig:testProxy];
linphone_proxy_config_unref(testProxy);
linphone_auth_info_destroy(testAuth);
linphone_auth_info_unref(testAuth);
linphone_address_unref(testAddr);
linphone_core_set_file_transfer_server(lc, "https://www.linphone.org:444/lft.php");

View file

@ -53,7 +53,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>ITSAppUsesNonExemptEncryption</key>
<true/>
<key>ITSEncryptionExportComplianceCode</key>

View file

@ -3131,7 +3131,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0900;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {
DevelopmentTeam = Z2V957B3D6;
@ -4570,12 +4570,18 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -4667,12 +4673,18 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -4764,12 +4776,18 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -4861,12 +4879,18 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@ -69,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

@ -1 +1 @@
Subproject commit 5bcddfbf5d3433723919cd540cd23040e3b88255
Subproject commit 99773d23d71b78c75a8b2eb7ec91e7c3a69777f5

@ -1 +1 @@
Subproject commit 056f9435e9131474dfe497176c9fa9b5257546fb
Subproject commit 6024a8fd4e85faeb18e3ee6ec91c9276f2ee4293