How to disconnect call in CallKit, when a call is in the Ringing state? I am using below code for disconnect callKit Call.
This code is working when I Disconnect call after Accept. but when a call is in the Ringing state then this code is not working. call keep Ringing.
I have checked that UUID is not nil .
Please let me know what is the proper way to do this
@property (nonatomic, strong) CXCallController *callKitCallController;
- (void)performEndCallActionWithUUID:(NSUUID *)uuid {
if (uuid == nil) {
return;
}
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:uuid];
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];
[self.callKitCallController requestTransaction:transaction completion:^(NSError *error) {
if (error) {
NSLog(@"EndCallAction transaction request failed: %@", [error localizedDescription]);
}
else {
NSLog(@"EndCallAction transaction request successful");
}
}];
}
I have tried this link also ->. Callkit Call End