- (void) callBack{
NSLog(@"呼叫");
NSString *number = @“10086”;
// NSString *num = [[NSString alloc] initWithFormat:@"telprompt://%@",number];
// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:num]];
//实现呼叫之后到app中
NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",number]];
UIWebView * phoneCallWebView = [[UIWebView alloc] initWithFrame:CGRectZero];
[phoneCallWebView loadRequest:[NSURLRequest requestWithURL:phoneURL]];
CTCallCenter *callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler=^(CTCall* call)
{
if (call.callState == CTCallStateDisconnected&&connect==0)
{
NSLog(@"Call has been disconnected");
}
else if (call.callState == CTCallStateConnected)
{
NSLog(@"Call has just been connected");
}
else if(call.callState == CTCallStateIncoming)
{
NSLog(@"Call is incoming");
//self.viewController.signalStatus=NO;
}
else if (call.callState ==CTCallStateDialing)
{
NSLog(@"call is dialing");
}
else
{
NSLog(@"Nothing is done");
}
};
}