#include "rtc_private.h"
#include "core_global.h"
#include "alirtc_iot_sdk.h"
|
#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实例, 释放资源 更多...
|
|
#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*
- 返回值
-
非NULL | rtc实例句柄 |
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 |
|
) |
| |
主叫方发起会议, 邀请被叫方入会
- 参数
-
- 返回
- int32_t
- 返回值
-
STATE_SUCCESS | 邀请发送成功 |
STATE_USER_INPUT_NULL_POINTER | 入参handle或data为NULL |
STATE_RTC_MQTT_HANDLE_IS_NULL | mqtt句柄未配置 |
others | 参考aiot_state_api.h |
int32_t aiot_rtc_guest_resonse |
( |
void * |
handle, |
|
|
aiot_rtc_msg_t * |
msg |
|
) |
| |
被叫方发送响应
- 参数
-
- 返回
- int32_t
- 返回值
-
STATE_SUCCESS | 回复发送成功 |
STATE_USER_INPUT_NULL_POINTER | 入参handle或data为NULL |
STATE_RTC_MQTT_HANDLE_IS_NULL | mqtt句柄未配置 |
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 |
设置rtc参数
- 参数
-
- 返回
- 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] | handle | rtc实例句柄 |
[in] | channel_id | 会议的通道id |
- 返回
- int32_t
- 返回值
-
STATE_SUCCESS | 请求发送成功 |
STATE_USER_INPUT_NULL_POINTER | 入参handle或data为NULL |
STATE_RTC_MQTT_HANDLE_IS_NULL | mqtt句柄未配置 |
others | 参考aiot_state_api.h |
int32_t aiot_rtc_guest_leave_channel |
( |
void * |
handle, |
|
|
char * |
channel_id |
|
) |
| |
被叫方主动离开会议
- 参数
-
[in] | handle | rtc实例句柄 |
[in] | channel_id | 会议的通道id |
- 返回
- int32_t
- 返回值
-
STATE_SUCCESS | 请求发送成功 |
STATE_USER_INPUT_NULL_POINTER | 入参handle或data为NULL |
STATE_RTC_MQTT_HANDLE_IS_NULL | mqtt句柄未配置 |
others | 参考aiot_state_api.h |
int32_t aiot_rtc_remove_guest |
( |
void * |
handle, |
|
|
char * |
channel_id, |
|
|
char * |
pk, |
|
|
char * |
dn |
|
) |
| |
主叫方将某个被叫方移出会议
- 参数
-
[in] | handle | rtc实例句柄 |
[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_NULL | mqtt句柄未配置 |
others | 参考aiot_state_api.h |
int32_t aiot_rtc_deinit |
( |
void ** |
handle | ) |
|
销毁rtc实例, 释放资源
- 参数
-
- 返回
- int32_t
- 返回值
-
STATE_SUCCESS | 执行成功 |
<STATE_SUCCESS | 执行失败 |
初始值:= {
"accept",
"reject",
"leave",
"ack",
"busy",
"terminate",
}
初始值:= {
{
"/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