How we can invoke the portsip delegate if app is terminated or force quite

498 views Asked by At

I am using portsip SDK (trial version) in my application for VOIP call. Call is working fine in foreground and background as well. I m using Call Kit framework for incoming/outgoing call at client side, When i removed application from background or force quite the app, in that case when i try to call with other device call is coming, i received VOIP push but port sip incoming delegate does not invoke whereas if i call again (2nd time in same app state) port sip incoming delegate invoke. so until incoming delegate does not call we can not accept.decline incoming call.**

So please help me out how we can invoke the port sip delegate if app is terminated or force quite.

1

There are 1 answers

1
ridvankucuk On

I had a similar problem on my side but I am not using portsip. So If it is related with portsip my answer may not be correct however I followed some steps on the Apple Example. When I added configureAudioSession() method everything worked fine for me. For example:

func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
    // Create & configure an instance of SpeakerboxCall, the app's 
    configureAudioSession()
    self.provider.reportOutgoingCall(with: call.uuid!, connectedAt: Date())
    action.fulfill()
}
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
    // Retrieve the SpeakerboxCall instance corresponding to the action's call UUID
    guard callManager.callWithUUID(uuid: action.callUUID) != nil else {
        action.fail()
        return
    }

    configureAudioSession()

    // Signal to the system that the action has been successfully performed.
    action.fulfill()
}

Hope it helps.