AVAudioSession错误激活:错误域= NSOSStatusErrorDomain代码= 561017449:将CallKit API集成到Objective C时出现音频设备错误

时间:2017-03-10 13:16:57

标签: ios pjsip callkit

我正在使用Objective-C中的Pjsip开发VoIP应用程序。

我想尝试集成CallKit,但我在configureAudioSession上收到错误。我将AudioController.hAudioController.mmSpeakerBox from Apple复制到了我的项目中。

我添加了这段代码:

 AudioController *audioController;

 - (void)configureAudioSession {
      if (!audioController) {
         audioController = [[AudioController alloc] init];
      }
 }

- (void)handleIncomingCallFrom:(NSString *)dest {
    CXCallUpdate *callUpdate = [[CXCallUpdate alloc] init];
    [callUpdate setLocalizedCallerName:dest];
    [callUpdate setHasVideo:NO];
    CXHandle *calleeHandle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:dest];
    [callUpdate setRemoteHandle:calleeHandle];
    [provider reportNewIncomingCallWithUUID:[NSUUID UUID] update:callUpdate completion:^(NSError *error){
        [self configureAudioSession];
    }];
}

电话正在响铃,我可以处理电话,但每当我回答时它都会崩溃。我收到此错误:

 AVAudioSession error activating: Error Domain=NSOSStatusErrorDomain Code=561017449 "(null)"
 2017-03-09 18:17:48.830893 MyVoIPProject[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch,  16000 Hz, Int16> inf< 1 ch,  16000 Hz, Int16>)
 2017-03-09 18:17:48.841301 MyVoIPProject[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch,  44100 Hz, Int16> inf< 1 ch,  44100 Hz, Int16>)
 2017-03-09 18:17:48.850282 MyVoIPProject[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch,  48000 Hz, Int16> inf< 1 ch,  48000 Hz, Int16>)
 .
 .
 .
 .

你能告诉我如何整合Callkit吗?

1 个答案:

答案 0 :(得分:0)

此错误导致您忘记在Info.plist中添加Mircone描述。

参考:SpeakerBox from Apple iOS - AudioUnitInitialize returns error code 561017449