简体   繁体   English

呼叫者在opentok iOS SDK中没有收到来自接收方的结束呼叫事件

[英]Caller doesn't get event of End Call from receiver in opentok ios sdk

I have an iphone app in which I need to manage video call from caller to receiver and its works perfectly by using Opentok framework. 我有一个iPhone应用程序,需要管理从呼叫者到接收者的视频通话,并且使用Opentok框架可以完美地工作。 Video call and audio everything working fine. 视频通话和音频一切正常。 But I have a problem with Ending a call from receiver side without picking up the call. 但是我在不接听电话的情况下结束接收方的呼叫时遇到问题。

If receiver picked up the call and Then he ends the call then caller receives event of ending a call. 如果接收方接听电话,然后他结束通话,则呼叫方会收到结束通话的事件。 But when if receiver doesn't picked up the call from app and directly end the call then caller doesn't get any event and it continuously showed up the calling screen. 但是,如果接收方没有从应用程序接听电话并直接结束通话,则呼叫方不会收到任何事件,并且会连续显示呼叫屏幕。 All delegates and its methods are implemented. 所有委托及其方法均已实现。

Delegates are OTSessionDelegate , OTSubscriberDelegate , OTPublisherDelegate . 委托是OTSessionDelegateOTSubscriberDelegateOTPublisherDelegate And it's all required and optional methods are implemented and working fine. 而且所有必需和可选方法都已实现并且可以正常工作。

objects in header file are 头文件中的对象是

#import <Opentok/Opentok.h>
@interface myViewController : UIViewController
{
      OTSession* session;
      OTPublisher* publisher;
      OTSubscriber* subscriber;
}

And I am calling doUnpublish method to end the call. 我正在调用doUnpublish方法来结束通话。 The code is 该代码是

- (void)doUnpublish
{

    [loaderviewView removeFromSuperview];
    [_session unpublish:_publisher];
    [_session disconnect];
    [player stop];
     [self doDisconnect];
 }


- (void)doDisconnect
{
   [callingView setHidden:YES];
   timer invalidate];
    [_session disconnect];
}

It is working fine if receiver receive the call and then ends the call. 如果接收方接听电话然后结束通话,则工作正常。 But if he doesn't receive the call and directly ends up then caller doesn't get event that call is ended by receiver. 但是,如果他没有收到呼叫并直接结束,则呼叫者不会收到呼叫被接收者终止的事件。

I does not provide more code because it contains private details code which I have to manage for call information. 我没有提供更多代码,因为它包含私人详细信息代码,我必须管理这些信息来获取呼叫信息。 And it is not a problem and working fine. 而且这不是问题,工作正常。 I just need to know how can i get event in caller side that receiver ended a call without Accepting the call. 我只需要知道如何在呼叫方发生事件,即接收方在不接受呼叫的情况下结束了呼叫。

My whole app is ready and because of this situation I am paused. 我的整个应用程序已准备就绪,由于这种情况,我暂停了。 Any help will be appreciated. 任何帮助将不胜感激。

When Receiver clicks on end call your doUnpublish method gets called, which in turns calls session disconnect to disconnect from an opentok session. 当Receiver单击结束调用时,将调用doUnpublish方法,该方法依次调用会话断开连接以断开与opentok会话的连接。 Session disconnect causes the Caller's delegate connectionDestroyed to get triggered so Caller knows that Receiver has disconnected from the session. 会话断开连接会导致调用方的委托connectionDestroyed触发,因此调用方知道Receiver已从会话断开连接。

The problem arises when Receiver never picks up the call so he never connects to the OpenTok Session. 当Receiver从不接听电话,因此他从不连接到OpenTok会话时,就会出现问题。 If he never connects to the session, the Caller's connectionCreated and connectionDestroyed delegates will never get fired. 如果他从不连接到会话,则调用者的connectionCreated和connectionDestroyed委托将永远不会被解雇。

The way to solve your problem is to set a timer. 解决问题的方法是设置一个计时器。 On the caller's end, start the timer when he calls the Receiver. 在呼叫者端,当他呼叫接收者时启动计时器。 If connectionCreated delegate is not fired in 1 minute, that means that the Receiver either rejected the call or missed the call. 如果1分钟内未触发connectionCreated委托,则表示接收方拒绝了呼叫或错过了呼叫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM