iosphone-callcore-telephony

How to detect programmatically that call is on hold in iOS?


Is it possible to get any event or notification regarding Telephony Call Hold in iOS. CTCallCenter provides only following states :

CTCallStateDialing
CTCallStateIncoming 
CTCallStateConnected
CTCallStateDisconnected

Solution

  • We can use CallKit Framework to get the Call Hold event.

    We need to conform to CXCallObserver Delegate

     [_callObserver setDelegate:self queue:nil];
    

    where _callObserver is the instance of my CXCallObserver class

    - (void)callObserver:(CXCallObserver *)callObserver callChanged:(CXCall *)call {
        if (call.isOnHold == true) {
            NSLog(@"Call is on hold");
            }
    }