呼叫
功能简介 : 实现用户到用户的呼叫,以此来实现通话信息的分发
主叫方:
被叫方:
主叫方
1. 发起呼叫
呼叫发起方, 发送呼叫请求。
- 调用接口:
// 设置管理回调(账号登陆、房间管理、呼叫管理)
[[CloudroomVideoMgr shareInstance] setMgrCallback:self];
//开始呼叫,meetInfo为之前创建的房间对象
NSString* userID = @"user_000007";
NSString* callID = [[CloudroomVideoMgr shareInstance] call:userID meetInfo:meetingInfo param:@""];
- 回调通知:
//呼叫成功发出,等待对方响应
- (void)callSuccess:(NSString *)callID cookie:(NSString *)cookie{
//...
}
//呼叫发出失败
- (void)callFail:(NSString *)callID errCode:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie {
//...
}
相关API请参考:
2. 呼叫被接受/拒绝
呼叫方的呼叫请求返回响应处理
- (void)notifyCallAccepted:(NSString *)callID meetInfo:(MeetInfo *)meetInfo usrExtDat:(NSString *)usrExtDat{
//...
}
//呼叫被对方拒绝
- (void)notifyCallRejected:(NSString *)callID reason:(CRVIDEOSDK_ERR_DEF)reason usrExtDat:(NSString *)usrExtDat {
//...
}
相关API请参考:
被叫方
1. 被呼叫通知
被呼叫方的相关交互函数和回调接口
- 接口调用
// 设置管理回调(账号登陆、房间管理、呼叫管理)
[[CloudroomVideoMgr shareInstance] setMgrCallback:self];
- 回调通知
//有呼叫进入
- (void)notifyCallIn:(NSString *)callID meetInfo:(MeetInfo *)meetInfo callerID:(NSString *)callerID usrExtDat:(NSString *)usrExtDat
{
if(/*接受呼叫, 进入房间*/){
//打开房间界面……
}else{
//拒绝对方的呼叫
}
}
相关API请参考:
2.接受/拒绝/挂断呼叫
用户在接受呼叫后,通过sdk的呼叫接口进行交互操作
调用接口:
//接受呼叫 (notifyCallIn回调参数meetInfo)
[[CloudroomVideoMgr shareInstance] acceptCall:@"call" meetInfo:meetInfo];
//拒绝呼叫
[[CloudroomVideoMgr shareInstance] rejectCall:@"callID"];
//挂断呼叫
[[CloudroomVideoMgr shareInstance] hungupCall:@"callID"];
回调通知:
//接受呼叫成功
- (void)acceptCallSuccess:(NSString *)callID cookie:(NSString *)cookie{
//...
}
//接受呼叫失败
- (void)acceptCallFail:(NSString *)callID errCode:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie{
//...
}
//拒绝呼叫成功
- (void)rejectCallSuccess:(NSString *)callID cookie:(NSString *)cookie{
//...
}
//拒绝呼叫失败
- (void)rejectCallFail:(NSString *)callID errCode:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie{
//...
}
//挂断呼叫成功
- (void)hangupCallSuccess:(NSString *)callID cookie:(NSString *)cookie{
//...
}
//挂断呼叫失败
- (void)hangupCallFail:(NSString *)callID errCode:(CRVIDEOSDK_ERR_DEF)sdkErr cookie:(NSString *)cookie{
//...
}
相关API请参考: