Merge branch 'master' of git://git.linphone.org/linphone-iphone into buschjaeger_new_ui

Conflicts:
	Classes/ChatRoomViewController.m
	Classes/HistoryDetailsViewController.m
	Classes/HistoryTableViewController.m
	Classes/InCallViewController.m
	Classes/LinphoneAppDelegate.m
	Classes/LinphoneManager.m
	Classes/LinphoneUI/UIContactDetailsHeader.m
	Classes/LinphoneUI/UIHistoryCell.m
	Classes/PhoneMainView.m
	Resources/en.lproj/Localizable.strings
	Resources/fr.lproj/Localizable.strings
	Resources/ru.lproj/Localizable.strings
	linphone.ldb/Contents.plist
	linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings
	linphone.xcodeproj/project.pbxproj
This commit is contained in:
Yann Diorcet 2013-02-15 11:02:25 +01:00
commit c814450fcf
7 changed files with 37 additions and 12 deletions

View file

@ -147,6 +147,8 @@ typedef struct _LinphoneManagerSounds {
- (void)refreshRegisters;
- (bool)allowSpeaker;
+ (BOOL)copyFile:(NSString*)src destination:(NSString*)dst override:(BOOL)override;
+ (NSString*)bundleFile:(NSString*)file;
+ (NSString*)documentFile:(NSString*)file;

View file

@ -453,7 +453,11 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
/*should we reject this call ?*/
if ([lCTCallCenter currentCalls]!=nil) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",linphone_address_get_username(linphone_call_get_call_log(call)->from)];
char *tmp=linphone_call_get_remote_address_as_string(call);
if (tmp) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",tmp];
ms_free(tmp);
}
linphone_core_decline_call(theLinphoneCore, call,LinphoneReasonBusy);
[lCTCallCenter release];
return;
@ -464,7 +468,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
NSString* callId=[NSString stringWithUTF8String:callLog->call_id];
NSString* callId=[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
if (![[LinphoneManager instance] shouldAutoAcceptCallForCallId:callId]){
NSString *ringtone = [NSString stringWithFormat:@"%@_loop.wav", [[NSUserDefaults standardUserDefaults] stringForKey:@"ringtone_preference"], nil];
@ -494,7 +498,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
// Disable speaker when no more call
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
LinphoneCallLog *log = linphone_call_get_call_log(call);
if(log != NULL && log->status == LinphoneCallMissed) {
if(log != NULL && linphone_call_log_get_status(log) == LinphoneCallMissed) {
// We can't use the comparison method, we can be in background mode and the application
// will no send/update the http request
int missed = [[UIApplication sharedApplication] applicationIconBadgeNumber];
@ -516,12 +520,12 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
[data->notification release];
data->notification = nil;
if(log == NULL || log->status == LinphoneCallMissed) {
if(log == NULL || linphone_call_log_get_status(log) == LinphoneCallMissed) {
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.repeatInterval = 0;
notification.alertBody = [NSString stringWithFormat:@"%@", address];
notification.alertAction = NSLocalizedString(@"Show", nil);
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:log->call_id] forKey:@"callLog"];
notification.userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:linphone_call_log_get_call_id(log)] forKey:@"callLog"];
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
[notification release];
}
@ -1001,7 +1005,7 @@ static LinphoneCoreVTable linphonec_vtable = {
}
static int comp_call_id(const LinphoneCall* call , const char *callid) {
return strcmp(linphone_call_get_call_log(call)->call_id, callid);
return strcmp(linphone_call_log_get_call_id(linphone_call_get_call_log(call)), callid);
}
- (void)acceptCallForCallId:(NSString*)callid {
@ -1180,6 +1184,23 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param)
#pragma mark - Speaker Functions
- (bool)allowSpeaker {
bool notallow = false;
CFStringRef lNewRoute = CFSTR("Unknown");
UInt32 lNewRouteSize = sizeof(lNewRoute);
OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &lNewRouteSize, &lNewRoute);
if (!lStatus && lNewRouteSize > 0) {
NSString *route = (NSString *) lNewRoute;
notallow = [route isEqualToString: @"Headset"] ||
[route isEqualToString: @"Headphone"] ||
[route isEqualToString: @"HeadphonesAndMicrophone"] ||
[route isEqualToString: @"HeadsetInOut"] ||
[route isEqualToString: @"Lineout"];
CFRelease(lNewRoute);
}
return !notallow;
}
static void audioRouteChangeListenerCallback (
void *inUserData, // 1
AudioSessionPropertyID inPropertyID, // 2
@ -1207,7 +1228,7 @@ static void audioRouteChangeListenerCallback (
- (void)setSpeakerEnabled:(BOOL)enable {
speakerEnabled = enable;
if(enable) {
if(enable && [self allowSpeaker]) {
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute
, sizeof (audioRouteOverride)

View file

@ -92,6 +92,7 @@ static void audioRouteChangeListenerCallback (
}
- (bool)onUpdate {
[self setEnabled:[[LinphoneManager instance] allowSpeaker]];
return [[LinphoneManager instance] speakerEnabled];
}

View file

@ -42,8 +42,9 @@ typedef void (^DTActionSheetBlock)(void);
Since there can only be one cancel button a previously marked cancel button becomes a normal button.
@param title The title of the new button.
@param block The block to execute when the button is tapped.
@returns The index of the new button. Button indices start at 0 and increase in the order they are added.
*/
- (NSInteger)addCancelButtonWithTitle:(NSString *)title;
- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block;
@end

View file

@ -74,9 +74,9 @@
return retIndex;
}
- (NSInteger)addCancelButtonWithTitle:(NSString *)title
- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block
{
NSInteger retIndex = [self addButtonWithTitle:title];
NSInteger retIndex = [self addButtonWithTitle:title block:block];
[self setCancelButtonIndex:retIndex];
return retIndex;

@ -1 +1 @@
Subproject commit 80eaf27dea428effe7a176d6d2032c1b3d2eea5e
Subproject commit ea5d692816953ac506464a53238f2103cda8cfee

@ -1 +1 @@
Subproject commit 3b722ada225c8adfcb19a0784f05288f8abfcada
Subproject commit 2584c08c313799871cdef3926f311e9a673674e4