Merge branch 'new_ui' of git.linphone.org:linphone-iphone into new_ui

This commit is contained in:
Yann Diorcet 2012-09-25 16:14:55 +02:00
commit faf2efe820
2 changed files with 18 additions and 14 deletions

View file

@ -60,19 +60,12 @@
CTCallCenter* ct = (CTCallCenter*) cCenter;
int callCount = [ct.currentCalls count];
if (!callCount) {
[LinphoneLogger logc:LinphoneLoggerLog format:"No GSM call -> enabling SIP calls"];
linphone_core_set_max_calls([LinphoneManager getLc], 3);
} else {
[LinphoneLogger logc:LinphoneLoggerLog format:"%d GSM call(s) -> disabling SIP calls", callCount];
/* pause current call, if any */
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Pausing SIP call"];
linphone_core_pause_call([LinphoneManager getLc], call);
}
linphone_core_set_max_calls([LinphoneManager getLc], 0);
}
/* pause current call, if any */
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (callCount>0 && call) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Pausing SIP call"];
linphone_core_pause_call([LinphoneManager getLc], call);
}
}
- (void)applicationDidEnterBackground:(UIApplication *)application{

View file

@ -360,7 +360,18 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
- (void)onCall:(LinphoneCall*)call StateChanged:(LinphoneCallState)state withMessage:(const char *)message {
// Handling wrapper
if(state == LinphoneCallReleased) {
CTCallCenter* ct = [[CTCallCenter alloc] init];
int callCount = [ct.currentCalls count];
if (callCount>0 && state==LinphoneCallIncomingReceived) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",linphone_address_get_username(linphone_call_get_call_log(call)->from)];
linphone_core_terminate_call([LinphoneManager getLc], call);
return;
}
[ct release];
if(state == LinphoneCallReleased) {
if(linphone_call_get_user_pointer(call) != NULL) {
free (linphone_call_get_user_pointer(call));
linphone_call_set_user_pointer(call, NULL);