mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-21 14:58:29 +00:00
Do not crash on null call id when trying to recreate a callkit call
This commit is contained in:
parent
3d5f8b0447
commit
dd22e69ceb
1 changed files with 14 additions and 21 deletions
|
|
@ -895,30 +895,23 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
|
||||||
: @"";
|
: @"";
|
||||||
NSUUID *uuid = (NSUUID *)[self.providerDelegate.uuids objectForKey:callId2];
|
NSUUID *uuid = (NSUUID *)[self.providerDelegate.uuids objectForKey:callId2];
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
if (linphone_core_get_calls_nb(LC) > 0 && !_conf) {
|
LinphoneCall *callKit_call = (LinphoneCall *)linphone_core_get_calls(LC)->data;
|
||||||
|
const char *callKit_callId = callKit_call
|
||||||
|
? linphone_call_log_get_call_id(linphone_call_get_call_log(callKit_call))
|
||||||
|
: NULL;
|
||||||
|
if (callKit_callId && !_conf) {
|
||||||
// Create a CallKit call because there's not !
|
// Create a CallKit call because there's not !
|
||||||
_conf = FALSE;
|
NSString *callKit_callIdNS = [NSString stringWithUTF8String:linphone_call_log_get_call_id(linphone_call_get_call_log(callKit_call))];
|
||||||
LinphoneCall *callKit_call = (LinphoneCall *)linphone_core_get_calls(LC)->data;
|
|
||||||
NSString *callKit_callId = [NSString stringWithUTF8String:
|
|
||||||
linphone_call_log_get_call_id(linphone_call_get_call_log(callKit_call))];
|
|
||||||
NSUUID *callKit_uuid = [NSUUID UUID];
|
NSUUID *callKit_uuid = [NSUUID UUID];
|
||||||
[LinphoneManager.instance.providerDelegate.uuids setObject:callKit_uuid
|
[LinphoneManager.instance.providerDelegate.uuids setObject:callKit_uuid forKey:callKit_callIdNS];
|
||||||
forKey:callKit_callId];
|
[LinphoneManager.instance.providerDelegate.calls setObject:callKit_callIdNS forKey:callKit_uuid];
|
||||||
[LinphoneManager.instance.providerDelegate.calls setObject:callKit_callId
|
NSString *address = [FastAddressBook displayNameForAddress:linphone_call_get_remote_address(callKit_call)];
|
||||||
forKey:callKit_uuid];
|
CXHandle *handle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:address];
|
||||||
NSString *address = [FastAddressBook displayNameForAddress:
|
CXStartCallAction *act = [[CXStartCallAction alloc] initWithCallUUID:callKit_uuid handle:handle];
|
||||||
linphone_call_get_remote_address(callKit_call)];
|
|
||||||
CXHandle *handle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric
|
|
||||||
value:address];
|
|
||||||
CXStartCallAction *act = [[CXStartCallAction alloc] initWithCallUUID:callKit_uuid
|
|
||||||
handle:handle];
|
|
||||||
CXTransaction *tr = [[CXTransaction alloc] initWithAction:act];
|
CXTransaction *tr = [[CXTransaction alloc] initWithAction:act];
|
||||||
[LinphoneManager.instance.providerDelegate.controller requestTransaction:tr
|
[LinphoneManager.instance.providerDelegate.controller requestTransaction:tr completion:^(NSError *err){}];
|
||||||
completion:^(NSError *err){}];
|
[LinphoneManager.instance.providerDelegate.provider reportOutgoingCallWithUUID:callKit_uuid startedConnectingAtDate:nil];
|
||||||
[LinphoneManager.instance.providerDelegate.provider reportOutgoingCallWithUUID:callKit_uuid
|
[LinphoneManager.instance.providerDelegate.provider reportOutgoingCallWithUUID:callKit_uuid connectedAtDate:nil];
|
||||||
startedConnectingAtDate:nil];
|
|
||||||
[LinphoneManager.instance.providerDelegate.provider reportOutgoingCallWithUUID:callKit_uuid
|
|
||||||
connectedAtDate:nil];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CXEndCallAction *act = [[CXEndCallAction alloc] initWithCallUUID:uuid];
|
CXEndCallAction *act = [[CXEndCallAction alloc] initWithCallUUID:uuid];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue