Callkit无法识别拨出电话的已连接信息 [英] Callkit doesn't recognize connected info of outgoing call

查看:75
本文介绍了Callkit无法识别拨出电话的已连接信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Callkit框架添加到我的Obj-C VoIP应用程序中.但是拨出电话存在一些问题. Callkit 无法识别拨出电话的连接信息.

I'm adding callkit framework to my Obj-C VoIP app. But there are some problems with making outgoing call. Callkit doesn't recognize connected info of outgoing call.

详细信息

  1. 我的应用通过使用[provider reportOutgoingCallWithUUID:uuid connectedAtDate:nil]; 报告了连接信息,但Callkit并未收到该信息.
  2. 首次拨出电话时,已报告已连接的信息,并且callkit系统的本机屏幕正确显示了时间信息(已连接).
  3. 但是在两次或更多次之后,它根本没有报告过.
  4. 我当然已经设置了Delegate方法.
  5. 始终使用 [provider reportOutgoingCallWithUUID:uuid startingConnectingAtDate:nil]; 正确报告连接信息.
  1. My App reported connected info by using [provider reportOutgoingCallWithUUID:uuid connectedAtDate:nil];, but Callkit doesn't receive that.
  2. The first time of making outgoing call, connected info has reported and callkit system's native screen shows time info correctly (connected).
  3. But after two times or more, it hasn't reported not at all.
  4. Of course I've set Delegate method.
  5. Connecting info is always reported correctly by using [provider reportOutgoingCallWithUUID:uuid startedConnectingAtDate:nil];.

是否有任何建议或信息?

Is there any advice or information?

推荐答案

/在激活音频会话后,您需要调用连接和连接状态更改.您可以使用块来做到这一点.在启用音频会话后,在SIP呼叫模型中创建模块并分配模块执行代码.在SIP通话状态事件中调用此块./

/*配置音频会话,但不要在此处开始呼叫音频,因为必须完成一次音频会话的优先级提高后,系统已将其激活.*/

/*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. */

- (void)provider:(CXProvider *)provider performStartCallAction:(CXStartCallAction *)action {

  _outgoingCallId = action.callUUID;
  _outgoingCallHandler = action.handle.value;
  _destinationURI = action.contactIdentifier;

  [[AudioManager sharedManager] configureAudioSession];

  [action fulfill];
}

/*为调用生命周期中的重要事件设置回调块,以便可以更新CXProvider以反映更新后的状态.*/

/* Set callback blocks for significant events in the call's lifecycle, so that the CXProvider may be updated to reflect the updated state.*/

 - (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession {

     SIPCall *call = [[[SIPUserAgent sharedUserAgent] account]makeCallToURI:_destinationURI];
    call.connectingBlock = ^{
        NSLog(@"----- connecting block -----");
        [_provider reportOutgoingCallWithUUID:_outgoingCallId startedConnectingAtDate:nil];
    };

    call.connectedBlock = ^{
        NSLog(@"----- connected block -----");
        [_provider reportOutgoingCallWithUUID:_outgoingCallId connectedAtDate:nil];
    };

}

//Sip通话事件的通话阻止

//Call Block from sip call event

- (void)SIPCallConnecting:(NSNotification *)notification {

   SIPCall *call = [notification object];
   if (call.connectingBlock) {
        call.connectingBlock();
   }
}

- (void)SIPCallDidConfirm:(NSNotification *)notification {
      SIPCall *call = [notification object];
      [self setCallStartTime:[NSDate timeIntervalSinceReferenceDate]];
      [actv startCallTimer];
      if (call.connectedBlock) {
         call.connectedBlock();
    }
}

这篇关于Callkit无法识别拨出电话的已连接信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆