智慧服务,成就美好体验 项目咨询

主页 > 服务与支持 > 开发平台 > 客户端SDK参考 > Android Native SDK > 会议 会议接入

入门使用

会议接入

更新时间:2019-11-20

会议列表一键入会

描述

用户在移动客户端通过会议列表一键入会的方式加入会议。

前提条件

  • 鉴权登录成功。
  • SIP号码已成功注册。
  • 会议环境参数已设置。

业务流程

图1 会议列表一键入会流程 
  1. UI调用TsdkConferenceManager对象中的joinConference()方法主动加入会议。SDK发送加入会议请求至服务器。

     

    说明: 

    在加入会议时,需要传入的参数为:是否接入视频会议以及入会参数。

    • 入会参数中confPassword、confId以及accessNumber必选。
    • 入会号码(joinNumber)如果不填,则使用自己软终端号码入会。
    • 会议对应的呼叫ID(接口会同步返回呼叫ID,需要记录下),在使用SIP终端号码入会时有效。
    代码示例:
    //Java code
    public int joinConf(TsdkConfJoinParam confJoinParam, boolean isVideo, String joinNumber)
    {
        Log.i(TAG,  "join conf.");
        int result = TsdkManager.getInstance().getConferenceManager().joinConference(confJoinParam, isVideo, joinNumber);
        if (result != 0)
        {
            Log.e(TAG, "joinConf result ->" + result);
            currentConference = null;
            return result;
        }
        return 0;
    }
    
     

     

  2. SDK在收到服务器返回的加入会议响应后,通过TsdkNotify对象中的onEvtJoinConfResult()方法向UI上报会议加入结果事件。并返回会议对象TsdkConference,后续会控时使用,此时, UI可跳转至会议界面。

     

    说明: 
    1. 在加入会议时,会请求会议权限,若请求失败,则通过TsdkNotify对象中的onEvtRequestConfRightFailed()方法向UI上报会议权限请求失败通知,UI提示申请会控权限失败,若请求成功,则不上报。
    2. 若应用程序是以多流的方式(SVC)成功加入会议,则此结果通知中会携带SVC信息,包含 isSvcConf (是否多流会议)、svcLabelCount(可使用的多流Label数) 和 svcLabel (多流Label 表),应用程序应保存多流“Label”信息,用于后继流程中“绑定SVC视频窗口”、"选看SVC与会者"和“设置SVC窗口和与会者关系”等操作。
    代码示例:
    //Java code
    public void handleJoinConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult, TsdkJoinConfIndInfo tsdkJoinConfIndInfo
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        if (result == 0)
        {
            this.currentConference = tsdkConference;
            this.memberList = null;
            this.self = null;
            TsdkCall tsdkCall = tsdkConference.getCall();
            if (null != tsdkCall) {
                Session newSession = CallMgr.getInstance().getCallSessionByCallID(tsdkCall.getCallInfo().getCallId());
                if (null == newSession) {
                    newSession = new Session(tsdkCall);
                    CallMgr.getInstance().putCallSessionToMap(newSession);
                }
                if (tsdkCall.getCallInfo().getIsVideoCall() == 1) {
                    VideoMgr.getInstance().initVideoWindow(tsdkCall.getCallInfo().getCallId());
                }
            }
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_SUCCESS, tsdkConference.getHandle() + "");
        }
        else
        {
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_FAILED, result);
        }
    }
    
     

     

  3. SDK收到会议状态刷新通知,通过TsdkNotify对象中的onEvtInfoAndStatusUpdate()方法向UI上报会议信息及状态更新事件,UI刷新会议状态和成员列表。

     

    说明: 

    详细流程参见会议信息及会议状态更新描述。

     

  4. 若会议包含数据会议能力,SDK通过TsdkNotify对象中的onEvtGetDataconfParamResult()方法向UI上报获取数据会议参数结果。

     

    代码示例:
    //Java code
    public void  handleGetDataConfParamsResult(TsdkConference tsdkConference, TsdkCommonResult commonResult){
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.GET_DATA_CONF_PARAM_RESULT, result);
    }
    
     

     

  5. 此时UI可选择自动加入或用户选择加入数据会议,调用TsdkConference对象中的joinDataConference()方法加入数据会议。

     

    代码示例:
    //Java code
    public int joinDataConf()
    {
        if (null == currentConference)
        {
            Log.e(TAG,  "join data conf failed, currentConference is null ");
            return -1;
        }
    
        int result =  currentConference.joinDataConference();
    
        return result;
    }
    
     

     

  6. SDK在收服务器加入数据会议响应后,通过TsdkNotify对象中的onEvtJoinDataConfResult()方法向UI上报数据会议加入结果事件。若成功,则UI刷新界面,提示加入数据会议成功,若失败,则提示加入数据会议失败。

     

    说明: 

    在加入数据会议后,通过TsdkNotify对象中的onEvtInfoAndStatusUpdate()方法向UI上报会议信息及状态更新事件,UI刷新会议状态和成员列表。

    代码示例:
    //Java code
    public void  handleJoinDataConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult){
        Log.i(TAG, "handleJoinDataConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_DATA_CONF_RESULT, result);
    }
    
     

     

注意事项

无。

会议接入码入会

描述

用户由第三方途径获取会议信息,通过输入会议号和接入码的方式加入会议。

说明: 
  • 因不支持从拨号盘拨打“会议号”+“接入码”的方式直接加入会议,所以应用程序界面需要提供“接入会议”的单独入口。
  • 会议列表一键入会的接口调用流程相同,不同在于用户界面入口。

前提条件

参见会议列表一键入会

业务流程

参见会议列表一键入会

注意事项

无。

统一会议接入号入会

描述

用户由第三方途径获取会议信息,通过拨打统一会议接入号,使用IVR导航的方式加入会议。

前提条件

  • 鉴权登录成功。
  • SIP号码已成功注册。
  • 会议环境参数已设置。

业务流程

图2 统一会议接入号入会流程

  1. UI调用TsdkCallManager对象中的startCall()方法来发起一个呼叫请求,被叫号码为“统一会议接入号”。

     

    代码示例:
    // Java code
    TsdkCall call = TsdkManager.getInstance().getCallManager().startCall(toNumber, isVideoCall);
    
     

     

  2. 若呼叫建立成功,SDK通过TsdkNotify对象中的onEvtCallConnected()方法向UI上报呼叫建立事件,与普通音视频呼叫相同。

     

    代码示例:
    //Java code
    public void onEvtCallConnected(TsdkCall call){
        Log.i(TAG, "onCallConnected");
        if (null == call)
        {
            Log.e(TAG, "call obj is null");
            return;
        }
    
        CallInfo callInfo = getCallInfo(call);
        Session callSession = getCallSessionByCallID(call.getCallInfo().getCallId());
        if (callSession == null)
        {
            Log.e(TAG, "call session obj is null");
            return;
        }
    
        if (callInfo.isVideoCall())
        {
            callSession.setCallStatus(CallConstant.CallStatus.VIDEO_CALLING);
        }
        else
        {
            callSession.setCallStatus(CallConstant.CallStatus.AUDIO_CALLING);
        }
    
        mCallNotification.onCallEventNotify(CallConstant.CallEvent.CALL_CONNECTED, callInfo);
    }
    
     

     

  3. 用户根据服务器的语言提示,在二次拨号界面输入会议接入码和密码(密码必须以“#”号结尾),UI调用TsdkCall对象中的sendDtmf()方法在通话中发送DTMF信号完成会议接入码和密码发送,SDK完成入会交互处理。

     

    代码示例:
    //Java code
    public boolean reDial(int code)
    {
        TsdkDtmfTone tsdkDtmfTone = TsdkDtmfTone.enumOf(code);
        LogUtil.d(TAG, "Dtmf Tone :" + tsdkDtmfTone.getIndex());
        int result = tsdkCall.sendDtmf(tsdkDtmfTone);
        if (result != 0)
        {
            LogUtil.e(TAG, "sendDTMF return failed, result = " + result);
            return false;
        }
        return true;
    }
    
     

     

  4. SDK在收到服务器返回的加入会议响应后,通过TsdkNotify对象中的onEvtJoinConfResult()方法向UI上报会议加入结果事件。并返回会议对象TsdkConference,后续会控时使用,此时, UI可跳转至会议界面。

     

    说明: 
    1. 在加入会议时,会请求会议权限,若请求失败,则通过TsdkNotify对象中的onEvtRequestConfRightFailed()方法向UI上报会议权限请求失败通知,UI提示申请会控权限失败,若请求成功,则不上报。
    2. 若应用程序是以多流的方式(SVC)成功加入会议,则此结果通知中会携带SVC信息,包含 isSvcConf (是否多流会议)、svcLabelCount(可使用的多流Label数) 和 svcLabel (多流Label 表),应用程序应保存多流“Label”信息,用于后继流程中“绑定SVC视频窗口”、"选看SVC与会者"和“设置SVC窗口和与会者关系”等操作。
    代码示例:
    //Java code
    public void handleJoinConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult, TsdkJoinConfIndInfo tsdkJoinConfIndInfo
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        if (result == 0)
        {
            this.currentConference = tsdkConference;
            this.memberList = null;
            this.self = null;
            TsdkCall tsdkCall = tsdkConference.getCall();
            if (null != tsdkCall) {
                Session newSession = CallMgr.getInstance().getCallSessionByCallID(tsdkCall.getCallInfo().getCallId());
                if (null == newSession) {
                    newSession = new Session(tsdkCall);
                    CallMgr.getInstance().putCallSessionToMap(newSession);
                }
                if (tsdkCall.getCallInfo().getIsVideoCall() == 1) {
                    VideoMgr.getInstance().initVideoWindow(tsdkCall.getCallInfo().getCallId());
                }
            }
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_SUCCESS, tsdkConference.getHandle() + "");
        }
        else
        {
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_FAILED, result);
        }
    }
    
     

     

  5. SDK收到会议状态刷新通知,通过TsdkNotify对象中的onEvtInfoAndStatusUpdate()方法向UI上报会议信息及状态更新事件,UI刷新会议状态和成员列表。

     

    说明: 

    详细流程参见会议信息及会议状态更新描述。

     

  6. 若会议包含数据会议能力,SDK通过TsdkNotify对象中的onEvtGetDataconfParamResult()方法向UI上报获取数据会议参数结果。

     

    代码示例:
    //Java code
    public void  handleGetDataConfParamsResult(TsdkConference tsdkConference, TsdkCommonResult commonResult){
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.GET_DATA_CONF_PARAM_RESULT, result);
    }
    
     

     

  7. 此时UI可选择自动加入或用户选择加入数据会议,调用TsdkConference对象中的joinDataConference()方法加入数据会议。

     

    代码示例:
    //Java code
    public int joinDataConf()
    {
        if (null == currentConference)
        {
            Log.e(TAG,  "join data conf failed, currentConference is null ");
            return -1;
        }
    
        int result =  currentConference.joinDataConference();
    
        return result;
    }
    
     

     

  8. SDK在收服务器加入数据会议响应后,通过TsdkNotify对象中的onEvtJoinDataConfResult()方法向UI上报数据会议加入结果事件。若成功,则UI刷新界面,提示加入数据会议成功,若失败,则提示加入数据会议失败。

     

    说明: 

    在加入数据会议后,通过TsdkNotify对象中的onEvtInfoAndStatusUpdate()方法向UI上报会议信息及状态更新事件,UI刷新会议状态和成员列表。

    代码示例:
    //Java code
    public void  handleJoinDataConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult){
        Log.i(TAG, "handleJoinDataConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_DATA_CONF_RESULT, result);
    }
    
     

     

注意事项

无。

被邀接入会议

描述

会议主席邀请新的与会者加入会议。

前提条件

与会者通过主席身份加入会议,或已申请获取为主席。

业务流程

图3 被邀接入会议流程 
  1. 被邀与会者侧SDK收到会议来电请求,通过TsdkNotify对象中的onEvtConfIncomingInd()方法向UI上报会议来电事件,UI提示用户会议来电。

     

    说明: 

    在会议来电通知携带的信息中,TsdkConference.callInfo中的对端号码(getPeerNumber())一般默认为会议服务的统一接入号码,作为对用户的提示意义不大,建议使用TsdkConference中的会议主题(getSubject())作为来电提示信息。

    代码示例:
    //Java code
    public void handleConfIncomingInd(TsdkConference conference){
        if (null == conference)
        {
            return;
        }
        currentConference = conference;
        TsdkCall tsdkCall = conference.getCall();
        if (null != tsdkCall) {
            Session newSession = CallMgr.getInstance().getCallSessionByCallID(tsdkCall.getCallInfo().getCallId());
            if (null == newSession) {
                newSession = new Session(tsdkCall);
                CallMgr.getInstance().putCallSessionToMap(newSession);
            }
        }
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.CONF_INCOMING_TO_CALL_INCOMING, conference);
    }
    
     

     

  2. 被邀与会者侧UI调用TsdkConference对象中的acceptConference()方法接听会议来电。

     

    说明: 

    若用户拒绝接听会议来电,则通过调用TsdkConference对象中的rejectConference()方法拒接会议来电。

    代码示例:
    //Java code
    public int acceptConf(boolean isVideo)
    {
        Log.i(TAG,  "accept conf.");
    
        if (null == currentConference)
        {
            Log.i(TAG,  "accept conf, currentConference is null ");
            return 0;
        }
    
        int result = currentConference.acceptConference(isVideo);
        if (result == 0) {
            Log.i(TAG,  "accept conf");
        }
    
        return result;
    }
    
     
    //Java code
    public int rejectConf()
    {
        Log.i(TAG,  "reject conf.");
    
        if (null == currentConference)
        {
            Log.i(TAG,  "reject conf, currentConference is null ");
            return 0;
        }
    
        int result = currentConference.rejectConference();
        if (result == 0) {
            currentConference = null;
        }
    
        return result;
    }
    
     

     

  3. SDK在收到服务器返回的加入会议响应后,通过TsdkNotify对象中的onEvtJoinConfResult()方法向UI上报会议加入结果事件。并返回会议对象TsdkConference,后续会控时使用,此时, UI可跳转至会议界面。

     

    说明: 
    1. 在加入会议时,会请求会议权限,若请求失败,则通过TsdkNotify对象中的onEvtRequestConfRightFailed()方法向UI上报会议权限请求失败通知,UI提示申请会控权限失败,若请求成功,则不上报。
    2. 若应用程序是以多流的方式(SVC)成功加入会议,则此结果通知中会携带SVC信息,包含 isSvcConf (是否多流会议)、svcLabelCount(可使用的多流Label数) 和 svcLabel (多流Label 表),应用程序应保存多流“Label”信息,用于后继流程中“绑定SVC视频窗口”、"选看SVC与会者"和“设置SVC窗口和与会者关系”等操作。
    代码示例:
    //Java code
    public void handleJoinConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult, TsdkJoinConfIndInfo tsdkJoinConfIndInfo
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        if (result == 0)
        {
            this.currentConference = tsdkConference;
            this.memberList = null;
            this.self = null;
            TsdkCall tsdkCall = tsdkConference.getCall();
            if (null != tsdkCall) {
                Session newSession = CallMgr.getInstance().getCallSessionByCallID(tsdkCall.getCallInfo().getCallId());
                if (null == newSession) {
                    newSession = new Session(tsdkCall);
                    CallMgr.getInstance().putCallSessionToMap(newSession);
                }
                if (tsdkCall.getCallInfo().getIsVideoCall() == 1) {
                    VideoMgr.getInstance().initVideoWindow(tsdkCall.getCallInfo().getCallId());
                }
            }
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_SUCCESS, tsdkConference.getHandle() + "");
        }
        else
        {
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_FAILED, result);
        }
    }
    
     

     

  4. SDK收到会议状态刷新通知,通过TsdkNotify对象中的onEvtInfoAndStatusUpdate()方法向UI上报会议信息及状态更新事件,UI刷新会议状态和成员列表。

     

    说明: 

    详细流程参见会议信息及会议状态更新描述。

     

注意事项

无。

匿名加入会议

描述

用户在未注册EC帐号时,通过匿名方式加入会议。

前提条件

会议已经创建,且用户通过第三方方式获取到会议ID和密码。

业务流程

图4 匿名加入会议流程 
  1. UI调用TsdkConferenceManager对象中的joinConferenceByAnonymous()方法来匿名加入会议。

     

    说明: 

    参数TsdkConfAnonymousJoinParam中的服务器地址和端口,指会议服务器的地址和端口。

    代码示例:
    //Java code
    //set local IP
    String localIpAddress = DeviceManager.getLocalIpAddress(false);
    TsdkLocalAddress localAddress = new TsdkLocalAddress(localIpAddress);
    TsdkManager.getInstance().setConfigParam(localAddress);
    
    TsdkConfAnonymousJoinParam anonymousParam = new TsdkConfAnonymousJoinParam();
    anonymousParam.setConfId(joinParam.getAnonymousConfId());
    anonymousParam.setConfPassword(joinParam.getConfPassword());
    anonymousParam.setDisplayName(joinParam.getDisplayName());
    anonymousParam.setServerAddr(joinParam.getServiceAddress());
    anonymousParam.setServerPort(Integer.valueOf(joinParam.getServicePort()));
    anonymousParam.setUserId(1);
    
    int result = TsdkManager.getInstance().getConferenceManager().joinConferenceByAnonymous(anonymousParam);
    
     

     

  2. SDK通过TsdkNotify对象中的onEvtGetTempUserResult()方法向UI上报临时帐号获取结果事件。

     

    说明: 

    若此次事件通知返回失败,应用程序界面应提示用户。

    代码示例:
    //Java code
    public void handleGetTempUserResult(int userId, TsdkCommonResult result)
    {
        if(result == null){
            return;
        }
        mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.GET_TEMP_USER_RESULT, result);
    }
    
     

     

  3. SDK通过TsdkNotify对象中的onEvtJoinConfResult()方法向UI上报加入会议结果,后续和正常入会流程一样。

     

    说明: 

    匿名会议过程中,无论用户采用主席密码入会或是普通与会者密码入会,均只有设置自己闭音的会控能力,其他会控能力暂不支持。

    代码示例:
    //Java code
    public void handleJoinConfResult(TsdkConference tsdkConference, TsdkCommonResult commonResult, TsdkJoinConfIndInfo tsdkJoinConfIndInfo
        Log.i(TAG, "handleJoinConfResult");
        if ((tsdkConference == null) || (commonResult == null)) {
            return;
        }
        int result = commonResult.getResult();
        if (result == 0)
        {
            this.currentConference = tsdkConference;
            this.memberList = null;
            this.self = null;
            TsdkCall tsdkCall = tsdkConference.getCall();
            if (null != tsdkCall) {
                Session newSession = CallMgr.getInstance().getCallSessionByCallID(tsdkCall.getCallInfo().getCallId());
                if (null == newSession) {
                    newSession = new Session(tsdkCall);
                    CallMgr.getInstance().putCallSessionToMap(newSession);
                }
                if (tsdkCall.getCallInfo().getIsVideoCall() == 1) {
                    VideoMgr.getInstance().initVideoWindow(tsdkCall.getCallInfo().getCallId());
                }
            }
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_SUCCESS, tsdkConference.getHandle() + "");
        }
        else
        {
            mConfNotification.onConfEventNotify(ConfConstant.CONF_EVENT.JOIN_CONF_FAILED, result);
        }
    }