Merge branch 'master' into inappsettings

Conflicts:
	Classes/LinphoneUI/LinphoneManager.h
	Classes/LinphoneUI/LinphoneManager.m
	submodules/linphone
This commit is contained in:
Yann Diorcet 2012-06-22 14:46:48 +02:00
commit 53fda0a31b
9 changed files with 111 additions and 65 deletions

View file

@ -667,8 +667,8 @@ void addAnimationFadeTransition(UIView* view, float duration) {
dismissed = false;
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if ([speaker isOn])
[speaker toggle];
//if ([speaker isOn])
// [speaker toggle];
[self updateUIFromLinphoneState: YES];
}
@ -681,7 +681,7 @@ void addAnimationFadeTransition(UIView* view, float duration) {
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if (call !=nil && linphone_call_get_dir(call)==LinphoneCallIncoming) {
if ([speaker isOn]) [speaker toggle];
//if ([speaker isOn]) [speaker toggle];
}
[self updateUIFromLinphoneState: YES];
@ -932,7 +932,11 @@ static void hideSpinner(LinphoneCall* call, void* user_data) {
} else {
switch (linphone_call_get_state(call)) {
case LinphoneCallPaused:
[ms appendFormat:@"%@", NSLocalizedString(@"Paused (tap to resume)", nil), nil];
if(!linphone_core_sound_resources_locked(linphone_call_get_core(call))) {
[ms appendFormat:@"%@", NSLocalizedString(@"Paused (tap to resume)", nil), nil];
} else {
[ms appendFormat:@"%@", NSLocalizedString(@"Paused", nil), nil];
}
break;
case LinphoneCallOutgoingInit:
case LinphoneCallOutgoingProgress:
@ -1242,7 +1246,9 @@ static void hideSpinner(LinphoneCall* call, void* user_data) {
if (linphone_core_is_in_conference(lc)) {
linphone_core_leave_conference(lc);
}
linphone_core_resume_call([LinphoneManager getLc], selectedCall);
if(!linphone_core_sound_resources_locked(lc)) {
linphone_core_resume_call([LinphoneManager getLc], selectedCall);
}
}
[self updateUIFromLinphoneState: YES];

View file

@ -92,7 +92,8 @@ typedef struct _LinphoneCallAppData {
-(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log;
-(UIImage*) getImageFromAddressBook:(NSString*) number;
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx;
-(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)oldSettings;
-(void) setupNetworkReachabilityCallback;
-(void) refreshRegisters;
@property (nonatomic, retain) id<LinphoneUICallDelegate> callDelegate;

View file

@ -178,6 +178,14 @@ struct codec_name_pref_table codec_pref_table[]={
}
-(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message {
if(new_state == LinphoneCallReleased) {
if(linphone_call_get_user_pointer(call) != NULL) {
free (linphone_call_get_user_pointer(call));
linphone_call_set_user_pointer(call, NULL);
}
return;
}
const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
if (new_state == LinphoneCallIncomingReceived) {
@ -306,9 +314,6 @@ struct codec_name_pref_table codec_pref_table[]={
[callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
}
break;
case LinphoneCallReleased:
free (linphone_call_get_user_pointer(call));
break;
default:
break;
}
@ -322,12 +327,9 @@ struct codec_name_pref_table codec_pref_table[]={
}
+(LinphoneCore*) getLc {
#if 0
if (theLinphoneCore==nil) {
@throw([NSException exceptionWithName:@"LinphoneCoreException" reason:@"Linphone core not initialized yet" userInfo:nil]);
}
#else
#endif
return theLinphoneCore;
}
@ -468,6 +470,14 @@ static LinphoneCoreVTable linphonec_vtable = {
};
-(void) configurePayloadType:(const char*) type fromPrefKey: (NSString*)key withRate:(int)rate {
if ([[NSUserDefaults standardUserDefaults] boolForKey:key]) {
PayloadType* pt;
if((pt = linphone_core_find_payload_type(theLinphoneCore,type,rate))) {
linphone_core_enable_payload_type(theLinphoneCore,pt, TRUE);
}
}
}
-(void) kickOffNetworkConnection {
/*start a new thread to avoid blocking the main ui in case of peer host failure*/
[NSThread detachNewThreadSelector:@selector(runNetworkConnection) toTarget:self withObject:nil];
@ -575,7 +585,9 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
// no proxy configured alert
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"check_config_disable_preference"];
}
}
-(void) destroyLibLinphone {
[mIterateTimer invalidate];
@ -631,6 +643,10 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
} else {
ms_warning("keepalive handler cannot be registered");
}
LCSipTransports transportValue;
if (linphone_core_get_sip_transports(theLinphoneCore, &transportValue)) {
ms_error("cannot get current transport");
}
return YES;
}
else {
@ -646,9 +662,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_iterate(theLinphoneCore);
}
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx {
-(void) setupNetworkReachabilityCallback {
SCNetworkReachabilityContext *ctx=NULL;
const char *nodeName="linphone.org";
if (proxyReachability) {
ms_message("Cancel old network reachability check");
ms_message("Cancelling old network reachability");
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
proxyReachability = nil;
@ -723,7 +742,9 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
[self setupNetworkReachabilityCallback: "linphone.org" withContext:nil];
[self setupNetworkReachabilityCallback];
[self reconfigureLinphoneIfNeeded:nil];
// start scheduler
mIterateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1
@ -787,10 +808,14 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_enable_video(theLinphoneCore, FALSE, FALSE);
}
ms_warning("Linphone [%s] started on [%s], running with [%u] processor(s)"
if ([LinphoneManager runningOnIpad])
ms_set_cpu_count(2);
else
ms_set_cpu_count(1);
ms_warning("Linphone [%s] started on [%s]"
,linphone_core_get_version()
,[[UIDevice currentDevice].model cStringUsingEncoding:[NSString defaultCStringEncoding]],
cpucount);
,[[UIDevice currentDevice].model cStringUsingEncoding:[NSString defaultCStringEncoding]] );
}
@ -799,9 +824,16 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
if (proxyReachability){
SCNetworkReachabilityFlags flags=0;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
ms_error("Cannot get reachability flags");
}else
networkReachabilityCallBack(proxyReachability, flags, 0);
ms_error("Cannot get reachability flags, re-creating reachability context.");
[self setupNetworkReachabilityCallback];
}else{
networkReachabilityCallBack(proxyReachability, flags, 0);
if (flags==0){
/*workaround iOS bug: reachability API cease to work after some time.*/
/*when flags==0, either we have no network, or the reachability object lies. To workaround, create a new one*/
[self setupNetworkReachabilityCallback];
}
}
}else ms_error("No proxy reachability context created !");
linphone_core_refresh_registers(theLinphoneCore);//just to make sure REGISTRATION is up to date
}
@ -810,13 +842,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
if (theLinphoneCore == nil) {
//back from standby and background mode is disabled
[self startLibLinphone];
} else {
[self refreshRegisters];
}
/*IOS specific*/
linphone_core_start_dtmf_stream(theLinphoneCore);
}
-(void) registerLogView:(id<LogView>) view {
mLogView = view;
}

View file

@ -22,6 +22,7 @@
#include "linphonecore.h"
@implementation UISpeakerButton
static AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange;
static void audioRouteChangeListenerCallback (
void *inUserData, // 1
@ -36,7 +37,7 @@ static void audioRouteChangeListenerCallback (
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{
[super initWithOnImage:onImage offImage:offImage debugName:name];
AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange;
AudioSessionInitialize(NULL, NULL, NULL, NULL);
OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self);
if (lStatus) {
@ -85,7 +86,11 @@ static void audioRouteChangeListenerCallback (
*/
- (void)dealloc {
[super dealloc];
OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(routeChangeID, audioRouteChangeListenerCallback, self);
if (lStatus) {
ms_error ("cannot un register route change handler [%ld]",lStatus);
}
[super dealloc];
}

View file

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIViewController</string>
@ -325,7 +325,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUINormalTitle">4</string>
<string key="IBUINormalTitle">6</string>
<reference key="IBUIHighlightedTitleColor" ref="839360217"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
@ -371,7 +371,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUINormalTitle">6</string>
<string key="IBUINormalTitle">4</string>
<reference key="IBUIHighlightedTitleColor" ref="839360217"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
@ -583,14 +583,6 @@
</object>
<int key="connectionID">47</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">four</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="803418491"/>
</object>
<int key="connectionID">48</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">hash</string>
@ -623,14 +615,6 @@
</object>
<int key="connectionID">52</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">six</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="34136542"/>
</object>
<int key="connectionID">53</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">star</string>
@ -727,6 +711,22 @@
</object>
<int key="connectionID">62</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">four</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="34136542"/>
</object>
<int key="connectionID">63</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">six</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="803418491"/>
</object>
<int key="connectionID">64</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -940,7 +940,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">62</int>
<int key="maxID">64</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -1121,6 +1121,10 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
@ -1131,6 +1135,6 @@
<string key="startcall-gray.png">{60, 52}</string>
<string key="startcall-green.png">{60, 52}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">933</string>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>

View file

@ -265,9 +265,9 @@
mIncomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Decline",nil)
cancelButtonTitle:nil
destructiveButtonTitle:NSLocalizedString(@"Answer",nil)
otherButtonTitles:nil];
otherButtonTitles:NSLocalizedString(@"Decline",nil),nil];
mIncomingCallActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
if ([LinphoneManager runningOnIpad]) {
@ -315,8 +315,8 @@
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
[mMainScreenWithVideoPreview showPreview:NO];
if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 ||
linphone_call_get_dir(call)==LinphoneCallIncoming)){
if (self.presentedViewController != (UIViewController*)mIncallViewController /*&& (call == 0x0 ||
linphone_call_get_dir(call)==LinphoneCallIncoming)*/){
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
}

View file

@ -24,11 +24,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.5.0</string>
<string>3.5.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.2</string>
<string>1.3</string>
<key>NSMainNibFile</key>
<string>PhoneMainView</string>
<key>NSMainNibFile~ipad</key>

View file

@ -1798,7 +1798,7 @@
HAVE_SILK,
);
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
submodules/linphone/coreapi,
submodules/linphone/mediastreamer2/include,
@ -1837,7 +1837,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 3.1;
LIBRARY_SEARCH_PATHS = "";
LINK_WITH_STANDARD_LIBRARIES = YES;
PROVISIONING_PROFILE = "32E63D15-36ED-474A-8157-8DD0770DF063";
PROVISIONING_PROFILE = "B8ED8915-B69D-40DA-9B89-1700C44B156B";
SDKROOT = iphoneos;
};
name = DistributionAdhoc;
@ -1864,7 +1864,7 @@
HAVE_SILK,
);
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
submodules/linphone/coreapi,
submodules/linphone/mediastreamer2/include,
@ -2140,7 +2140,7 @@
HAVE_SILK,
);
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
submodules/linphone/coreapi,
submodules/linphone/mediastreamer2/include,
@ -2207,7 +2207,7 @@
HAVE_SILK,
);
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
submodules/linphone/coreapi,
submodules/linphone/mediastreamer2/include,

@ -1 +1 @@
Subproject commit 23d589cec01361b7c08528cd7433d5b01c0579bb
Subproject commit 630e26944dd6e5cca53787452b162ec6baf7ba48