Link Kit C-SDK  4.0.0
宏定义 | 函数 | 变量
aiot_rtc_api.c 文件参考
#include "rtc_private.h"
#include "core_global.h"
#include "alirtc_iot_sdk.h"
aiot_rtc_api.c 的引用(Include)关系图:

宏定义

#define REMOVE_GUEST_FMT   "{\"identifier\":\"_VAS.Rtc.Remove\",\"serviceParams\":{\"removeDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
 
#define GUEST_LEAVE_FMT   "{\"identifier\":\"_VAS.Rtc.Leave\",\"serviceParams\":{\"channelId\":\"%s\"}}"
 
#define TERMINATE_CHANNEL_FMT   "{\"identifier\":\"_VAS.Rtc.Terminate\",\"serviceParams\":{\"channelId\":\"%s\"}}"
 
#define TERMINATE_CHANNEL_WITH_GUEST_INFO   "{\"identifier\":\"_VAS.Rtc.Terminate\",\"serviceParams\":{\"invitedDevices\":[{\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
 
#define INVITE_MORE_GUEST_FMT   "{\"identifier\":\"_VAS.Rtc.Invite\",\"serviceParams\":{\"invitedDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
 
#define CHANNEL_REQ_FMT   "{\"identifier\":\"_VAS.Rtc.Call\",\"serviceParams\":{\"comunicationId\":\"testId\",\"invitedDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelType\":\"video\",\"callType\":\"1v1\"}}"
 
#define GUEST_RESPONSE_FMT   "{\"identifier\":\"_VAS.Rtc.CallReply\",\"serviceParams\":{\"callerIotId\":\"%s\",\"action\":\"%s\",\"channelId\":\"%s\"}}"
 

函数

void * aiot_rtc_init (void)
 初始化rtc实例 更多...
 
static int32_t _rtc_send_alink_req (rtc_handle_t *handle, const char *topic, char *params)
 
static int32_t _rtc_send_service_post (rtc_handle_t *handle, const char *topic, const aiot_rtc_msg_t *msg)
 
static int32_t _rtc_prepare_send_topic (rtc_handle_t *rtc_handle, const aiot_rtc_msg_t *msg, char **topic)
 
int32_t aiot_rtc_launch_channel (void *handle, aiot_rtc_msg_t *msg)
 主叫方发起会议, 邀请被叫方入会 更多...
 
int32_t aiot_rtc_guest_resonse (void *handle, aiot_rtc_msg_t *msg)
 被叫方发送响应 更多...
 
static void _rtc_recv_invoke (void *handle, const aiot_mqtt_recv_t *msg, void *userdata)
 
static void _rtc_recv_post_reply (void *handle, const aiot_mqtt_recv_t *msg, void *userdata)
 
static int32_t _rtc_setup_topic_mapping (void *mqtt_handle, void *rtc_handle)
 
int32_t aiot_rtc_setopt (void *handle, aiot_rtc_option_t option, void *data)
 设置rtc参数 更多...
 
int32_t aiot_rtc_invite_guest (void *handle, char *channel_id, char *pk, char *dn)
 邀请更多用户入会. 本期暂不支持. 更多...
 
int32_t aiot_rtc_cancel_channel (void *handle, char *channel_id)
 取消会议, 所有参会者退出 更多...
 
int32_t aiot_rtc_guest_leave_channel (void *handle, char *channel_id)
 被叫方主动离开会议 更多...
 
int32_t aiot_rtc_remove_guest (void *handle, char *channel_id, char *pk, char *dn)
 主叫方将某个被叫方移出会议 更多...
 
int32_t aiot_rtc_deinit (void **p_handle)
 销毁rtc实例, 释放资源 更多...
 

变量

char * action_map [6]
 
static const rtc_send_topic_map_t g_rtc_send_topic_mapping [AIOT_RTCMSG_MAX]
 
static const rtc_recv_topic_map_t g_rtc_recv_topic_mapping []
 

宏定义说明

#define REMOVE_GUEST_FMT   "{\"identifier\":\"_VAS.Rtc.Remove\",\"serviceParams\":{\"removeDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
#define GUEST_LEAVE_FMT   "{\"identifier\":\"_VAS.Rtc.Leave\",\"serviceParams\":{\"channelId\":\"%s\"}}"
#define TERMINATE_CHANNEL_FMT   "{\"identifier\":\"_VAS.Rtc.Terminate\",\"serviceParams\":{\"channelId\":\"%s\"}}"
#define TERMINATE_CHANNEL_WITH_GUEST_INFO   "{\"identifier\":\"_VAS.Rtc.Terminate\",\"serviceParams\":{\"invitedDevices\":[{\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
#define INVITE_MORE_GUEST_FMT   "{\"identifier\":\"_VAS.Rtc.Invite\",\"serviceParams\":{\"invitedDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelId\":\"%s\"}}"
#define CHANNEL_REQ_FMT   "{\"identifier\":\"_VAS.Rtc.Call\",\"serviceParams\":{\"comunicationId\":\"testId\",\"invitedDevices\":[{\"iotId\":\"\",\"productKey\":\"%s\",\"deviceName\":\"%s\"}],\"channelType\":\"video\",\"callType\":\"1v1\"}}"
#define GUEST_RESPONSE_FMT   "{\"identifier\":\"_VAS.Rtc.CallReply\",\"serviceParams\":{\"callerIotId\":\"%s\",\"action\":\"%s\",\"channelId\":\"%s\"}}"

函数说明

void* aiot_rtc_init ( void  )

初始化rtc实例

返回
void*
返回值
非NULLrtc实例句柄
NULL初始化失败, 一般是内存分配失败导致

函数调用图:

static int32_t _rtc_send_alink_req ( rtc_handle_t *  handle,
const char *  topic,
char *  params 
)
static

函数调用图:

static int32_t _rtc_send_service_post ( rtc_handle_t *  handle,
const char *  topic,
const aiot_rtc_msg_t msg 
)
static

函数调用图:

static int32_t _rtc_prepare_send_topic ( rtc_handle_t *  rtc_handle,
const aiot_rtc_msg_t msg,
char **  topic 
)
static

函数调用图:

int32_t aiot_rtc_launch_channel ( void *  handle,
aiot_rtc_msg_t msg 
)

主叫方发起会议, 邀请被叫方入会

参数
[in]handlertc实例句柄
[in]msg要发送的消息aiot_rtc_msg_t
返回
int32_t
返回值
STATE_SUCCESS邀请发送成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_RTC_MQTT_HANDLE_IS_NULLmqtt句柄未配置
others参考aiot_state_api.h

函数调用图:

int32_t aiot_rtc_guest_resonse ( void *  handle,
aiot_rtc_msg_t msg 
)

被叫方发送响应

参数
[in]handlertc实例句柄
[in]msg要发送的消息aiot_rtc_msg_t
返回
int32_t
返回值
STATE_SUCCESS回复发送成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_RTC_MQTT_HANDLE_IS_NULLmqtt句柄未配置
others参考aiot_state_api.h

函数调用图:

static void _rtc_recv_invoke ( void *  handle,
const aiot_mqtt_recv_t msg,
void *  userdata 
)
static
static void _rtc_recv_post_reply ( void *  handle,
const aiot_mqtt_recv_t msg,
void *  userdata 
)
static
static int32_t _rtc_setup_topic_mapping ( void *  mqtt_handle,
void *  rtc_handle 
)
static

函数调用图:

int32_t aiot_rtc_setopt ( void *  handle,
aiot_rtc_option_t  option,
void *  data 
)

设置rtc参数

参数
[in]handlertc实例句柄
[in]option配置选项, 更多信息请查看aiot_rtc_option_t
[in]data配置数据, 更多信息请查看aiot_rtc_option_t
返回
int32_t
返回值
STATE_SUCCESS参数配置成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_USER_INPUT_OUT_RANGE入参optioin的枚举值>=AIOT_RTCOPT_MAX
others参考aiot_state_api.h

函数调用图:

int32_t aiot_rtc_invite_guest ( void *  handle,
char *  channel_id,
char *  pk,
char *  dn 
)

邀请更多用户入会. 本期暂不支持.

函数调用图:

int32_t aiot_rtc_cancel_channel ( void *  handle,
char *  channel_id 
)

取消会议, 所有参会者退出

参数
[in]handlertc实例句柄
[in]channel_id会议的通道id
返回
int32_t
返回值
STATE_SUCCESS请求发送成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_RTC_MQTT_HANDLE_IS_NULLmqtt句柄未配置
others参考aiot_state_api.h

函数调用图:

int32_t aiot_rtc_guest_leave_channel ( void *  handle,
char *  channel_id 
)

被叫方主动离开会议

参数
[in]handlertc实例句柄
[in]channel_id会议的通道id
返回
int32_t
返回值
STATE_SUCCESS请求发送成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_RTC_MQTT_HANDLE_IS_NULLmqtt句柄未配置
others参考aiot_state_api.h

函数调用图:

int32_t aiot_rtc_remove_guest ( void *  handle,
char *  channel_id,
char *  pk,
char *  dn 
)

主叫方将某个被叫方移出会议

参数
[in]handlertc实例句柄
[in]channel_id会议的通道id
[in]pk被叫方的product_key
[in]dn被叫方的device_name
返回
int32_t
返回值
STATE_SUCCESS请求发送成功
STATE_USER_INPUT_NULL_POINTER入参handle或data为NULL
STATE_RTC_MQTT_HANDLE_IS_NULLmqtt句柄未配置
others参考aiot_state_api.h

函数调用图:

int32_t aiot_rtc_deinit ( void **  handle)

销毁rtc实例, 释放资源

参数
[in]handle指向rtc实例句柄的指针
返回
int32_t
返回值
STATE_SUCCESS执行成功
<STATE_SUCCESS执行失败

函数调用图:

变量说明

char* action_map[6]
初始值:
= {
"accept",
"reject",
"leave",
"ack",
"busy",
"terminate",
}
const rtc_send_topic_map_t g_rtc_send_topic_mapping[AIOT_RTCMSG_MAX]
static
初始值:
= {
{
"/sys/%s/%s/_thing/service/post",
},
{
"/sys/%s/%s/_thing/service/post",
},
{
"/sys/%s/%s/_thing/service/post",
},
{
"/sys/%s/%s/_thing/service/post",
},
{
"/sys/%s/%s/_thing/service/post",
},
{
"/sys/%s/%s/_thing/service/post",
}
}
static int32_t _rtc_send_service_post(rtc_handle_t *handle, const char *topic, const aiot_rtc_msg_t *msg)
Definition: aiot_rtc_api.c:93
const rtc_recv_topic_map_t g_rtc_recv_topic_mapping[]
static
初始值:
= {
{
"/sys/+/+/_thing/service/invoke",
},
{
"/sys/+/+/_thing/service/post_reply",
}
}
static void _rtc_recv_post_reply(void *handle, const aiot_mqtt_recv_t *msg, void *userdata)
Definition: aiot_rtc_api.c:591
static void _rtc_recv_invoke(void *handle, const aiot_mqtt_recv_t *msg, void *userdata)
Definition: aiot_rtc_api.c:357