diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h
index 8b0076e3c..6ab39badf 100644
--- a/Classes/LinphoneAppDelegate.h
+++ b/Classes/LinphoneAppDelegate.h
@@ -32,12 +32,14 @@
UIWindow *window;
BOOL started;
int savedMaxCall;
-
}
- (void)processRemoteNotification:(NSDictionary*)userInfo;
@property (assign) BOOL started;
+@property (nonatomic, retain) UIAlertView *waitingIndicator;
+@property (nonatomic, retain) NSString *configURL;
+
@end
diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m
index 4ee7534ca..98866b67f 100644
--- a/Classes/LinphoneAppDelegate.m
+++ b/Classes/LinphoneAppDelegate.m
@@ -36,7 +36,7 @@
@implementation LinphoneAppDelegate
-@synthesize started;
+@synthesize started,configURL;
#pragma mark - Lifecycle Functions
@@ -91,31 +91,31 @@
- (void)applicationDidBecomeActive:(UIApplication *)application {
[LinphoneLogger logc:LinphoneLoggerLog format:"applicationDidBecomeActive"];
-
+
[self startApplication];
LinphoneManager* instance = [LinphoneManager instance];
-
- [instance becomeActive];
+
+ [instance becomeActive];
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
-
- if (call){
- if (call == instance->currentCallContextBeforeGoingBackground.call) {
- const LinphoneCallParams* params = linphone_call_get_current_params(call);
- if (linphone_call_params_video_enabled(params)) {
- linphone_call_enable_camera(
- call,
- instance->currentCallContextBeforeGoingBackground.cameraIsEnabled);
- }
- instance->currentCallContextBeforeGoingBackground.call = 0;
- } else if ( linphone_call_get_state(call) == LinphoneCallIncomingReceived ) {
+
+ if (call){
+ if (call == instance->currentCallContextBeforeGoingBackground.call) {
+ const LinphoneCallParams* params = linphone_call_get_current_params(call);
+ if (linphone_call_params_video_enabled(params)) {
+ linphone_call_enable_camera(
+ call,
+ instance->currentCallContextBeforeGoingBackground.cameraIsEnabled);
+ }
+ instance->currentCallContextBeforeGoingBackground.call = 0;
+ } else if ( linphone_call_get_state(call) == LinphoneCallIncomingReceived ) {
[[PhoneMainView instance ] displayIncomingCall:call];
// in this case, the ringing sound comes from the notification.
// To stop it we have to do the iOS7 ring fix...
[self fixRing];
}
- }
+ }
}
@@ -177,19 +177,31 @@
}
}
-
- (void)applicationWillTerminate:(UIApplication *)application {
[LinphoneLogger log:LinphoneLoggerLog format:@"Application Will Terminate"];
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
- [self startApplication];
- if([LinphoneManager isLcReady]) {
- if([[url scheme] isEqualToString:@"sip"]) {
- // Go to Dialer view
- DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
- if(controller != nil) {
- [controller setAddress:[url absoluteString]];
+ NSString *scheme = [[url scheme] lowercaseString];
+ if ([scheme isEqualToString:@"linphone-config-http"] || [scheme isEqualToString:@"linphone-config-https"]) {
+ configURL = [[NSString alloc] initWithString:[[url absoluteString] stringByReplacingOccurrencesOfString:@"linphone-config-" withString:@""]];
+ UIAlertView* confirmation = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Remote configuration",nil)
+ message:NSLocalizedString(@"This operation will load a remote configuration. Continue ?",nil)
+ delegate:self
+ cancelButtonTitle:NSLocalizedString(@"No",nil)
+ otherButtonTitles:NSLocalizedString(@"Yes",nil),nil];
+ confirmation.tag = 1;
+ [confirmation show];
+ [confirmation release];
+ } else {
+ [self startApplication];
+ if([LinphoneManager isLcReady]) {
+ if([[url scheme] isEqualToString:@"sip"]) {
+ // Go to Dialer view
+ DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
+ if(controller != nil) {
+ [controller setAddress:[url absoluteString]];
+ }
}
}
}
@@ -309,4 +321,95 @@
[[LinphoneManager instance] setPushNotificationToken:nil];
}
+#pragma mark - Remote configuration Functions (URL Handler)
+
+
+- (void)ConfigurationStateUpdateEvent: (NSNotification*) notif {
+ LinphoneConfiguringState state = [[notif.userInfo objectForKey: @"state"] intValue];
+ if (state == LinphoneConfiguringSuccessful) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:kLinphoneConfiguringStateUpdate
+ object:nil];
+ [_waitingIndicator dismissWithClickedButtonIndex:0 animated:true];
+
+ UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Success",nil)
+ message:NSLocalizedString(@"Remote configuration successfully fetched and applied.",nil)
+ delegate:nil
+ cancelButtonTitle:NSLocalizedString(@"OK",nil)
+ otherButtonTitles:nil];
+ [error show];
+ [error release];
+ [[PhoneMainView instance] startUp];
+ }
+ if (state == LinphoneConfiguringFailed) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:kLinphoneConfiguringStateUpdate
+ object:nil];
+ [_waitingIndicator dismissWithClickedButtonIndex:0 animated:true];
+ UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Failure",nil)
+ message:NSLocalizedString(@"Failed configuring from the specified URL." ,nil)
+ delegate:nil
+ cancelButtonTitle:NSLocalizedString(@"OK",nil)
+ otherButtonTitles:nil];
+ [error show];
+ [error release];
+
+ }
+}
+
+
+- (void) showWaitingIndicator {
+ _waitingIndicator = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Fetching remote configuration...",nil) message:@"" delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
+ UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 60, 30, 30)];
+ progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
+ [_waitingIndicator setValue:progress forKey:@"accessoryView"];
+ [progress setColor:[UIColor blackColor]];
+ } else {
+ [_waitingIndicator addSubview:progress];
+ }
+ [progress startAnimating];
+ [_waitingIndicator show];
+
+}
+
+
+- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
+{
+ if ((alertView.tag == 1) && (buttonIndex==1)) {
+ [self showWaitingIndicator];
+ if([LinphoneManager isLcReady]) {
+ [self attemptRemoteConfiguration];
+ } else {
+ [[LinphoneManager instance] startLibLinphone];
+ [self performSelector:@selector(attemptRemoteConfiguration) withObject:NULL afterDelay:5.0];
+ }
+ }
+
+}
+
+- (void)attemptRemoteConfiguration {
+
+ if ([LinphoneManager isLcReady]) {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(ConfigurationStateUpdateEvent:)
+ name:kLinphoneConfiguringStateUpdate
+ object:nil];
+ linphone_core_set_provisioning_uri([LinphoneManager getLc] , [configURL UTF8String]);
+ [[LinphoneManager instance] destroyLibLinphone];
+ [[LinphoneManager instance] startLibLinphone];
+ } else {
+ [_waitingIndicator dismissWithClickedButtonIndex:0 animated:true];
+ UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Failure",nil)
+ message:NSLocalizedString(@"Linphone is not ready.",nil)
+ delegate:nil
+ cancelButtonTitle:NSLocalizedString(@"OK",nil)
+ otherButtonTitles:nil];
+ [error show];
+ [error release];
+
+ }
+}
+
+
@end
diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m
index 92314ade7..2ab6d32ee 100644
--- a/Classes/LinphoneManager.m
+++ b/Classes/LinphoneManager.m
@@ -63,27 +63,17 @@ NSString *const kLinphoneConfiguringStateUpdate = @"LinphoneConfiguringStateUpda
NSString *const kLinphoneGlobalStateUpdate = @"LinphoneGlobalStateUpdate";
-extern void libmsilbc_init();
-#ifdef HAVE_AMR
-extern void libmsamr_init();
-#endif
+extern void libmsilbc_init(void);
+extern void libmsamr_init(void);
+extern void libmsx264_init(void);
+extern void libmsopenh264_init(void);
+extern void libmssilk_init(void);
+extern void libmsbcg729_init(void);
-#ifdef HAVE_X264
-extern void libmsx264_init();
-#endif
-#ifdef HAVE_OPENH264
-extern void libmsopenh264_init();
-#endif
#define FRONT_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/
#define BACK_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:0" /*"AV Capture: Back Camera"*/
-#if defined (HAVE_SILK)
-extern void libmssilk_init();
-#endif
-#if HAVE_G729
-extern void libmsbcg729_init();
-#endif
@implementation LinphoneCallAppData
- (id)init {
if ((self = [super init])) {
@@ -1043,9 +1033,10 @@ static LinphoneCoreVTable linphonec_vtable = {
}
+static BOOL libStarted = FALSE;
+
- (void)startLibLinphone {
- static BOOL libStarted = FALSE;
if ( libStarted ) {
[LinphoneLogger logc:LinphoneLoggerError format:"Liblinphone is already initialized!"];
return;
@@ -1170,6 +1161,7 @@ static LinphoneCoreVTable linphonec_vtable = {
proxyReachability=nil;
}
+ libStarted = FALSE;
}
- (void) resetLinphoneCore {
diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m
index 99a8835fb..787f07279 100644
--- a/Classes/LinphoneUI/UIStateBar.m
+++ b/Classes/LinphoneUI/UIStateBar.m
@@ -130,7 +130,7 @@ NSTimer *callSecurityTimer;
}
- (void) globalStateUpdate:(NSNotification*) notif {
- [self registrationUpdate:notif];
+ if ([LinphoneManager isLcReady]) [self registrationUpdate:notif];
}
diff --git a/README b/README
index b570a7a8a..bea355f16 100644
--- a/README
+++ b/README
@@ -71,8 +71,8 @@ After the SDK is built, just open the linphone xcode project with Xcode, and pre
* Note regarding third party components subject to license
-The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and X264 codecs.
-Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_X264 positioned in xcode project.
+The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
+Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_OPENH264 positioned in xcode project.
Before embeding these 4 codecs in the final application, make sure to have the right to do so.
LIMITATIONS, KNOWN BUGS
diff --git a/linphone-Info.plist b/linphone-Info.plist
index b776fd5d1..8c7ffad31 100644
--- a/linphone-Info.plist
+++ b/linphone-Info.plist
@@ -74,6 +74,30 @@
sip
+
+ CFBundleTypeRole
+ Viewer
+ CFBundleURLIconFile
+ linphone_icon_72@2x
+ CFBundleURLName
+ org.linphone.phone
+ CFBundleURLSchemes
+
+ linphone-config-http
+
+
+
+ CFBundleTypeRole
+ Viewer
+ CFBundleURLIconFile
+ linphone_icon_72@2x
+ CFBundleURLName
+ org.linphone.phone
+ CFBundleURLSchemes
+
+ linphone-config-https
+
+
CFBundleVersion
2.1.2
diff --git a/submodules/belle-sip b/submodules/belle-sip
index e4616ba4e..1b86808a1 160000
--- a/submodules/belle-sip
+++ b/submodules/belle-sip
@@ -1 +1 @@
-Subproject commit e4616ba4eba8e590175dd85cc872257b92aa52f4
+Subproject commit 1b86808a1b7c6803b71b8d08607b3a0d7a2e9ea9
diff --git a/submodules/build/Makefile b/submodules/build/Makefile
index e05559eea..bdf569abe 100644
--- a/submodules/build/Makefile
+++ b/submodules/build/Makefile
@@ -30,10 +30,6 @@ enable_debug=no
# check that the selected options are correct
CHECKOPT_MSG := ""
-ifeq ($(enable_gpl_third_parties)$(enable_zrtp),noyes)
- CHECKOPT_MSG += "ZRTP is not available in non-gpl build. disabling\n"
- enable_zrtp=no
-endif
ifeq ($(enable_gpl_third_parties)$(enable_ffmpeg),noyes)
# ffmpeg is not compatible with no GPL.
diff --git a/submodules/build/builders.d/openh264-permissive.patch b/submodules/build/builders.d/openh264-permissive.patch
new file mode 100644
index 000000000..859db1ee1
--- /dev/null
+++ b/submodules/build/builders.d/openh264-permissive.patch
@@ -0,0 +1,53 @@
+commit 6b3de978d928b6c0baec3305c9803c21a4367d0c
+Author: Simon Morlat
+Date: Tue Apr 15 15:19:37 2014 +0200
+
+ permissive mode: allow reference frames to be used even if there were lost slices.
+
+diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp
+index c19f501..a14e971 100644
+--- a/codec/decoder/core/src/decoder_core.cpp
++++ b/codec/decoder/core/src/decoder_core.cpp
+@@ -58,7 +58,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t
+ WelsLog (pCtx, WELS_LOG_WARNING,
+ "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d --\n",
+ pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight);
+- return -1;
++ //return -1;
+ }
+ #ifdef NO_WAITING_AU
+ pCtx->iTotalNumMbRec = 0;
+diff --git a/codec/decoder/core/src/manage_dec_ref.cpp b/codec/decoder/core/src/manage_dec_ref.cpp
+index dcf61ca..5582ec9 100644
+--- a/codec/decoder/core/src/manage_dec_ref.cpp
++++ b/codec/decoder/core/src/manage_dec_ref.cpp
+@@ -165,6 +165,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
+ && (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check;
+ WelsLog (pCtx, WELS_LOG_WARNING, "WelsReorderRefList()-1::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n",
+ pSliceHeader->iSpsId, ppRefList[i]->iSpsId);
++ return ERR_NONE;
+ pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.--
+ return ERR_INFO_REFERENCE_PIC_LOST;
+ } else {
+
+commit a1f3b95ad18d0788c2c803fac80e78d6365673ce
+Author: Simon Morlat
+Date: Tue Apr 15 17:54:58 2014 +0200
+
+ permissive mode (2)
+
+diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp
+index a14e971..e742dbf 100644
+--- a/codec/decoder/core/src/decoder_core.cpp
++++ b/codec/decoder/core/src/decoder_core.cpp
+@@ -1738,8 +1738,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3
+ if ((iLastIdD < 0) || //case 1: first layer
+ (iLastIdD == iCurrIdD)) { //case 2: same uiDId
+ InitDqLayerInfo (dq_cur, &pLayerInfo, pNalCur, pCtx->pDec);
+-
+- if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
++ if (0){
++ //if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
+ const bool kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag
+ || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);
+ // Subclause 8.2.5.2 Decoding process for gaps in frame_num
diff --git a/submodules/build/builders.d/openh264.mk b/submodules/build/builders.d/openh264.mk
index 9ce4517dd..b229d2899 100644
--- a/submodules/build/builders.d/openh264.mk
+++ b/submodules/build/builders.d/openh264.mk
@@ -32,12 +32,19 @@ endif
openh264_dir?=externals/openh264
-$(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile:
+$(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp:
+ cd $(BUILDER_SRC_DIR)/$(openh264_dir) \
+ && patch -p1 < $(BUILDER_SRC_DIR)/build/builders.d/openh264-permissive.patch
+ touch $(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp
+
+patch-openh264: $(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp
+
+update-openh264: patch-openh264
mkdir -p $(BUILDER_BUILD_DIR)/$(openh264_dir) \
&& cd $(BUILDER_BUILD_DIR)/$(openh264_dir)/ \
- && rsync -rvLpgoc --exclude ".git" $(BUILDER_SRC_DIR)/$(openh264_dir)/* .
+ && rsync -rvLpgoc --exclude ".git" $(BUILDER_SRC_DIR)/$(openh264_dir)/* .
-build-openh264: $(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile
+build-openh264: update-openh264
cd $(BUILDER_BUILD_DIR)/$(openh264_dir) \
&& make libraries OS=ios ARCH=$(ARCH) PREFIX=$(prefix)\
&& make install OS=ios ARCH=$(ARCH) PREFIX=$(prefix)
diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site
index ee81ad99b..995023e4a 100644
--- a/submodules/build/iphone-config.site
+++ b/submodules/build/iphone-config.site
@@ -44,6 +44,10 @@ echo "Selecting SDK path = ${SYSROOT_PATH}"
COMMON_FLAGS=" -arch ${ARCH} ${MCPU} -isysroot ${SYSROOT_PATH} -${CLANG_TARGET_SPECIFIER}=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions"
+#workaround for polarssl conflicting symbols
+
+COMMON_FLAGS="$COMMON_FLAGS -Dsha256=polarssl_sha256"
+
# silence clang unused operators. This is temporary, we should find a way to compile 3rd party with correct flags :(
COMMON_FLAGS="-Qunused-arguments -Wno-unknown-warning-option -Wno-unused-command-line-argument-hard-error-in-future $COMMON_FLAGS"
diff --git a/submodules/bzrtp b/submodules/bzrtp
index 7f4c4333c..8ceda7ef0 160000
--- a/submodules/bzrtp
+++ b/submodules/bzrtp
@@ -1 +1 @@
-Subproject commit 7f4c4333c5d8b3b328815996d0eea061bc539860
+Subproject commit 8ceda7ef0d35130057affc2e5a61c0667cde15aa
diff --git a/submodules/externals/openh264 b/submodules/externals/openh264
index fb5700bd5..b2f7191fa 160000
--- a/submodules/externals/openh264
+++ b/submodules/externals/openh264
@@ -1 +1 @@
-Subproject commit fb5700bd5cc18dd33c120ce9dd5f79b8f1f35f3a
+Subproject commit b2f7191fa7e213f5b63b8e31936b962bae6adc2f
diff --git a/submodules/linphone b/submodules/linphone
index affd02154..9f68674a4 160000
--- a/submodules/linphone
+++ b/submodules/linphone
@@ -1 +1 @@
-Subproject commit affd021540f6f0245803105b9e129521f6ff2a62
+Subproject commit 9f68674a4b10aa6a6907cebf65b941997719e9e7
diff --git a/submodules/msopenh264 b/submodules/msopenh264
index 863889de4..1dc44eb5b 160000
--- a/submodules/msopenh264
+++ b/submodules/msopenh264
@@ -1 +1 @@
-Subproject commit 863889de427c70806d6bda87e2f95c3f38662c23
+Subproject commit 1dc44eb5b824d104f96562e4b5bd28a1ac461525
diff --git a/submodules/mssilk b/submodules/mssilk
index 5a1d028e4..a253e5af9 160000
--- a/submodules/mssilk
+++ b/submodules/mssilk
@@ -1 +1 @@
-Subproject commit 5a1d028e4e012c67940757ea57767fd811eddee7
+Subproject commit a253e5af931cadd5d3c0aff1f56697b2b52c1cfd