7#ifndef _NIM_SDK_CPP_RTS_H_
8#define _NIM_SDK_CPP_RTS_H_
65 std::string GetJsonStr() {
90class NIM_SDK_CPPWRAPPER_DLL_API
Rts {
92 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id,
int channel_type,
const std::string& uid)>
94 typedef std::function<void(
const std::string& session_id,
int channel_type,
const std::string& uid,
const std::string& custom_info)>
96 typedef std::function<void(
nim::NIMResCode res_code)> CreateConfCallback;
97 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id, int64_t channel_id,
const std::string& custom_info)>
99 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id,
int channel_type,
bool accept)> AckCallback;
100 typedef std::function<void(
const std::string& session_id,
int channel_type,
bool accept,
const std::string& uid)> AckNotifyCallback;
101 typedef std::function<void(
const std::string& session_id,
int channel_type,
bool accept)> SyncAckNotifyCallback;
102 typedef std::function<void(
const std::string& session_id,
int channel_type,
int code,
const std::string& json)> ConnectNotifyCallback;
103 typedef std::function<void(
const std::string& session_id,
int channel_type,
const std::string& uid,
int code,
int leave_type)>
104 MemberNotifyCallback;
105 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id)> HangupCallback;
106 typedef std::function<void(
const std::string& session_id,
const std::string& uid)> HangupNotifyCallback;
107 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id,
const std::string& info)> ControlCallback;
108 typedef std::function<void(
const std::string& session_id,
const std::string& info,
const std::string& uid)> ControlNotifyCallback;
109 typedef std::function<void(
const std::string& session_id,
int channel_type,
const std::string& uid,
const std::string& data)> RecDataCallback;
110 typedef std::function<void(
nim::NIMResCode res_code,
const std::string& session_id,
int channel_type,
const std::string& json)> OptCallback;
121 static void SetProxy(
NIMProxyType type,
const std::string& host,
int port,
const std::string& user,
const std::string& password);
138 static void StartChannel(
int channel_type,
const std::string& uid,
RtsStartInfo info,
const StartChannelCallback& cb);
148 static void SetStartNotifyCb(
const StartNotifyCallback& cb);
159 static void CreateConf(
const std::string& name,
const std::string& custom_info,
const CreateConfCallback& cb);
171 static void JoinConf(
const std::string& name,
const std::string& session_id,
bool record,
const JoinConfCallback& cb);
183 static void Ack(
const std::string& session_id,
int channel_type,
bool accept,
bool data_record,
bool audio_record,
const AckCallback& cb);
192 static void SetAckNotifyCb(
const AckNotifyCallback& cb);
199 static void SetSyncAckNotifyCb(
const SyncAckNotifyCallback& cb);
207 static void SetConnectNotifyCb(
const ConnectNotifyCallback& cb);
215 static void SetMemberChangeCb(
const MemberNotifyCallback& cb);
225 static void Control(
const std::string& session_id,
const std::string& info,
const ControlCallback& cb);
232 static void SetControlNotifyCb(
const ControlNotifyCallback& cb);
240 static void SetVChatMode(
const std::string& session_id,
int mode);
249 static void Hangup(
const std::string& session_id,
const HangupCallback& cb);
256 static void SetHangupNotifyCb(
const HangupNotifyCallback& cb);
265 static void Relogin(
const std::string& session_id,
int channel_type, OptCallback cb);
277 static void SendData(
const std::string& session_id,
int channel_type,
const std::string& data,
const std::string& uid =
"");
285 static void SetRecDataCb(
const RecDataCallback& cb);
NIM Rts提供的相关接口
Definition: nim_cpp_rts.h:90
Represents a JSON value.
Definition: value.h:196
std::string GetJsonStringWithNoStyled(const nim_cpp_wrapper_util::Json::Value &values)
获得非格式化的Json string,传入SDK的json string格式要求为非格式化的,如果是格式化的json string可能会影响功能
Definition: nim_json_util.cpp:89
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIMProxyType
Definition: nim_global_def.h:186
static const char * kNIMRtsCreateCustomInfo
string 自定义数据,透传给被邀请方 nim_rts_ack无效
Definition: nim_rts_def.h:92
static const char * kNIMRtsWebRtc
int, 是否支持webrtc互通(针对点对点中的音频通话)
Definition: nim_rts_def.h:106
static const char * kNIMRtsAudioRecord
int 是否需要服务器录制音频数据 >0表示是
Definition: nim_rts_def.h:88
static const char * kNIMRtsNeedBadge
int 是否需要角标计数 >0表示是 默认是
Definition: nim_rts_def.h:96
static const char * kNIMRtsApnsText
string 推送用的文本 nim_rts_ack无效
Definition: nim_rts_def.h:90
static const char * kNIMRtsVChatCustomAudio
int 是否用自主的音频数据 >0表示是
Definition: nim_rts_def.h:84
static const char * kNIMRtsPushEnable
int 是否需要推送 >0表示是 默认是
Definition: nim_rts_def.h:94
static const char * kNIMRtsApnsPayload
string JSON格式,推送payload
Definition: nim_rts_def.h:100
static const char * kNIMRtsSound
string 推送声音
Definition: nim_rts_def.h:102
static const char * kNIMRtsSessionId
string 发起会话的标识id,将在创建点对点和多人通话时,如果填写了此参数优先使用用户填写的session_id
Definition: nim_rts_def.h:78
static const char * kNIMRtsKeepCalling
int, 是否强制持续呼叫(对方离线也会呼叫),1表示是,0表示否。默认是
Definition: nim_rts_def.h:104
static const char * kNIMRtsVChatCustomVideo
int 是否用自主的视频数据 >0表示是
Definition: nim_rts_def.h:82
static const char * kNIMRtsNeedFromNick
int 是否需要推送昵称 >0表示是 默认是
Definition: nim_rts_def.h:98
static const char * kNIMRtsDataRecord
int 是否需要服务器录制白板数据 >0表示是
Definition: nim_rts_def.h:86
NIM SDK 及 NIM ChatRoom SDK 公用头文件
点对点白板发起的参数信息
Definition: nim_cpp_rts.h:24
bool need_nick_
是否需要推送昵称
Definition: nim_cpp_rts.h:42
std::string payload_
JSON格式,推送payload.
Definition: nim_cpp_rts.h:44
bool keepcalling_
是否强制持续呼叫(对方离线也会呼叫)
Definition: nim_cpp_rts.h:48
std::string custom_info_
string 自定义数据,透传给被邀请方
Definition: nim_cpp_rts.h:36
std::string apns_
推送用的文本
Definition: nim_cpp_rts.h:34
bool custom_video_
是否用自主的视频数据
Definition: nim_cpp_rts.h:26
bool webrtc_
是否支持webrtc互通(针对点对点中的音频通话)
Definition: nim_cpp_rts.h:50
bool custom_audio_
是否用自主的音频数据
Definition: nim_cpp_rts.h:28
bool data_record_
是否需要服务器录制白板数据
Definition: nim_cpp_rts.h:30
std::string session_id_
会话id
Definition: nim_cpp_rts.h:52
std::string sound_
推送声音
Definition: nim_cpp_rts.h:46
bool need_badge_
是否需要角标计数
Definition: nim_cpp_rts.h:40
bool audio_record_
是否需要服务器录制音频数据
Definition: nim_cpp_rts.h:32
bool push_enable_
是否需要推送
Definition: nim_cpp_rts.h:38