応答コール時...コールメディア状態を有効にする必要がある場合は、wheatherがオーディオセッションの有効化を有効にしているかどうかを確認します。
- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
NSLog(@"Provider perform Answer Call Action");
// Retrieve the instance corresponding to the action's call UUID
SIPCall *call = [_callManager callWithUUID:action.callUUID];
if (!call) {
[action fail];
return;
}
/*
Configure the audio session, but do not start call audio here, since it must be done once
the audio session has been activated by the system after having its priority elevated.
*/
[[AudioManager sharedManager] configureAudioSession];
// Trigger the call to be answered via the underlying network service.
[call answer];
// Signal to the system that the action has been successfully performed.
[action fulfill];
}
また、エンドコールメソッドを確認します。
- (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action {
NSLog(@"Provider perform End Call Action");
// Retrieve the Voifinity PBX instance corresponding to the action's call UUID
SIPCall *call = [_callManager callWithUUID:action.callUUID];
if (!call) {
[action fail];
return;
}
// Stop call audio whenever ending the call.
//[[AudioManager sharedManager] disableSoundDevices];
// Trigger the call to be ended via the underlying network service.
[call hangUp];
// Signal to the system that the action has been successfully performed.
[action fulfill];
// Remove the ended call from the app's list of calls.
[_callManager removeCall:call];
}
もアクティブにオーディオセッションを確認するか、無効化するかどうかを追加します。 オーディオの呼び出しは、オーディオセッションのアクティブ化後にのみアクティブにする必要があります。 以下のオーディオセッションのトラッキングに代理人を追加します。
//セッション
- (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession {
NSLog(@"Received: %s",__FUNCTION__);
}
//セッションに
- (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession {
NSLog(@"Received: %s",__FUNCTION__);
}
を無効に有効に