본문 바로가기

프로그래밍/iOS

[iOS] 전화 처리

#import <CoreTelephony/CTCallCenter.h>
#import <CoreTelephony/CTCall.h>

CTCallCenter *gclsCallCenter = [[CTCallCenter alloc] init];
gclsCallCenter.callEventHandler=^(CTCall* call){

if ( call.callState == CTCallStateIncoming ) { //전화가 걸려옴.
LOG(@"CTCallStateIncoming");
}

if ( call.callState == CTCallStateDialing ) {
LOG(@"CTCallStateDialing");
}
if ( call.callState == CTCallStateConnected ) {
LOG(@"CTCallStateConnected");
}

if ( call.callState == CTCallStateDisconnected ) { //전화가 끊어짐.
LOG(@"CTCallStateDisconnected");
}
};