Stop using depricated call API

This commit is contained in:
Benjamin Reis 2017-03-07 12:21:18 +01:00
parent cb2e2c8ca4
commit cabdc6a1a7
8 changed files with 30 additions and 42 deletions

View file

@ -121,19 +121,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onDeclineClick:(id)sender {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call) {
/*if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) {
NSUUID *uuid = [LinphoneManager.instance.providerDelegate.uuids objectForKey:[NSString
stringWithUTF8String:linphone_call_log_get_call_id(linphone_call_get_call_log(call))]];
if(!uuid) {
linphone_core_terminate_call(LC, call);
return;
}
CXEndCallAction *act = [[CXEndCallAction alloc] initWithCallUUID:uuid];
CXTransaction *tr = [[CXTransaction alloc] initWithAction:act];
[LinphoneManager.instance.providerDelegate.controller requestTransaction:tr completion:^(NSError *err){}];
} else {*/
linphone_core_terminate_call(LC, call);
//}
linphone_call_terminate(call);
}
}

View file

@ -630,7 +630,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
LOGI(@"User declined video proposal");
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
videoDismissTimer = nil;
@ -641,7 +641,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_call_params_enable_video(params, TRUE);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
videoDismissTimer = nil;

View file

@ -117,7 +117,7 @@
}
if ((floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max)) {
if ([LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]) {
linphone_core_accept_call(LC, call);
linphone_call_accept(call);
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
} else {
[PhoneMainView.instance displayIncomingCall:call];
@ -724,9 +724,9 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
if ([response.actionIdentifier isEqual:@"Answer"]) {
// use the standard handler
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
linphone_core_accept_call(LC, call);
linphone_call_accept(call);
} else if ([response.actionIdentifier isEqual:@"Decline"]) {
linphone_core_decline_call(LC, call, LinphoneReasonDeclined);
linphone_call_decline(call, LinphoneReasonDeclined);
} else if ([response.actionIdentifier isEqual:@"Reply"]) {
LinphoneCore *lc = [LinphoneManager getLc];
NSString *replyText = [(UNTextInputNotificationResponse *)response userText];
@ -760,7 +760,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
LOGI(@"User declined video proposal");
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
}
} else if ([response.actionIdentifier isEqual:@"Accept"]) {
@ -770,7 +770,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_call_params_enable_video(params, TRUE);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
}
} else if ([response.actionIdentifier isEqual:@"Confirm"]) {
@ -800,7 +800,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
LOGI(@"User declined video proposal");
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
}
@ -810,7 +810,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
if (call == linphone_core_get_current_call(LC)) {
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
linphone_call_params_enable_video(params, TRUE);
linphone_core_accept_call_update(LC, call, params);
linphone_call_accept_update(call, params);
linphone_call_params_destroy(params);
[videoDismissTimer invalidate];
}
@ -886,11 +886,11 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
if ([identifier isEqualToString:@"answer"]) {
// use the standard handler
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
linphone_core_accept_call(LC, call);
linphone_call_accept(call);
} else if ([identifier isEqualToString:@"decline"]) {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call)
linphone_core_decline_call(LC, call, LinphoneReasonDeclined);
linphone_call_decline(call, LinphoneReasonDeclined);
}
} else if ([notification.category isEqualToString:@"incoming_msg"]) {
if ([identifier isEqualToString:@"reply"]) {
@ -930,11 +930,11 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
if ([identifier isEqualToString:@"answer"]) {
// use the standard handler
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
linphone_core_accept_call(LC, call);
linphone_call_accept(call);
} else if ([identifier isEqualToString:@"decline"]) {
LinphoneCall *call = linphone_core_get_current_call(LC);
if (call)
linphone_core_decline_call(LC, call, LinphoneReasonDeclined);
linphone_call_decline(call, LinphoneReasonDeclined);
}
} else if ([notification.category isEqualToString:@"incoming_msg"] &&
[identifier isEqualToString:@"reply_inline"]) {

View file

@ -694,7 +694,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
LOGI(@"Mobile call ongoing... rejecting call from [%s]", tmp);
ms_free(tmp);
}
linphone_core_decline_call(theLinphoneCore, call, LinphoneReasonBusy);
linphone_call_decline(call, LinphoneReasonBusy);
return;
}
@ -2453,7 +2453,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
LinphoneCall *c = linphone_core_get_current_call(theLinphoneCore);
LOGI(@"Sound interruption detected!");
if (c && linphone_call_get_state(c) == LinphoneCallStreamsRunning) {
linphone_core_pause_call(theLinphoneCore, c);
linphone_call_pause(c);
}
}
@ -2618,7 +2618,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
}
linphone_call_params_enable_video(lcallParams, video);
linphone_core_accept_call_with_params(theLinphoneCore, call, lcallParams);
linphone_call_accept_with_params(call, lcallParams);
}
- (void)call:(const LinphoneAddress *)iaddr {
@ -2712,7 +2712,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
if (LinphoneManager.instance.nextCallIsTransfer) {
char *caddr = linphone_address_as_string(addr);
call = linphone_core_get_current_call(theLinphoneCore);
linphone_core_transfer_call(theLinphoneCore, call, caddr);
linphone_call_transfer(call, caddr);
LinphoneManager.instance.nextCallIsTransfer = NO;
ms_free(caddr);
} else {
@ -3043,7 +3043,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
if ([ct currentCalls] != nil) {
if (call) {
LOGI(@"Pausing SIP call because GSM call");
linphone_core_pause_call(theLinphoneCore, call);
linphone_call_pause(call);
[self startCallPausedLongRunningTask];
} else if (linphone_core_is_in_conference(theLinphoneCore)) {
LOGI(@"Leaving conference call because GSM call");

View file

@ -97,11 +97,11 @@
LinphoneManager.instance.conf = TRUE;
linphone_core_terminate_conference(LC);
} else if (currentcall != NULL) {
linphone_core_terminate_call(LC, currentcall);
linphone_call_terminate(currentcall);
} else {
const MSList *calls = linphone_core_get_calls(LC);
if (bctbx_list_size(calls) == 1) { // Only one call
linphone_core_terminate_call(LC, (LinphoneCall *)(calls->data));
linphone_call_terminate((LinphoneCall *)(calls->data));
}
}
}

View file

@ -82,7 +82,7 @@
switch (type) {
case UIPauseButtonType_Call: {
if (call != nil) {
linphone_core_pause_call(LC, call);
linphone_call_pause(call);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
@ -98,7 +98,7 @@
case UIPauseButtonType_CurrentCall: {
LinphoneCall *currentCall = [UIPauseButton getCall];
if (currentCall != nil) {
linphone_core_pause_call(LC, currentCall);
linphone_call_pause(currentCall);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
@ -111,7 +111,7 @@
switch (type) {
case UIPauseButtonType_Call: {
if (call != nil) {
linphone_core_resume_call(LC, call);
linphone_call_resume(call);
} else {
LOGW(@"Cannot toggle pause buttton, because no current call");
}
@ -137,7 +137,7 @@
}
case UIPauseButtonType_CurrentCall: {
LinphoneCall *currentCall = [UIPauseButton getCall];
linphone_core_resume_call(LC, currentCall);
linphone_call_resume(currentCall);
break;
}
}

View file

@ -389,7 +389,7 @@ static RootViewManager *rootViewManagerInstance = nil;
[self popCurrentView];
}
} else {
linphone_core_resume_call(LC, (LinphoneCall *)calls->data);
linphone_call_resume((LinphoneCall *)calls->data);
[self changeCurrentView:CallView.compositeViewDescription];
}
break;
@ -795,7 +795,7 @@ static RootViewManager *rootViewManagerInstance = nil;
}
- (void)incomingCallDeclined:(LinphoneCall *)call {
linphone_core_terminate_call(LC, call);
linphone_call_terminate(call);
}
@end

View file

@ -131,7 +131,7 @@
NSString *callID = [self.calls objectForKey:uuid];
LinphoneCall *call = [LinphoneManager.instance callByCallId:callID];
if (call) {
linphone_core_terminate_call(LC, (LinphoneCall *)call);
linphone_call_terminate((LinphoneCall *)call);
}
}
}
@ -167,7 +167,7 @@
LinphoneCall *call = [LinphoneManager.instance callByCallId:callID];
if (call) {
if (action.isOnHold) {
linphone_core_pause_call(LC, (LinphoneCall *)call);
linphone_call_pause((LinphoneCall *)call);
} else {
[self configAudioSession:[AVAudioSession sharedInstance]];
if (linphone_core_get_conference(LC)) {
@ -200,7 +200,7 @@
[LinphoneManager.instance acceptCall:(LinphoneCall *)_pendingCall evenWithVideo:_pendingCallVideo];
break;
case LinphoneCallPaused:
linphone_core_resume_call(LC, (LinphoneCall *)_pendingCall);
linphone_call_resume((LinphoneCall *)_pendingCall);
break;
case LinphoneCallStreamsRunning:
// May happen when multiple calls