呼叫者在opentok iOS SDK中没有从接收者获得结束呼叫的事件 [英] Caller doesn't get event of End Call from receiver in opentok ios sdk

查看:67
本文介绍了呼叫者在opentok iOS SDK中没有从接收者获得结束呼叫的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,需要管理从呼叫者到接收者的视频通话,并且使用Opentok框架可以完美地工作.视频通话和音频一切正常. 但是我在不接听电话的情况下结束来自接收方的呼叫时遇到了问题.

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

代表是OTSessionDelegateOTSubscriberDelegateOTPublisherDelegate.并且所有必需和可选方法都已实现并且可以正常工作.

Delegates are OTSessionDelegate, OTSubscriberDelegate, OTPublisherDelegate. And it's all required and optional methods are implemented and working fine.

对象是

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

我正在调用doUnpublish方法来结束通话.代码是

And I am calling doUnpublish method to end the call. 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.

推荐答案

当Receiver单击结束调用时,将调用doUnpublish方法,该方法依次调用会话断开连接以断开与opentok会话的连接.会话断开连接会导致调用方的委托connectionDestroyed触发,因此调用方知道Receiver已从会话断开连接.

When Receiver clicks on end call your doUnpublish method gets called, which in turns calls session disconnect to disconnect from an opentok session. Session disconnect causes the Caller's delegate connectionDestroyed to get triggered so Caller knows that Receiver has disconnected from the session.

当Receiver从不接听电话,因此他从不连接到OpenTok会话时,就会出现问题.如果他从不连接到会话,则调用者的connectionCreated和connectionDestroyed委托将永远不会被解雇.

The problem arises when Receiver never picks up the call so he never connects to the OpenTok Session. If he never connects to the session, the Caller's connectionCreated and connectionDestroyed delegates will never get fired.

解决问题的方法是设置一个计时器.在呼叫者端,当他呼叫接收者时启动计时器.如果1分钟内未触发connectionCreated委托,则表示接收方拒绝了呼叫或错过了呼叫.

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.

这篇关于呼叫者在opentok iOS SDK中没有从接收者获得结束呼叫的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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