Hello ferreol
I am facing the same issue. Could you please help me to sort out.
Reporting an incoming call with following code snippet:
- (void)reportIncomingCallWithUUID:(NSUUID*)uuid phoneNumber:(NSString*)phone andName:(NSString *)name {
CXCallUpdate *incomingCallUpdate = [[CXCallUpdate alloc] init];
incomingCallUpdate.localizedCallerName = name;
incomingCallUpdate.supportsHolding = NO;
incomingCallUpdate.supportsUngrouping = NO;
incomingCallUpdate.supportsGrouping = NO;
incomingCallUpdate.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:phone];
[_provider reportNewIncomingCallWithUUID:uuid update:incomingCallUpdate completion:^(NSError * _Nullable error) {
NSLog(@"%@ %@",NSStringFromClass([self class]),[error localizedDescription]);
[_provider reportCallWithUUID:uuid updated:incomingCallUpdate];
}];
}
Perforimg the follwing transaction after call end process:
- (void)endCallRequest:(NSUUID*)uuid {
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:uuid];
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];
CXCallController *controller = [[CXCallController alloc] init];
NSLog(@"%@ endCallRequest uuid %@",NSStringFromClass([self class]),uuid.UUIDString);
[controller requestTransaction:transaction completion:^(NSError * _Nullable error) {
if (error) {
NSLog(@"%@ endCallRequest error %@",NSStringFromClass([self class]),[error description]);
}
}];
}
And the provider delgates are handled like bellow:
- (void)provider:(CXProvider *)provider performStartCallAction:(CXStartCallAction *)action{
NSLog(@"%@ performStartCallAction",NSStringFromClass([self class]));
}
- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
[self configureAudioSession];
[sip performAnswer];
[action fulfill];
}
- (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action {
[sip disconnect];
[action fulfill];
}
Please let me know what I doing wrong there.
Thank you 🙂